Skip to content

Commit 8d57388

Browse files
author
Rye
committed
Fix world going black and white in certain locations on apple gpu (#2558)
1 parent 97b1ab3 commit 8d57388

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec
150150
float amb_da = 0.0;//ambiance;
151151
if (da > 0)
152152
{
153-
lit = max(da * dist_atten,0.0);
153+
lit = clamp(da * dist_atten, 0.0, 1.0);
154154
col = lit * light_col * diffuse;
155155
amb_da += (da*0.5+0.5) * ambiance;
156156
}

indra/newview/app_settings/shaders/class3/deferred/materialF.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe
140140
float amb_da = ambiance;
141141
if (da >= 0)
142142
{
143-
lit = max(da * dist_atten, 0.0);
143+
lit = clamp(da * dist_atten, 0.0, 1.0);
144144
col = lit * light_col * diffuse;
145145
amb_da += (da*0.5 + 0.5) * ambiance;
146146
}

0 commit comments

Comments
 (0)