Jump to content
  • Advertisement
Sign in to follow this  
renderer

Floating point render target with PBOs

This topic is 4831 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!