fixed ambient lighting in case of non-skybox lighting

This commit is contained in:
Dmitry Stepanov
2025-09-04 19:00:01 +03:00
parent 41bb154d82
commit 2b834d5b78
@@ -134,7 +134,7 @@
ivec2 cubeMapSize = textureSize(prefilteredSpecularMap, 0);
float mip = roughness * (floor(log2(float(cubeMapSize.x))) + 1.0);
vec3 reflection = textureLod(prefilteredSpecularMap, reflectionVector, mip).rgb;
vec3 reflection = properties.skyboxLighting ? textureLod(prefilteredSpecularMap, reflectionVector, mip).rgb : properties.ambientColor.rgb;
vec3 F0 = mix(vec3(0.04), albedo.rgb, metallic);
vec3 F = S_FresnelSchlickRoughness(clampedCosViewAngle, F0, roughness);