Getting shadows to work in Three.js custom shader
I'm trying to get shadows to work in a custom shader in Three.js. I've tried to add these into my codes: In uniforms: THREE.UniformsLib["shadowmap"] In the fragment shader: THREE.ShaderChunk["shadowmap_pars_fragment"] THREE.ShaderChunk["shadowmap_fragment"] In the vertex shader: THREE.ShaderChunk["shadowmap_pars_vertex"] THREE.ShaderChunk["shadowmap_vertex"] which works. The object can receive shadows. However, it cannot cast shadows. Does anyone know what other bits of codes are needed? I believe that you need to mark each object as casting and receiving shadows I think its just obj