Hello!
I have had many problems with fbo’s in past, later which i found out they were driver bugs of certain brand cards. Once again, i got a similar problem but this time i am not sure if it is a driver bug.
Tested on 3 different cards, 2 of them are NVIDIA and it works perfectly. The last card is an ATI, which is the one i had also troubles in past.
I can’t just send the copy of my code/shaders since it would make things more complicated than it is. I’ll just paste the related parts.
Not Working:
fb->bind();
dd.set(rs_culling, true);
dd.set(rs_depth_test, true);
dd.clear(0, 0, 0, 0);
{
program_p& p = prg_basic;
p->use();
p->bind("mx_w", mx_identity);
p->bind("mx_vp", mx_view_proj);
p->bind("color", vec3(1, 1, 0));
cube->render();
p->unuse();
}
dd.set(rs_culling, false);
dd.set(rs_depth_test, false);
fb->unbind();
--copy into system fb
Uploaded with ImageShack.us
Working :
dd.set(rs_culling, true);
dd.set(rs_depth_test, true);
dd.clear(0, 0, 0, 0);
{
program_p& p = prg_basic;
p->use();
p->bind("mx_w", mx_identity);
p->bind("mx_vp", mx_view_proj);
p->bind("color", vec3(1, 1, 0));
cube->render();
p->unuse();
}
dd.set(rs_depth_test, false);
dd.set(rs_culling, false);
Uploaded with ImageShack.us
In the first one i am rendering a cube into a texture then just copy outputs to the main framebuffer, viewports are same.
For the later i am rendering the same cube using the same program in same viewport but using only main framebuffer.
As you see the trouble is, the outputs are different. I am guessing if it is not a bug, it is about some undefined behavior at the vertex clipping stage at the end of vertex program. I am not using any of the fixed program matrices. AFAIK framebuffers use global state for everything. Could try and post more detail but remember it happens only in 1 of 3 cards i could find.
Thanks for reading.
Edit: copy paste error in code