The ideal workaround would be to create a custom shader adapting these to your needs. In this case, probably removing all the vLightBack calculation and just using vLightFront independant of which side is being drawn.
A hacky way to do it, is just replacing the reflectedLight.directDiffuse using onBeforeCompile to just account for vLightFront. Modified JSFiddle
But keep in mind that all the extra back light logic is still being calculated, and given the amount of instances… it would be worth removing all of that.
Hope everyone’s well.
Today i migrated from version r122 to r145. I see that perturbNormal2Arb function now gets 4 values instead of 3. 4h value is now faceDirection.
I use meshphongmaterial and altough i add the line like below;
Well working version here with r122: https://jamir.io
I will check my vertex sorting function but i dont think it is related with that.
Light wasnt affecting with different rotations of planes when i replace like the above code. If it was working on r122 it should also work on r145. There must be a change on r145 that affects the initial vnormal value maybe?
If you want to ignore the faceDirection on any particular mesh group (folliage for instance) still using the new version of MeshLambertMaterial, you’ll need to ignore this bit of shader code directly on the fragment shader, specifically we are looking at this chunk: normal_fragment_begin
Which if you compare with the original shader, ignores DOUBLE_SIDED, USE_TANGENT pre-processor conditions and prevents your normal from being mirrored. This code should also work properly for any other variant of the core materials, since maintainers made sure that every one is using this same chunk. This is now a more standard “hack”. Let me know if you guys have any trouble.
Oh i see now there are front-facing blades, looked like grass-blade-less ground on first sight. And good to mention that change here @sciecode
Also as suggestion to @jackiejean388 for small foliage like grass ground aligned normals can make you get rid of any such shading issue blending it more seamless with the ground. Just making the blade normal face the direction of the ground.