We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › floating point textures
Page Index Toggle Pages: 1
floating point textures (Read 1501 times)
floating point textures
Dec 21st, 2006, 4:54am
 
I'm working on a program that does off-screen rendering to a texture using framebuffer objects. If the texture is a regular RGBA with 4 bits per channel, then the performance is ok. But as soon as I try any floating point texture format (GL_FLOAT_RGBA16_NV, GL_RGBA_FLOAT16_ATI, GL_RGBA16F_ARB, etc.) the performance goes down dramatically.

Has anyone tried to use floating point textures with success?

Thanks.
Re: floating point textures
Reply #1 - Dec 27th, 2006, 6:50pm
 
I found a way to solve this problem, and it is using a GLPbuffer for off-screen rendering. The pbuffer has to be properly configured to support floating point textures and 16 bits per channel. The following code is the pbuffer initialization:

Code:

int floatBits = 16;
int floatAlphaBits = 16;
int floatDepthBits = 1; // Workaround for apparent bug when not using render-to-texture-rectangle.

GLCapabilities caps = new GLCapabilities();
caps.setDoubleBuffered(false);
caps.setPbufferFloatingPointBuffers(true);
caps.setRedBits(floatBits);
caps.setGreenBits(floatBits);
caps.setBlueBits(floatBits);
caps.setAlphaBits(floatAlphaBits);
caps.setDepthBits(floatDepthBits);
pBuffer = GLDrawableFactory.getFactory().createGLPbuffer(caps, null, canvasWidth, canvasHeight, GLContext.getCurrent());
PainterEventListener listener = new PainterEventListener(painter);
pBuffer.addGLEventListener(listener);


In combination with the pbuffer, a GLEventListener is also needed to encapsulate the actual rendering calls. The complete example is available here:
http://shaders.computaciongrafica.com/

It's basically a particle system that runs (almost) entirely on the GPU. The gradient of the luminance is used to determine the motion of the particles.

Re: floating point textures
Reply #2 - Jan 3rd, 2007, 6:30pm
 
The location of the painter program changed, now it is:

http://shaders.computaciongrafica.com/painterly/painterTest2.applet/index.html

It also should have better compatibility with ATI cards.
Page Index Toggle Pages: 1