Sign in to follow this  
Game_XinBing

My God, Inconceivable for construct pixel position?

Recommended Posts

I can speak little english please don't mind...... I read expert MJP's article about reconstruct pixel position. http://mynameismjp.wordpress.com/2009/03/10/reconstructing-position-from-depth/ Suddenly, i perhaps understand. but i'm not sure. because it's Inconceivable. What's i understand is: We only render a two triangle(a quad, four vertex? or six vertex?) fill over the WIN32 window instead of rendering the whole scene primitives. The four vertex coordinates is equal to four corners of Far Plane of the View Frustum. The four vertex texture coordinates is only four corners UV of Linear Depth's Render Target Texture. Then We let the GPU auto interpolate those data(position and texture coordinate) and generate each pixel. Then for each pixel, The input position of Pixel Shader is the Ray pointing to that pixel(or pointing to that point in view space). The input Texture coordinate of Pixel Shader is also correctly address Liear Depth Render Target Texture. We don't render the whole scene geometry. But only render two trinagles. And we give all computing to GPU auto interpolating...... What I thought is right? It's Inconceivable! If It's wrong, please don't mind because i very stupid...

Share this post


Link to post
Share on other sites
Each of those rays has it's length determined by the value retrieved from the depth texture.

The ray and tex-coords are interpolated, then the interpolated-tex-coords are used to fetch a depth value, which is multiplied with the interpolated-ray.

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