G-Buffer rendered texture missing values

Started by
2 comments, last by theagentd 11 years, 1 month ago

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?

Advertisement

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, .. );

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 :)

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.

This topic is closed to new replies.

Advertisement