PDA

View Full Version : Floating point textures and FBO



christl
05-06-2006, 06:20 PM
Hi!

I'm working on WinXP SP2, I have an ATI Radeon 9600 Pro with quite recent drivers. I'm currently trying to get floating point textures working as colorbuffer attachments to framebuffer object. The two extensions I'm using for this are ATI_texture_float and EXT_framebuffer_object. Everything else is OpenGL 1.5.

I'm creating the FP texture at 1024x1024, internal format GL_RGBA_FLOAT16_ATI, and thus, format GL_RGBA, only mip level 0, min and mag filter mode GL_NEAREST, and s and t wrap modes GL_CLAMP.

I have no GL errors anywhere in my whole app (checked this with GLIntercept). Creating the FP texture works, creating the FBO works, binding the FBO works. Attaching the FP texture to the color attachment point of the FBO works also. The FBO is definitely framebuffer-complete, so this is also not a problem.

Everthing seems OK, but as soon as I call glClear() after binding the FBO, the driver crashes. When I comment out that call, the crash happens just a few GL calls later. Simple calls like glEnable() seem to be harmless, only the more heavy ones like glTexImage2D() are those that can cause the crash. The crash does not happen at all when I disable usage of FP textures.

The HDR demo program from http://www.humus.ca/index.php?page=3D&ID=62 is proof enough for me that FP textures and FBOs can be used together on ATI cards, but it seems that a specific way of setting up the texture is required, that some things must not be done in order for it to work. For example, I found somewhere on the Web that FP textures used as render targets need to have GL_NEAREST filter modes set, but that's not documented anywhere.

I would be really grateful if anyone here could help me with this. Any small advices or suggestions are highly welcome.

sqrt[-1]
05-06-2006, 09:24 PM
Not sure if it is the problem, but do you really need texture borders? If not, use GL_CLAMP_TO_EDGE instead of GL_CLAMP.

zeoverlord
05-07-2006, 03:32 AM
try this simple FBO tutorial http://www.flashbang.se/index.php?id=19 .
It uses GL_RGBA16F_ARB (the same as GL_RGBA_FLOAT16_ATI), and it has the min filter set to linear, mag filter is not set but it doesn't matter because acording to the specs any filtering will do even mipmapping.

Humus
05-07-2006, 01:23 PM
Originally posted by christl:
For example, I found somewhere on the Web that FP textures used as render targets need to have GL_NEAREST filter modes set, but that's not documented anywhere.Filtering on FP textures isn't supported in hardware. It shouldn't make it crash, but it may very well be going into software.

Mars_999
05-07-2006, 05:54 PM
When will ATI have filtering support for FP textures? As of now Nvidia has them with FP16 but not FP32... Would be nice to have both...

christl
05-09-2006, 05:19 PM
Thanks all for the suggestions. I got it working in a small test program that shares only the most basic code with my engine (like window creation and GL extension loading), but it still does not work in the engine proper. Therefore I assume the bug is somewhere in my engine, but it has to be a very subtle bug. This looks like some serious debugging awaits me :-/