From fabe42dc3abd5e4980941b824cc2a71295b45c36 Mon Sep 17 00:00:00 2001 From: Lynix Date: Thu, 13 Aug 2015 13:55:14 +0200 Subject: [PATCH] Renderer/Texture: Set up compare mode Former-commit-id: 6f85b6956530ea27b5bb96eb9b51a3ddc702f71b --- src/Nazara/Renderer/Texture.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Nazara/Renderer/Texture.cpp b/src/Nazara/Renderer/Texture.cpp index 303b983fa..2db286640 100644 --- a/src/Nazara/Renderer/Texture.cpp +++ b/src/Nazara/Renderer/Texture.cpp @@ -1269,6 +1269,12 @@ bool NzTexture::CreateTexture(bool proxy) glTexParameteri(target, GL_TEXTURE_SWIZZLE_A, openGLFormat.swizzle[3]); } + if (!proxy && NzPixelFormat::GetType(m_impl->format) == nzPixelFormatType_Depth) + { + glTexParameteri(target, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE); + glTexParameteri(target, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL); + } + return true; }