PDA

View Full Version : FrameBufferObject Texture into gl.glTexImage2D ?



DerTherion
01-20-2009, 12:59 AM
hello,

i try to work with cubemapping and got an
simple problem:

i have an FrameBufferObject Texture and want
to put it into gl.glTexImage2D to make it
useable for the cubmapping effect

//this is my fbo
gl.glBindTexture(GL.GL_TEXTURE_2D, fbo_texture.get(0))

...

//and here i need the fbo ( i need only the Positive_X with FBO)
...
gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL.GL_RGBA,
imageSize, imageSize, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE,
imageBuf1);
gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL.GL_RGBA,
imageSize, imageSize, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE,
imageBuf4);
gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL.GL_RGBA,
imageSize, imageSize, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE,
imageBuf2);
...
...
...


how can i do this?

wedge
01-20-2009, 03:36 AM
IMO By creating the Color Atachement I think you must use sth. like that:

glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENTx_EXT, TEXTURE_CUBE_MAP_POSITIVE_X, fbo_texture.get(0), 0);