Sign in to follow this  
gs2912

G-Buffer rendered texture missing values

Recommended Posts

gs2912    154

Hey there, I'm trying to use positions in view space written to texture from a G-Buffer. Unfortunetly there are some heavy problems:

Testing the view space positions by coloring the output when the position is greater than a given value results in the same pictures for every value lesser than 1.0. Beyond that, the G-Buffer renders correctly but the positions in the pass using the texture from the G-Buffer seem to not have any value.

 

Here are some picture - I hope they will make my problem better understandable:

[attachment=14168:No_Error.png]

[attachment=14169:Error.png]

 

Does anybody has had some similliar issues or has a clue, what it could be?

Share this post


Link to post
Share on other sites
painofangels    102

My guess is that you don't use floating-point textures to store the position in, so the value will be clamped to [0..1] for every component in the shader.

Try to define the texture-format in application-code with glTexImage2D( .., .., RGB_32F, .., .., .., .., GL_FLOAT, .. );

Share this post


Link to post
Share on other sites
gs2912    154

My guess is that you don't use floating-point textures to store the position in, so the value will be clamped to [0..1] for every component in the shader.

Try to define the texture-format in application-code with glTexImage2D( .., .., RGB_32F, .., .., .., .., GL_FLOAT, .. );

 

That's the trick ... I used GL_RGBA before instead of GL_RGBA32F. Thank you very much, that helped :)

Share this post


Link to post
Share on other sites
theagentd    990

Uh, shouldn't you be using GL_RGBA_16F instead of 32-bit floats? Should be faster and it's also supported by OGL 2 level hardware. Note that GL_RGB_16F uses the same amount of memory as GL_RGBA_16F due to padding.

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