A couple of fixes for rendering states

dev
Tomasz Kapuściński 2022-03-09 16:59:23 +01:00
parent 8c40b7c753
commit 1a7346b845
5 changed files with 9 additions and 4 deletions

View File

@ -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);

View File

@ -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

View File

@ -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()

View File

@ -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()

View File

@ -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());