2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-19 08:29:44 +01:00

ref: gl: Goldsrc compatible fog implementation

This commit is contained in:
Velaron 2023-05-20 20:22:09 +03:00 committed by Alibek Omarov
parent e27ac6b092
commit bb1b9dad23

View File

@ -281,13 +281,22 @@ void TriFog( float flFogColor[3], float flStart, float flEnd, int bOn )
RI.fogColor[0] = flFogColor[0] / 255.0f;
RI.fogColor[1] = flFogColor[1] / 255.0f;
RI.fogColor[2] = flFogColor[2] / 255.0f;
RI.fogStart = flStart;
RI.fogColor[3] = 1.0f;
RI.fogDensity = 0.0f;
RI.fogSkybox = true;
RI.fogStart = flStart;
RI.fogEnd = flEnd;
pglFogi( GL_FOG_MODE, GL_LINEAR );
if( RI.fogDensity > 0.0f )
{
pglFogi( GL_FOG_MODE, GL_EXP2 );
pglFogf( GL_FOG_DENSITY, RI.fogDensity );
}
else
{
pglFogi( GL_FOG_MODE, GL_LINEAR );
RI.fogSkybox = true;
}
pglFogfv( GL_FOG_COLOR, RI.fogColor );
pglFogf( GL_FOG_START, RI.fogStart );
pglFogf( GL_FOG_END, RI.fogEnd );