mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-31 01:04:30 +00:00
ref: gl: Goldsrc compatible fog implementation
This commit is contained in:
parent
e27ac6b092
commit
bb1b9dad23
@ -281,13 +281,22 @@ void TriFog( float flFogColor[3], float flStart, float flEnd, int bOn )
|
|||||||
RI.fogColor[0] = flFogColor[0] / 255.0f;
|
RI.fogColor[0] = flFogColor[0] / 255.0f;
|
||||||
RI.fogColor[1] = flFogColor[1] / 255.0f;
|
RI.fogColor[1] = flFogColor[1] / 255.0f;
|
||||||
RI.fogColor[2] = flFogColor[2] / 255.0f;
|
RI.fogColor[2] = flFogColor[2] / 255.0f;
|
||||||
RI.fogStart = flStart;
|
|
||||||
RI.fogColor[3] = 1.0f;
|
RI.fogColor[3] = 1.0f;
|
||||||
RI.fogDensity = 0.0f;
|
|
||||||
RI.fogSkybox = true;
|
RI.fogStart = flStart;
|
||||||
RI.fogEnd = flEnd;
|
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 );
|
pglFogfv( GL_FOG_COLOR, RI.fogColor );
|
||||||
pglFogf( GL_FOG_START, RI.fogStart );
|
pglFogf( GL_FOG_START, RI.fogStart );
|
||||||
pglFogf( GL_FOG_END, RI.fogEnd );
|
pglFogf( GL_FOG_END, RI.fogEnd );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user