diff --git a/btgui/OpenGLWindow/GLInstancingRenderer.cpp b/btgui/OpenGLWindow/GLInstancingRenderer.cpp index f5f86e70f..d8789ff08 100644 --- a/btgui/OpenGLWindow/GLInstancingRenderer.cpp +++ b/btgui/OpenGLWindow/GLInstancingRenderer.cpp @@ -802,11 +802,6 @@ void GLInstancingRenderer::InitShaders() glLinkProgram(createShadowMapInstancingShader); glUseProgram(createShadowMapInstancingShader); createShadow_depthMVP = glGetUniformLocation(createShadowMapInstancingShader, "depthMVP"); - if (createShadow_depthMVP==0) - { - printf("Issue with createShadowMapInstancingFragmentShader (createShadow_depthMVP==0), disabling shadow maps\n"); - useShadowMap=false; - } glUseProgram(0); diff --git a/btgui/OpenGLWindow/GLRenderToTexture.cpp b/btgui/OpenGLWindow/GLRenderToTexture.cpp index 332967e5e..aee7e7b40 100644 --- a/btgui/OpenGLWindow/GLRenderToTexture.cpp +++ b/btgui/OpenGLWindow/GLRenderToTexture.cpp @@ -66,7 +66,9 @@ bool GLRenderToTexture::enable() } case RENDERTEXTURE_DEPTH: { - glDrawBuffer(GL_NONE); + GLenum drawBuffers[2] = {GL_DEPTH_ATTACHMENT,0}; + glDrawBuffers(1, drawBuffers); + //glDrawBuffer(GL_NONE); break; } default: diff --git a/btgui/OpenGLWindow/Shaders/createShadowMapInstancingPS.h b/btgui/OpenGLWindow/Shaders/createShadowMapInstancingPS.h index f94672a14..8b2dce8f1 100644 --- a/btgui/OpenGLWindow/Shaders/createShadowMapInstancingPS.h +++ b/btgui/OpenGLWindow/Shaders/createShadowMapInstancingPS.h @@ -5,6 +5,6 @@ static const char* createShadowMapInstancingFragmentShader= \ "layout(location = 0) out float fragmentdepth;\n" "void main(void)\n" "{\n" -" fragmentdepth = gl_FragCoord.z+0.0001*gl_FragCoord.x;\n" +" fragmentdepth = gl_FragCoord.z;\n" "}\n" ;