Skip to content

Commit

Permalink
UPBGE: Don't enable fog.
Browse files Browse the repository at this point in the history
Fog isn't enabled because it affect the render of geometry without
shaders, but the fog attributes are still updated and accessible to
the user. This behaviour is present from a long time in BFBGE and
previous UPBGE.
  • Loading branch information
panzergame committed Sep 25, 2017
1 parent cb18610 commit 0a3eb94
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 14 deletions.
2 changes: 0 additions & 2 deletions source/gameengine/Ketsji/KX_WorldInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,9 @@ void KX_WorldInfo::UpdateWorldSettings(RAS_Rasterizer *rasty)
if (m_hasmist) {
rasty->SetFog(m_misttype, m_miststart, m_mistdistance, m_mistintensity, m_con_mistcolor);
GPU_mist_update_values(m_misttype, m_miststart, m_mistdistance, m_mistintensity, m_mistcolor.getValue());
rasty->EnableFog(true);
GPU_mist_update_enable(true);
}
else {
rasty->EnableFog(false);
GPU_mist_update_enable(false);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ static const int openGLEnableBitEnums[] = {
GL_BLEND, // RAS_BLEND
GL_COLOR_MATERIAL, // RAS_COLOR_MATERIAL
GL_CULL_FACE, // RAS_CULL_FACE
GL_FOG, // RAS_FOG
GL_LIGHTING, // RAS_LIGHTING
GL_MULTISAMPLE_ARB, // RAS_MULTISAMPLE
GL_POLYGON_STIPPLE, // RAS_POLYGON_STIPPLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ class RAS_OpenGLRasterizer
void SetScissor(int x, int y, int width, int height);

void SetFog(short type, float start, float dist, float intensity, const MT_Vector3& color);
void EnableFog(bool enable);
void DisplayFog();

void SetLines(bool enable);

Expand Down
7 changes: 0 additions & 7 deletions source/gameengine/Rasterizer/RAS_Rasterizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,6 @@ void RAS_Rasterizer::SetFog(short type, float start, float dist, float intensity
m_impl->SetFog(type, start, dist, intensity, color);
}

void RAS_Rasterizer::EnableFog(bool enable)
{
Enable(RAS_FOG);
}

void RAS_Rasterizer::Init()
{
GPU_state_init();
Expand Down Expand Up @@ -348,8 +343,6 @@ void RAS_Rasterizer::EndFrame()
SetColorMask(true, true, true, true);

Disable(RAS_MULTISAMPLE);

Disable(RAS_FOG);
}

void RAS_Rasterizer::SetDrawingMode(RAS_Rasterizer::DrawType drawingmode)
Expand Down
2 changes: 0 additions & 2 deletions source/gameengine/Rasterizer/RAS_Rasterizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ class RAS_Rasterizer
RAS_BLEND,
RAS_COLOR_MATERIAL,
RAS_CULL_FACE,
RAS_FOG,
RAS_LIGHTING,
RAS_MULTISAMPLE,
RAS_POLYGON_STIPPLE,
Expand Down Expand Up @@ -584,7 +583,6 @@ class RAS_Rasterizer
* Fog
*/
void SetFog(short type, float start, float dist, float intensity, const MT_Vector3& color);
void EnableFog(bool enable);

/**
* \param drawingmode = RAS_WIREFRAME, RAS_SOLID, RAS_SHADOW or RAS_TEXTURED.
Expand Down

0 comments on commit 0a3eb94

Please sign in to comment.