I have some trees and the leaves reflect the sunlight in a weird way.
I’d like to just remove light reflection entirely, which seems like a straightforward thing to do. I found if I add an entirely black roughnessMap then it almost works.
But there is still that one specific angle that fully reflects the light. Is there any support for what I’m asking, or do I have to monkey patch the shader for it?
Thanks guys.
MeshBasicMaterial might be what you want here, it will be uniformly lit regardless of lighting.
Well, it’s not that I don’t want the leaves to be lit by the sunlight (because that would be an issue when the game cycles to nighttime), but rather that I don’t want the leaves to reflect the light
you can use the MeshLamberMaterial
.
It reacts to lighting but doesn’t have a specular shine.
2 Likes
If you do not wish to lose rendering aspects of MeshPhysicalMaterial or MeshStandardMaterial.
You can disable the direct specular.
this.material.onBeforeCompile = shader => {
shader.fragmentShader =
shader.fragmentShader.replace(
'vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;',
'vec3 totalSpecular = reflectedLight.indirectSpecular;'
)
};
Source : three.js/src/renderers/shaders/ShaderLib/meshphysical.glsl.js at 87cc614d3932b85a2281d90068ddbac57712e294 · mrdoob/three.js · GitHub
1 Like