This time I’m playing with the framebuffer object extension, trying to render to an off-screen floating point buffer…everything seems to be working fine with my nVidia card (GF7800), but if I run the same application on my ATI-based PC (9700Pro), then the framerate drops drastically to less than 1 frame per second.
After a bit of trial and error I found quite some interesting facts:
The best internal format to be used for floating point targets is GL_RGB_FLOATxx_ATI (16 or 32 bits), as the “standard” GL_RGBxxF_ARB is not supported by ATI until the X800 series and above…so it is no so standard
My GeF7800 does not support 32bits floating point framebuffers if the render target is a texture; it only works if its a render buffer (glCheckFrameBufferStatus fails)
My GeF7800 does not support 16 bit depth buffers (glCheckFrameBufferStatus fails)
The ATI problem dissapears if I use a plain 8bit color RGB framebuffer.
Besides that, I’ve traced my application and found that the problem is caused only if I perform a glClear(GL_DEPTH_BUFFER_BIT) once the floating point buffer is bound and fully working (the glCheckFrameBufferStatusEXT says so at least).
If I do not clear the depth buffer, the applications runs smoothly on both ATI and nVidia, but if just uncommet that damn line, then I start getting 1FPS or less on ATI…oh! and listen to this: the more bits the depth buffer has, the worse it runs…I mean, if i attach a 16bits depth buffer, then it runs at, lets say 1FPS, but if I attach a 24bit one, then it runs at 0.5FPS…
With the nVidia configuration, it always works (as long as I use 16bit FP color render targets and 24bit depth targets).
Anyone knows what the hell is going on? I’m kinda lost now. Could it be a problem with the ATI drivers? I have googled the problem, but didnt find anything about this…
I’d appreciate some comments on this.
Thanks in advance,
>>2) My GeF7800 does not support 32bits floating point framebuffers if the render target is a texture; it only works if its a render buffer (glCheckFrameBufferStatus fails)<<
Not tried, but GL_NEAREST filtering comes to mind. FP32 doesn’t support linear filters on GeForce.
Thanks Relic, but I have also tried what you said. Linear & nearest filtering, 16FP color buffer, 16bit depth, everything is supposed to be working…but it doesn’t.
The key point is the glClear(GL_DEPTH_BIT), it KILLS performance on my ATI, but I don’t know why
I’m doing something wrong, as I donwloaded a demo from humus’ website tha does the same I’m trying to do and it works perfectly.
I’ve analized the code searching the differences, but it “seems” to be just like mine…
I’ll keep investigating…
I’ve finally found the problem. It is absolutely crazy, but the fact is that on my Radeon 9700Pro, having the alpha blending enabled while calling glClear(GL_DEPTH_BUFFER_BIT) completly ruined the GPU performance.
Don’t ask me why, but after I went out of “logic” ideas, and finding out dome demos doing the same flawlessly, I started to think It had something to do with a “wrong” GL state…
So I decided to clear all states to “default”, and after a little trial and error, I isolated the problem
Just wanted you to know
Thaks for your kind support,
- The best internal format to be used for floating point targets is GL_RGB_FLOATxx_ATI (16 or 32 bits), as the “standard” GL_RGBxxF_ARB is not supported by ATI until the X800 series and above…so it is no so standard
#define GL_RGBA_FLOAT32_ATI 0x8814
#define GL_RGB_FLOAT32_ATI 0x8815
#define GL_RGBA_FLOAT16_ATI 0x881A
#define GL_RGB_FLOAT16_ATI 0x881B
#define GL_RGBA32F_ARB 0x8814
#define GL_RGB32F_ARB 0x8815
#define GL_RGBA16F_ARB 0x881A
#define GL_RGB16F_ARB 0x881B
Look’s supported to me
Keep in mind, that ATI R9xxx doesn’t support floating point blending. And you’ll get something about 1/35 FPS if you try
LINEAR texture filtering won’t be a problem(you will simply get result like setting nearest filtering on cards up to Radeon X1xxx)
And do not use GL_HALF_FLOAT_ARB as type on ATI
use GL_FLOAT instead.