4
\$\begingroup\$

I have small problem with shadow maps preview. After binding shadow framebuffer I bind proper texture to store depth in it and then render the whole scene. When I read that values in shader to calculate shadows everything works as I expect on every tested computers. But when I want draw this textures on 2D quads I have it working only on AMD cards. On NVidia all I have is white empty fields. This happens only with cube maps and array texture.

Here is screen: Screenshot of the issue

Creating framebuffer:

if(!_s_buffer)glGenFramebuffers(1, &_s_buffer);
    glBindFramebuffer(GL_DRAW_FRAMEBUFFER, _s_buffer);

glFramebufferTexture(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, _depth.get(), 0); // set anything to framebuffer to avoid "framebuffer incomplete" error

glDrawBuffer(GL_NONE);
glReadBuffer(GL_NONE);

glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);

Could the problem be caused by using one framebuffer for cube map and array texture and switch between them in code (one time depth attachment is cube map - glFramebufferTexture2D with textarget set to proper cube map face - and another time it is array texture - glFramebufferTextureLayer).

Could you help me with this? I'm looking for a solution but without results. Maybe you met with this kind of problem. If more code is need I can post it.

\$\endgroup\$
  • 1
    \$\begingroup\$ Do you check for OpenGL errors/warnings using KHR_debug? If not, that would be the first step. It's possible you are doing something "wrong" according to GL, and AMD's drivers are okay with it but NV's aren't. \$\endgroup\$ – Nathan Reed Nov 23 '13 at 19:39
  • \$\begingroup\$ I didn't know about such extension, thanks for it. I checked it and I have a lot of glUniform errors on both AMD and NVidia cards (errors are the same, only description is more precise on AMD). Here is one of them: glUniformMatrix3fv* parameter <location> has specified an invalid value '5': not the location of an active uniform in the default uniform block. I read info about this uniform using glGetActiveUniform and it shows: mat3 NormalMatrix 5, where the last number is location. For me, it looks ok, I have no idea what can I do with this errors. \$\endgroup\$ – Harry Nov 28 '13 at 19:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.