fix issue with Intel OpenGL 3.x driver under Ubuntu, render to texture cannot handle glDrawBuffer(GL_NONE)

This commit is contained in:
Erwin Coumans (Google)
2014-06-24 20:12:05 -07:00
parent 8f94ced88a
commit 4189a9a67f
3 changed files with 4 additions and 7 deletions

View File

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

View File

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

View File

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