attempt to not apply normal mapping on clouds

This commit is contained in:
Eikthyrnir 2024-01-14 21:14:38 +01:00
parent e4d425a915
commit 49865aa158

View File

@ -64,15 +64,15 @@ void main()
vec3 cloudColor = texture2D(clouds, vertexTexCoordOut).rgb; vec3 cloudColor = texture2D(clouds, vertexTexCoordOut).rgb;
//disabled to prevent riffled clouds //disabled to prevent riffled clouds
//textureColor = mix(vec3(1), textureColor, cloudColor.r); textureColor = mix(vec3(1), textureColor, cloudColor.r);
//get normal from normal sampler normalizedVertexNormal = vec3(0, 0, 1);
vec3 samplerNormal = texture2D(normalSampler, vertexTexCoordOut).xyz; if (cloudColor.r < 1) {
samplerNormal = 2 * samplerNormal - 1;//since sampler has values from [0, 1], but we want [-1, 1] //get normal from normal sampler
normalizedVertexNormal = normalize(samplerNormal);// to avoid potential precision problems in sampler texture vec3 samplerNormal = texture2D(normalSampler, vertexTexCoordOut).xyz;
samplerNormal = 2 * samplerNormal - 1;//since sampler has values from [0, 1], but we want [-1, 1]
//Debug normalizedVertexNormal = normalize(samplerNormal);// to avoid potential precision problems in sampler texture
//normalizedVertexNormal = vec3(0, 0, 1); }
outColor = calcPointLight(textureColor, sunPos, sunLightDirTS, sunColor, sunLightExp); outColor = calcPointLight(textureColor, sunPos, sunLightDirTS, sunColor, sunLightExp);