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? 回答1: