Snupty
August 5, 2022, 10:38am
1
Hi there, where is getNormal() for fragment shaders defined as of v1.55? It used to be defined in the shader chunk “normalVertexPS” but overriding that doesn’t work anymore.
Hi @Snupty ,
Vertex normals were added on the regular normalMapPS
shader chunk, if no normal map is provided on the material:
export default /* glsl */`
#ifdef MAPTEXTURE
uniform sampler2D texture_normalMap;
uniform float material_bumpiness;
#endif
void getNormal() {
#ifdef MAPTEXTURE
vec3 normalMap = unpackNormal(texture2D(texture_normalMap, $UV, textureBias));
normalMap = mix(vec3(0.0, 0.0, 1.0), normalMap, material_bumpiness);
dNormalW = normalize(dTBN * addNormalDetail(normalMap));
#else
dNormalW = dVertexNormalW;
#endif
}
`;
2 Likes
What @Leonidas said. You can also find more chunk change details here .
2 Likes
yaustar
Split this topic
August 5, 2022, 8:32pm
5