Hi!
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
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
Util.checkGLError();
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);
checkFrameBufferStatus();
where checkFrameBufferStatus does the following:
int status = EXTFramebufferObject.glCheckFramebufferStatusEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT);
switch(status) {
case EXTFramebufferObject.GL_FRAMEBUFFER_COMPLETE_EXT:
Logger.error("FrameBuffer is complete!");
break;
case EXTFramebufferObject.GL_FRAMEBUFFER_UNSUPPORTED_EXT:
Logger.error("Unsupported EXT");
break;
default:
/* programming error; will fail on all hardware */
assert(false);
}
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,
phil
Philipp Aumayr
Rarebyte Game Development
www.rarebyte.com