float textures and FBOs

Started by
2 comments, last by Dragon_Strike 17 years, 2 months ago
im workin with geoclipmaps and i need to render a float texture, modify it with a shader and than render it back to a texture ive implemented FBOs and it work fine with regular tetxures (RGBA8)... the GL_RGB_FLOAT32_ATI format doesnt seem to work with renderbuffers... how do i do this?
Advertisement
What hardware are you on?

And why not try GL_RGBA32F instead of the ATI extension.
i only need one color channel....

EDIT:: im using a geforce 7800

i need a fromat that is one channel and works with both FBOs and VTFs

this is what ive got

FBO
void CMESH::InitFBO(){		glActiveTexture(GL_TEXTURE5);	// Setup our FBO	glGenFramebuffersEXT(1, &fbo);	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);	// Create the render buffer for depth		glGenRenderbuffersEXT(1, &depthBuffer);	glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depthBuffer);	glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, m_iSize+1, m_iSize+1);	// Now setup a texture to render to	glGenTextures(1, &img);	glBindTexture(GL_TEXTURE_2D, img);		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F_ARB,  m_iSize+1, m_iSize+1, 0, GL_RGB, GL_FLOAT, NULL);		glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);		glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);		glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);		glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);	// And attach it to the FBO so we can render to it	glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, img, 0);	// Attach the depth render buffer to the FBO as it's depth attachment	glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depthBuffer);	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);	// Unbind the FBO for now	GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);}


VTF texture
void CMESH::ALPHA_BindFPTexture(float* Data, int size){	unsigned int iTempID;	glGenTextures(1, &iTempID);	glBindTexture(GL_TEXTURE_2D, iTempID);	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);	glTexImage2D( GL_TEXTURE_2D, 0, GL_LUMINANCE_FLOAT32_ATI, size, size, 0, GL_LUMINANCE, GL_FLOAT, Data );}


[Edited by - Dragon_Strike on January 29, 2007 4:09:37 AM]
well after second thought i think a 4 channel format would do also.. as long as it works for both FBO and VTF

EDIT::

GL_RGBA32F works for VTF but not FBO
GL_RGBA16F works for FBO but not VTF

[Edited by - Dragon_Strike on January 29, 2007 12:48:16 PM]

This topic is closed to new replies.

Advertisement