A couple of fixes for rendering states
parent
8c40b7c753
commit
1a7346b845
|
@ -21,6 +21,7 @@
|
|||
#include "graphics/engine/cloud.h"
|
||||
|
||||
#include "graphics/core/device.h"
|
||||
#include "graphics/core/material.h"
|
||||
#include "graphics/core/renderers.h"
|
||||
#include "graphics/core/transparency.h"
|
||||
|
||||
|
@ -123,9 +124,7 @@ void CCloud::Draw()
|
|||
|
||||
auto texture = m_engine->LoadTexture(m_fileName);
|
||||
renderer->SetAlbedoTexture(texture);
|
||||
renderer->SetDetailTexture(Texture{});
|
||||
|
||||
renderer->SetLighting(false);
|
||||
renderer->SetTransparency(TransparencyMode::BLACK);
|
||||
renderer->SetDepthMask(false);
|
||||
|
||||
|
|
|
@ -3598,10 +3598,10 @@ void CEngine::DrawInterface()
|
|||
particleRenderer->End();
|
||||
|
||||
m_device->SetDepthTest(false);
|
||||
|
||||
SetInterfaceCoordinates();
|
||||
}
|
||||
|
||||
SetInterfaceCoordinates();
|
||||
|
||||
// Draw foreground color
|
||||
if (m_overFront)
|
||||
DrawOverColor();
|
||||
|
@ -4257,6 +4257,7 @@ void CEngine::DrawPlanet()
|
|||
renderer->SetLighting(false);
|
||||
renderer->SetDepthTest(false);
|
||||
renderer->SetDepthMask(false);
|
||||
renderer->SetCullFace(CullFace::NONE);
|
||||
|
||||
m_planet->Draw(); // draws the planets
|
||||
|
||||
|
|
|
@ -270,6 +270,8 @@ void CGL33Device::BeginScene()
|
|||
m_depthMask = true;
|
||||
|
||||
glFrontFace(GL_CW); // Colobot issue: faces are reversed
|
||||
m_cullFace = CullFace::NONE;
|
||||
glDisable(GL_CULL_FACE);
|
||||
}
|
||||
|
||||
void CGL33Device::EndScene()
|
||||
|
|
|
@ -205,6 +205,8 @@ void CGL33ObjectRenderer::CGL33ObjectRenderer::Begin()
|
|||
m_device->SetCullFace(CullFace::BACK);
|
||||
|
||||
SetUVTransform({ 0.0f, 0.0f }, { 1.0f, 1.0f });
|
||||
SetAlphaScissor(0.0f);
|
||||
SetFog(1e+6f, 1e+6, {});
|
||||
}
|
||||
|
||||
void CGL33ObjectRenderer::CGL33ObjectRenderer::End()
|
||||
|
|
|
@ -248,6 +248,7 @@ bool CGL33UIRenderer::EndPrimitive()
|
|||
UpdateUniforms();
|
||||
|
||||
m_device->SetDepthTest(false);
|
||||
m_device->SetCullFace(CullFace::NONE);
|
||||
|
||||
if (m_drawCount == 1)
|
||||
glDrawArrays(TranslateGfxPrimitive(m_type), m_first.front(), m_count.front());
|
||||
|
|
Loading…
Reference in New Issue