Hi Guys,Trying to port an akready well running Sw from Fedora PC to the Mali400 on ST7108 chip, with GLES-2.0, I got a problem working with Framebuffer Objects.Everything is ok, debugging ok, framebuffer objects completes, no errors, but the screen remains completely dark.My environment on Mali/ST7108 is OK, other applications can run nicely.But I think to have not completely understood (or better: not understood at all) how to set display and surfaces while working woth FBOs (maybe the problem could be also found somewhere else)Basic setting is more or less as below, where I have put only the relevant setting and call for Display and Surfaces.In does seem that the eglSwapBuffers does't work at all while working with FBOs(even a monocolor screen cannot be seen...).In contrast, while working out of FBOs, everything seems to be ok.After binding with glBindFramebuffer(GL_FRAMEBUFFER,0), then everything is working and can be displayed.In contrast, after glBindFramebuffer(GL_FRAMEBUFFER, framebuffer), I cannot see anything after he eglSwapBuffers, even if the debug seems to be ok.
GenFramebuffers(1, &framebuffer);glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);glFramebufferTexture2D(GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT0,GL_TEXTURE_2D,texture,0);// render texture details to frame bufferglBindFramebuffer(GL_FRAMEBUFFER, 0)// render objects using textureeglSwapbuffers(display, surface)
The algorithm uses the FBOs to render-to-textures the intermediate results of the pipeline, in a multi-pass fashion, so that each step saves its output into a texture by an FBO and the next reads and processes it again. The code compiles and seems to run completely on the Mali, but there are then problems in viewing to the screen.
Stacy - I'm fairly new to OpenGL and have been trying to learn exactly this kind of overall usage model for when to use FBOs and how they can improve either graphics or memory performance (or both). My application will essentially be operating on textures - with a background texture surface filling the "window" and a number of smaller textures being "animated" on top of that - potentially with changes in alpha as well as of course position, rotation, size, etc. This functionality represents only a small portion of the OpenGL|ES functionality, and yet I still haven't found a good resource to learn from on how to optimize this kind of drawing.
The kinds of questions I have range from some basics such as how to account for the number of texture units when optimizing (i.e. is it better to use only one?), to understanding when the underlying memory transfers between application and GPU occur (in terms of APIs or other evolutions) and what the performance implications of these are, etc. I have also heard that some kinds of ops (e.g. DEPTH testing) will slow down texture processing, so I'd like to understand if there are things like this that I should stay away from - given more than one way to do what I need to do. Any general advice for a newbie trying to get up to speed on these sorts of topics?
Thanks very much.
Hi there. I'm having a similar issue.Like the original poster, I create the FBO, bind it to a texture, check the status to make sure it's framebuffer complete, then set it to the rendering buffer, call drawelements, and I get GL_INVALID_FRAMEBUFFER_OPERATION error. Bit of a mystery since I check the completeness status on the line immediately prior to the draw call.
Do the settings on the texture object matter, e.g. repeat/linear/reflect. Does Mali require me to specify a depth or stencil buffer? Does it require an alpha channel?
This code works on Tegra2 and Adreno 205. Not sure why Mali doesn't like it. I've also noticed that this graphics unit seems to have trouble with the first texture write to the display. I'll have to go into that in detail in another thread when I'm ready to deal with it.
Without knowing more about what you're trying to do or what hardware you're using it's hard to really answer this. It sounds like you might be using the texture in the scene with the FBO still bound, so it's trying to write to the framebuffer using content from the frame buffer. Is that what you're doing?It doesn't require a depth or stencil buffer but if you want to use depth or stencil features you'll need to have one bound.There are certain actions with frame buffers (such as binding an FBO to a texture and renderbuffer simultaneously, which it sounds like you might be doing) which have undefined or poorly defined behaviours in the spec. Depending on your GPU (or more specifically how strict the drivers are) some things will error, others will fail silently and simply have that texture appear messed up. I can't really give a more specific answer without details of what you're doing...-Stacy