How can i get the world coordinates in a GLSL pixel shader by using the depth value?

Started by
10 comments, last by nullsquared 15 years, 10 months ago
Quote:Original post by bzroom
Just to make sure, both of your methods will work with both the actual geometry, and reconstruction during a deferred pass correct?

Yes. However they're both only really useful with deferred rendering, since with standard rendering you could just feed in the worldspace position over a varying (as was suggested to the OP above).

Quote:
As long as your input matrices and viewport dimensions are for the correct view. In deferred this would be the view used to produce the G Buffer, and for forward shading it would just be the current view.

Correct.
Advertisement
Quote:Original post by bzroomagi_shi, thanks also, ..but that was a tuff post to follow.


Sorry, I'm pretty bad at explanations [grin]. Go with the explanation you understand better for now, and play around with what I mentioned only if you're feeling adventurous [wink].

This topic is closed to new replies.

Advertisement