Skip to content

Commit a3d3101

Browse files
committed
tr_image: store the fog alpha channel in red one
1 parent e238f23 commit a3d3101

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/engine/renderer/glsl_source/fogGlobal_fp.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void main()
4949
st.s = distance(u_ViewOrigin, P.xyz) * u_FogDensity;
5050
st.t = 1.0;
5151

52-
vec4 color = texture2D(u_ColorMap, st);
52+
vec4 color = vec4( vec3( 1.0 ), texture2D( u_ColorMap, st ).r );
5353

5454
outputColor = UnpackColor( u_Color ) * color;
5555
}

src/engine/renderer/glsl_source/fogQuake3_fp.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void main()
3535
{
3636
#insert material_fp
3737

38-
vec4 color = texture2D(u_FogMap, var_TexCoords);
38+
vec4 color = vec4( vec3( 1.0 ), texture2D( u_FogMap, var_TexCoords ).r );
3939

4040
color *= var_Color;
4141

src/engine/renderer/tr_image.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2418,8 +2418,8 @@ static void R_CreateFogImage()
24182418
{
24192419
float d = R_FogFactor( ( x + 0.5f ) / FOG_S, ( y + 0.5f ) / FOG_T );
24202420

2421-
ptr[ 0 ] = ptr[ 1 ] = ptr[ 2 ] = 255;
2422-
ptr[ 3 ] = 255 * d;
2421+
ptr[ 0 ] = 255 * d;
2422+
ptr[ 1 ] = ptr[ 2 ] = ptr[ 3 ] = 255;
24232423
ptr += channels;
24242424
}
24252425
}

0 commit comments

Comments
 (0)