hi All,
i just started to make my first shader and while i start to understand how it work to make one and use it in three.js , i still doesn’t understand a lot of things.
The first problem I can’t seem to overcome is how to make my shader reflect on all objects in my scene. Is there a possibility for my shader to generate light that reflects on the objects in my scene?
i made the plane like this but the material doesnt interact with all the other object of my scene.
Can someone give me a direction to go on?
const xmaterial = new THREE.RawShaderMaterial({
vertexShader: vertexSahder,
fragmentShader: fragment,
uniforms:
{
uTime:{value :0.0},
uMouse: { value: new THREE.Vector2(0.0, 0.0) },
uVitesseGlobale:{value :0.2},
uDivision:{value :0.2},
uRayon:{value :0.4},
uAmplitude:{value :2.4},
uMicroSommet:{value :4.4},
uNoir:{value :0.45},
}
})
const geometry = new THREE.PlaneGeometry(24,10,350,500)
//SOL
const plan = new THREE.Mesh (
geometry,
xmaterial,
)
Thansk a lot,
Pierre