diff --git a/src/Nazara/Graphics/ColorBackground.cpp b/src/Nazara/Graphics/ColorBackground.cpp index fa2775e95..e7732f8d4 100644 --- a/src/Nazara/Graphics/ColorBackground.cpp +++ b/src/Nazara/Graphics/ColorBackground.cpp @@ -8,6 +8,17 @@ #include #include +namespace +{ + NzRenderStates BuildRenderStates() + { + NzRenderStates states; + states.parameters[nzRendererParameter_DepthBuffer] = false; + + return states; + } +} + NzColorBackground::NzColorBackground(const NzColor& color) : m_color(color) { @@ -25,7 +36,7 @@ void NzColorBackground::Draw(const NzScene* scene) const { NazaraUnused(scene); - static NzRenderStates states; + static NzRenderStates states(BuildRenderStates()); m_program->SendColor(m_program->GetUniformLocation(nzShaderUniform_MaterialDiffuse), m_color); diff --git a/src/Nazara/Graphics/SkyboxBackground.cpp b/src/Nazara/Graphics/SkyboxBackground.cpp index 75e15044f..20c2b8f05 100644 --- a/src/Nazara/Graphics/SkyboxBackground.cpp +++ b/src/Nazara/Graphics/SkyboxBackground.cpp @@ -116,6 +116,7 @@ namespace NzRenderStates BuildRenderStates() { NzRenderStates states; + states.parameters[nzRendererParameter_DepthBuffer] = false; states.parameters[nzRendererParameter_FaceCulling] = true; states.faceCulling = nzFaceCulling_Front; diff --git a/src/Nazara/Graphics/TextureBackground.cpp b/src/Nazara/Graphics/TextureBackground.cpp index 1bda23b5d..e452d16b2 100644 --- a/src/Nazara/Graphics/TextureBackground.cpp +++ b/src/Nazara/Graphics/TextureBackground.cpp @@ -8,6 +8,17 @@ #include #include +namespace +{ + NzRenderStates BuildRenderStates() + { + NzRenderStates states; + states.parameters[nzRendererParameter_DepthBuffer] = false; + + return states; + } +} + NzTextureBackground::NzTextureBackground() { NzShaderProgramManagerParams params; @@ -30,7 +41,7 @@ void NzTextureBackground::Draw(const NzScene* scene) const { NazaraUnused(scene); - static NzRenderStates states; + static NzRenderStates states(BuildRenderStates()); m_program->SendColor(m_program->GetUniformLocation(nzShaderUniform_MaterialDiffuse), NzColor::White); m_program->SendInteger(m_program->GetUniformLocation(nzShaderUniform_MaterialDiffuseMap), 0);