PDA

View Full Version : FBO and single channel float texture with HW blending



shelll
01-06-2006, 05:08 AM
i know that single channel textures are not part of FBO spec and they will be in future extension, but they work. my question is, is there any single channel internal format with HW accelerated floating point blening? now, i am using GL_RGB16F_ARB internal format, which runs fine, but it is waste if memory for me.

i tried alpha, intensity an luminance 16-32 bit formats, but with poor performance :(

i have gf 6600gt, 81.85 driver

jra101
01-06-2006, 09:08 AM
The only single channel texture formats currently supported on GeForce 6/7 GPUs are the NV_float_buffer texture formats, which do not support blending.

The ARB_texture_float single channel formats won't be supported until the ARB adds FBO support for 1/2 component texture formats.

shelll
01-06-2006, 10:10 AM
don't anybody know, when it will be?

shelll
01-07-2006, 12:36 PM
i implemented even 32bit floating point blending with single channel texture :) it is functional and runs at near the same speed as 16bit. but it is not recommended method, because i am reading and writing from-to same texture, which according to spec has undefined behavior, but it runs fine on my gf 6600gt.

Jedimaster
01-10-2006, 10:27 PM
How to ?

Could Shell paste some code to here ?

shelll
01-11-2006, 05:21 AM
it is simple. just create your texture, attach it to FBO as color attachment. then, when you render, you bind that same texture to any texture unit and in shader, you just lookup the value form the texture with screen coords (gl_FragCoord.xy), do any calculations with it and just output the color.

as the texture you read from, is also the one, you write to (through FBO), you achieve your own blending equation ;)

results are undefined because, you read/write from/to the same texture and multiple pixels are processed in parallel. but when you don't rely on any neighbouring texels, it should, on 99%, run ok :)