Monday, October 16, 2017

How to cast and receive shadows with RawShaderMaterial?

Leave a Comment

I have a RawShaderMaterial with lighting for InstancedBufferGeometry

How can I cast and receive shadows with this shader?

Here is my material:

var uniforms = Object.assign(      THREE.UniformsLib['lights'],      {         map: { type: "t", value: texture },     }     );  var material = new THREE.RawShaderMaterial( {     lights: true,     uniforms: uniforms,     vertexShader: document.getElementById( 'vs' ).textContent,     fragmentShader: document.getElementById( 'fs' ).textContent,     transparent: false     } ); 

Full example: http://thegrook.com/three.js/shadow1.html

Thanks

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment