Sign in to follow this  
CuppoJava

Writing values greater than 1 to a FBO

Recommended Posts

Hi, I'm hoping someone who has some experience with FBO's can help me with this. I would appreciate the help. Currently, I'm using a FBO to store (x,y,z) position data as a color which I later use in a raycasting shader. This is all working very well so far, except I've just recently hit the need to store positions that are greater than 1. It seems like gl_FragColor is truncating my values to be positive and below 1 at all times. (This makes sense, because r,g,b values should never be outside that range). But this means that I have no way of recording positions past that range either. Is there some FBO configuration or command other than gl_FragColor that will let me store arbitrary numbers into a texture which I can read in later? Thanks a lot -Patrick

Share this post


Link to post
Share on other sites
Yes, you can store values greater than 1. Just use texture or renderbuffer with float internal format, for example GL_RGBA32F (4 component float).

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