5

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?

skeelogy
  • 397
  • 2
  • 12

1 Answers1

-4

I believe that you need to mark each object as casting and receiving shadows

I think its just

obj.castShadow = true;
obj.recieveShadow = true;
rydrman
  • 135
  • 3
  • 7