@@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2222
2323/* lightMapping_fp.glsl */
2424
25+ #insert common
2526#insert computeLight_fp
2627#insert reliefMapping_fp
2728
@@ -34,6 +35,8 @@ uniform sampler2D u_GlowMap;
3435uniform float u_AlphaThreshold;
3536uniform vec3 u_ViewOrigin;
3637
38+ uniform uint u_ColorModulateColorGen;
39+
3740IN(smooth ) vec3 var_Position;
3841IN(smooth ) vec2 var_TexCoords;
3942IN(smooth ) vec4 var_Color;
@@ -140,19 +143,20 @@ void main()
140143 vec4 texel = texture3D (u_LightGrid2, lightGridPos);
141144 vec3 lightDir = normalize (texel.xyz - (128.0 / 255.0 ));
142145 #endif
143-
146+
147+ float lightFactor = ColorModulateToLightFactor( u_ColorModulateColorGen );
144148 #if defined(USE_LIGHT_MAPPING)
145149 // Compute light color from world space lightmap.
146150 // When doing vertex lighting with full-range overbright, this reads out
147151 // 1<<overbrightBits and serves for the overbright shift for vertex colors.
148152 vec3 lightColor = texture2D (u_LightMap, var_TexLight).rgb;
149- lightColor *= u_LightFactor ;
153+ lightColor *= lightFactor ;
150154
151155 color.rgb = vec3 (0.0 );
152156 #else
153157 // Compute light color from lightgrid.
154158 vec3 ambientColor, lightColor;
155- ReadLightGrid(texture3D (u_LightGrid1, lightGridPos), ambientColor, lightColor);
159+ ReadLightGrid(texture3D (u_LightGrid1, lightGridPos), lightFactor, ambientColor, lightColor);
156160
157161 color.rgb = ambientColor * r_AmbientScale * diffuse.rgb;
158162 #endif
0 commit comments