Sign in to follow this  
renderer

Floating point render target with PBOs

Recommended Posts

I want to do some calculations in a fragment program and have their output be vertex data (in a VBO). I'm using the pixel buffer object extention to copy the RGBA data from my framebuffer into the vertex buffer object. The one part I don't know is how to set up the framebuffer to be floating point. I don't want my vertex coordinates clamped to [0,1]. Any help is appreciated.

Share this post


Link to post
Share on other sites
Bah, you don't need to do anything special to your FBO buddy, the only requirement is to have all your color attachments of the same format, float in your case.


GLuint id;

glGenTextures(1, &id);
glBindTexture(GL_TEXTURE_2D, id);

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB32F_ARB, width, height, 0, GL_RGB, GL_FLOAT, NULL);



:)

Share this post


Link to post
Share on other sites
This is why I'm a little confused...why do I need a texture? I'm not doing render to texture.

When I've turned on GL_PIXEL_PACK_BUFFER_EXT, where do pixels go when they are rendered, before I copy them into my VBO?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this