![]() |
|
OpenGL: EXT_framebuffer_object |
Fred Alert
Member #7,066
March 2006
|
Hi, I'm trying to use the EXT_framebuffer_object extension to render a 1600x1600 OpenGL image to hard disk. But up to now, my code only saves black bitmaps.
edit: Of course that's pseudo code, Allegro and OpenGL are initiated correctly. |
GullRaDriel
Member #3,861
September 2003
![]() |
allegro_init(); I am just trying to help, not sure this will solve the problem, but both allegro and allegrogl must be initialized before any use of their functions "Code is like shit - it only smells if it is not yours" |
Kitty Cat
Member #2,815
October 2002
![]() |
glFramebufferTexture1DEXT -- |
Fred Alert
Member #7,066
March 2006
|
@Kitty Cat: My copiler can't find GL_DEPTH32_EXT... Unfortunately the array has to be that large. But I think that's not the problem - I tried to render a 100x100 texture this way, but the problem keeps to be the same. I built in glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT), and this delivers the error enum GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT. |
Kitty Cat
Member #2,815
October 2002
![]() |
GL_DEPTH I'd imagine is invalid, thus the render buffer is incomplete, which causes the framebuffer to be incomplete. Checking my info, it appears it's GL_DEPTH_COMPONENT??, where ?? is 16, 24, or 32. Pre-emptively, if you're going to want a stencil buffer, you'll need to create a packed depth-stencil renderbuffer instead, using GL_DEPTH_STENCIL_EXT or GL_DEPTH24_STENCIL8_EXT (I'd imagine both are the same), then bind that to both the depth and stencil framebuffer attachments. Last I tried, a stand-alone stencil buffer wouldn't work. As for the array, it'd be better to make it a dynamic array. Make char *image_buf; global, allocate it once at program start, then deallocate it before closing. -- |
Fred Alert
Member #7,066
March 2006
|
@Kitty Cat, thanks, that killed the error message! But the Problem still remains... |
Kitty Cat
Member #2,815
October 2002
![]() |
Does the code work if you draw to the screen (don't forget to flip for that)? EDIT: -- |
Ciro Duran
Member #3,011
December 2002
![]() |
KittyCat said:
EDIT: That would depend if Fred Alert has a card which supports non-power-of-two texture dimensions. The support should be automatic, according to that extension spec. Though I second KittyCat. Try render to the screen first. EDIT: I'm having right now the same problem as Fred Alert. Renders on screen of textures that have been updated through FBOs are appearing black. I'm tired tonight, so I'll continue debugging tomorrow Attachment contains a screenshot of my program showing all textures in black, with a test quad above them all. --- In the beginning, God said "light_source { <0, 0, 0> color White }" and light was created. |
Fred Alert
Member #7,066
March 2006
|
Rendering to screen works. What about allegro_gl_flip()? It surely has to be left out when rendering to texture! |
GullRaDriel
Member #3,861
September 2003
![]() |
Texture with dimension that are power of two values. "Code is like shit - it only smells if it is not yours" |
Milan Mimica
Member #3,877
September 2003
![]() |
Try with image sizes like 512, 1024, 2048... i think there is a limit though.
-- |
Fred Alert
Member #7,066
March 2006
|
|
Kitty Cat
Member #2,815
October 2002
![]() |
Did you remove glDrawBuffer(GL_FALSE); glReadBuffer(GL_FALSE); ? That might be causing problems. -- |
|