Fixed depth sorting for HUD elements.

This commit is contained in:
Tleety
2016-02-11 15:27:07 +01:00
parent 9f657ada4e
commit 6ba1e95da7
6 changed files with 18 additions and 32 deletions
+5 -1
View File
@@ -623,9 +623,13 @@ void DrawFinalPass::DrawSprites(std::list<std::shared_ptr<RenderJob>>&jobs, Rend
for(auto& job : jobs) {
auto spriteJob = std::dynamic_pointer_cast<SpriteJob>(job);
RenderState jobState;
if (spriteJob) {
if(spriteJob->Depth == 0)
{
jobState.Disable(GL_DEPTH_TEST);
}
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(spriteJob->Matrix));
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));