I can render to a float texture with no problems with my GEForce 8800. On my GEForce 7300 an incomplete FBO attachment error occurs when I try to set up the FBO. The code below works with GL_RGBA8 as format but fails with GL_LUMINANCE32F and GL_R32F.
I looked at the texture_rg spec, but it appears this should work. Please tell me if I need to do anything differently before I report it as a bug to NVidia. Thanks:
Strict
SetGraphicsDriver(GLGraphicsDriver());
Graphics(880,600);
glewinit();
Const GL_R32F=$822E
Local framebuffer:Int
Local texture:Int
Local format:Int=GL_R32F
glGenFramebuffersExt(1,Varptr framebuffer);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT,framebuffer);
glGenTextures(1,Varptr texture);
glBindTexture(GL_TEXTURE_2D,texture);
glTexImage2D(GL_TEXTURE_2D,0,format,512,512,0,GL_RGB,GL_UNSIGNED_BYTE,Null );
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_TEXTURE_2D,texture,0);
Select glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)
Case GL_FRAMEBUFFER_COMPLETE_EXT
Notify("Everything is okay.");
Case GL_FRAMEBUFFER_UNSUPPORTED_EXT
Notify("FBO error: Configuration unsupported",1)
End;
Case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT
Notify("FBO error: Missing Attachment.",1);
End;
Case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT
Notify("FBO error: Incomplete format.",1);
End;
Case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT
Notify("FBO error: Incomplete draw buffer.",1);
End;
Case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT
Notify("FBO error: Incomplete FBO attachment.",1);
End;
Default
Notify("FBO error: "+glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)+"!",1);
End;
EndSelect
End;