fix: With Phong lighting limit object color by diffuse color

This commit is contained in:
Vsevolod Kremianskii 2021-02-17 18:10:51 +07:00
parent c84d04c936
commit 807f6d1985

View file

@ -623,6 +623,9 @@ void main() {
objectColor += (1.0 - shadow) * (diffuse + specular);
}
objectColor = min(objectColor, diffuseSample.rgb);
} else if (isFeatureEnabled(FEATURE_LIGHTMAP)) {
vec4 lightmapSample = texture(uLightmap, fragLightmapCoords);
float S = max(0.0, 1.0 - (shadow - dot(uAmbientColor.rgb, LUMINANCE)));