i see on many shader there is a many reference for geometryViewDir, i mlooking for the variable that make a object change it color depending if the camera and the source of light are aligned or not , for example, if the light and the camera have the same direction , the color is x and when the camera and the source of light are opositte the color is y , i added a small video of it, three.js/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js at dev · mrdoob/three.js · GitHub
i have a big issue where depending if the camera is aligned or in oposite position of the source of light , the color changes which is very bad , i want to cancel it , i tried to do it by setting a normal to normal = vec3(0.0, 1.0, 0.0); but i still have the error
thanks you but i mean what i need is to make the current pipeline of shadow view agnostic for meshstandard material since i want to reuse since it has the shadow pipeline , so far i had made this tries
using mesh basic material i injected the shadow system from mesh stanard material but i cannot get the same color , tried to inject a few shader but didnt worked
i rollbacked to use mesh standard material and trying to find the part that make the color change when the camera rotate to disable it as the vieo shown, as you see the color of the grass changes when the camera is aligned or not aligned with the source of light , as far as a know it should be caused by a dot product somewhere but not sure which , i know is physical correct but dont like it to be applied on the grass , so far im able to get this
Remove or disable all the lights in your scene. Make sure you’re not setting an environment map. Verify that your scene geometry renders entirely black from all directions.
Then add a single:
scene.add(new THREE.AmbientLight(‘white’))
Verify that the lighting is the same from all directions.
— What you DONT want to do, is try to break the lighting fragments you’re including in the custom shader. Those fragments will already correctly observe the lighting conditions set up in your scene, and if you only have a single AmbientLight.. the lighting should be uniform from all directions. If it isn’t, then there may be an issue somewhere else. (perhaps a stray environment map or light or something)
loved the idea , i merged your idea with older version of mine , make the grass beleive here is no directional light and still having them as mesh standard material so magically everythign work but there is no view dependence, grass work work ambient light only while other still work with the dirtectional light