Fix world going black and white in certain locations on apple gpu (#2558)

meow-7.2.2
Rye 2025-01-09 20:02:54 -05:00
parent 97b1ab3455
commit 8d57388a9e
2 changed files with 2 additions and 2 deletions

View File

@ -150,7 +150,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec
float amb_da = 0.0;//ambiance;
if (da > 0)
{
lit = max(da * dist_atten,0.0);
lit = clamp(da * dist_atten, 0.0, 1.0);
col = lit * light_col * diffuse;
amb_da += (da*0.5+0.5) * ambiance;
}

View File

@ -140,7 +140,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe
float amb_da = ambiance;
if (da >= 0)
{
lit = max(da * dist_atten, 0.0);
lit = clamp(da * dist_atten, 0.0, 1.0);
col = lit * light_col * diffuse;
amb_da += (da*0.5 + 0.5) * ambiance;
}