Skybox rendering bugfix (model matrix wasn't being set properly so the skybox was drawing with the old model matrix, which was the XYZ overlay one)

This commit is contained in:
parax0 2015-09-01 20:54:30 -04:00
parent 89c1654b6a
commit 2690e79f95

View File

@ -257,7 +257,6 @@ void CRenderer::RenderSky(CModel *pSkyboxModel, CCamera& Camera)
if (!pSkyboxModel) return; if (!pSkyboxModel) return;
glEnable(GL_CULL_FACE); glEnable(GL_CULL_FACE);
Camera.LoadRotationOnlyMatrices();
CGraphics::sMVPBlock.ModelMatrix = CMatrix4f::skIdentity; CGraphics::sMVPBlock.ModelMatrix = CMatrix4f::skIdentity;
CGraphics::sVertexBlock.COLOR0_Amb = CVector4f(1.f, 1.f, 1.f, 1.f); CGraphics::sVertexBlock.COLOR0_Amb = CVector4f(1.f, 1.f, 1.f, 1.f);
@ -266,6 +265,7 @@ void CRenderer::RenderSky(CModel *pSkyboxModel, CCamera& Camera)
CGraphics::UpdateVertexBlock(); CGraphics::UpdateVertexBlock();
CGraphics::UpdatePixelBlock(); CGraphics::UpdatePixelBlock();
CGraphics::UpdateLightBlock(); CGraphics::UpdateLightBlock();
Camera.LoadRotationOnlyMatrices();
glDepthRange(1.f, 1.f); glDepthRange(1.f, 1.f);
pSkyboxModel->Draw(mOptions, 0); pSkyboxModel->Draw(mOptions, 0);