PDA

View Full Version : float textures and fbo's



supagu
01-28-2006, 10:37 PM
im having troubles finding resources on the net on how to set up and use float fbo's and float textures.

Can we use shaders with float fbo's? I've got shadow mapping working using a normal colour texture i write the depth too, but it isn't accurate enough, so want to use float fbo's and textures.

any good URL's? or info no how this is done?

so far i've got for my colour:


target = GL_TEXTURE_RECTANGLE_NV;
texture->target = target;

glEnable(target);
glBindTexture(target, texture->texture);

glTexImage2D(GL_TEXTURE_RECTANGLE_NV, 0, GL_FLOAT_RGB32_NV, width, height, 0, GL_RGB, GL_FLOAT, NULL);

glTexParameterf(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_RECTANGLE_NV, texture->texture, 0);

shelll
01-28-2006, 11:43 PM
there are examples in the spec, but using google will also help.

supagu
01-29-2006, 01:51 AM
http://oss.sgi.com/projects/ogl-sample/registry/EXT/framebuffer_object.txt
no examples of float colour texture there....

shelll
01-29-2006, 05:22 AM
look here: float texture (http://www.gpgpu.org/wiki/FAQ#OpenGL-Specific_Answer)