16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 09:59:18 +02:00

fog levels fix

This commit is contained in:
tmj-fstate
2017-03-24 01:58:06 +01:00
parent 68473259c0
commit df60a5230d
2 changed files with 11 additions and 13 deletions

View File

@@ -2361,12 +2361,22 @@ world_environment::render() {
GfxRenderer.Bind( 0 );
::glDisable( GL_LIGHTING );
::glDisable( GL_FOG );
::glDisable( GL_DEPTH_TEST );
::glDepthMask( GL_FALSE );
::glPushMatrix();
::glTranslatef( Global::pCameraPosition.x, Global::pCameraPosition.y, Global::pCameraPosition.z );
// setup fog
if( Global::fFogEnd > 0 ) {
// fog setup
::glFogi( GL_FOG_MODE, GL_LINEAR );
::glFogfv( GL_FOG_COLOR, Global::FogColor );
::glFogf( GL_FOG_START, Global::fFogStart );
::glFogf( GL_FOG_END, Global::fFogEnd );
::glEnable( GL_FOG );
}
else { ::glDisable( GL_FOG ); }
m_skydome.Render();
m_stars.render();
m_clouds.Render( m_skydome.GetAverageColor() * 2.5f );
@@ -2381,7 +2391,6 @@ world_environment::render() {
::glPopMatrix();
::glDepthMask( GL_TRUE );
::glEnable( GL_DEPTH_TEST );
::glEnable( GL_FOG );
::glEnable( GL_LIGHTING );
}

View File

@@ -91,17 +91,6 @@ opengl_renderer::Init( GLFWwindow *Window ) {
Global::DayLight.diffuse[ 1 ] = 242.0f / 255.0f;
Global::DayLight.diffuse[ 2 ] = 231.0f / 255.0f;
// setup fog
if( Global::fFogEnd > 0 ) {
// fog setup
::glFogi( GL_FOG_MODE, GL_LINEAR );
::glFogfv( GL_FOG_COLOR, Global::FogColor );
::glFogf( GL_FOG_START, Global::fFogStart );
::glFogf( GL_FOG_END, Global::fFogEnd );
::glEnable( GL_FOG );
}
else { ::glDisable( GL_FOG ); }
// create dynamic light pool
for( int idx = 0; idx < Global::DynamicLightCount; ++idx ) {