In a deferred project of mine Im trying to store the normals of the scene in a texture. Everything works alright with the classic RGBA texture but the precision is horrible. 8bits per normal coordinate is not enough.
I’ve tried to create a GL_RGBA_FLOAT32_ATI texture but the FBO wont attach it. What should I change in the following code to be able to write in higher precision textures?
Here is the code for the FBO:
[b]glGenFramebuffersEXT( 1, &fbo_id );
glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, fbo_id );
// create the texture
glGenTextures( 1, &norm_txtr_id );
glBindTexture( GL_TEXTURE_2D, norm_txtr_id );
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, window_width, window_height, 0, GL_RGBA, GL_FLOAT, NULL );
// attach the buffers to the FBO
glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, render_targets[RT_NORMAL].norm_txtr_id, 0 );[/b]
PS: Im using Ubuntu and I have, unfortunately, an ATI 4870