I have a scene with objects intersected using Lambert material, like in this jsFiddle.
Now I need/want to switch the material of that plane to a Shader material and the plane turns into a background thing, like here.
The question is, can I use different materials in objects and still preserve the intersection effect? Is this a Three.js limitation or this is how shaders works? Or am I missing a parameter in the renderer/material?
At the moment is not an option no switch all my work to shader materials in order to take advantage of shaders.
This is how I set up the material:
var material1 = new THREE.ShaderMaterial( {
uniforms: {
color: { type: "c", value: new THREE.Color( 0x22A8E7 ) }
},
vertexShader: document.getElementById( 'vertexShader' ).textContent,
fragmentShader: document.getElementById( 'fragmentShader' ).textContent,
opacity: 0.5,
transparent: true,
} );
Thanks!