Hello Guest

FBO problems

  • 2 Replies
FBO problems
« on: August 01, 2006, 10:41:07 »

I'm having problems with the Frame Buffer Object extension. All i want to do, is render screen to a texture and then put this on a grid that aligns to the screen so that i can then deform the texture coordinates and create water / wave effect.

But whatever I try, i get a EXTFramebufferObject.GL_FRAMEBUFFER_UNSUPPORTED_EXT when i check from Frame Buffer Object completeness.

Any help greatly appreciated

frameBuffer and texture are int fields in the encapsulating class, width and height are power of 2, (1024 both of them atm) and passed into the function

Code: [Select]

IntBuffer ib_fb = BufferUtils.createIntBuffer(1);
IntBuffer ib_tex = BufferUtils.createIntBuffer(1);
//  create objects
EXTFramebufferObject.glGenFramebuffersEXT(ib_fb);        // frame buffer
GL11.glGenTextures(ib_tex);              // texture
frameBuffer = ib_fb.get(0);
texture = ib_tex.get(0);

//  initialize texture
GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture);
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB8, width, height, 0, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, (IntBuffer)null);

GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0);
EXTFramebufferObject.glBindFramebufferEXT (EXTFramebufferObject.GL_FRAMEBUFFER_EXT, frameBuffer);
//     (set texture parameters here)
//     attach texture to framebuffer color buffer
EXTFramebufferObject.glFramebufferTexture2DEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT   , EXTFramebufferObject.GL_COLOR_ATTACHMENT0_EXT, GL11.GL_TEXTURE_2D, texture, 0);


where checkFrameBufferStatus does the following:

Code: [Select]

int status = EXTFramebufferObject.glCheckFramebufferStatusEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT);
switch(status) {
     Logger.error("FrameBuffer is complete!");
       Logger.error("Unsupported EXT");
       /* programming error; will fail on all hardware */

I run this on an integrated NV 6100 grafik chipset which has the extension, but the same problems comes up on a FX5200

Thank you in advance,

Philipp Aumayr
Rarebyte Game Development

FBO problems
« Reply #1 on: August 01, 2006, 12:36:42 »
We solved this over at #lwjgl, but i'll post here for completeness (punn unintended)

You haven't specified a GL_TEXTURE_MIN_FILTER or a GL_TEXTURE_MAG_FILTER on the texture, and nvidia seem to be picky about those...

Also, RGB8 might not be supported by the FBO...check for that too.


« Reply #2 on: August 01, 2006, 12:37:22 »
DarkProphet from #lwjgl brought up the solution: the MIN and MAG Filters need to be set on the texture. that's what was missing.

adding those min and mag filter setups after glTextImage2D did the trick..

also, changing the texture format from RGB8 to RGBA seemed to help a bit..

hope that helps if anyone else has probs..


Philipp Aumayr
Rarebyte Game Development