Sign in to follow this  

Vertex positions in pixel shader

This topic is 4833 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi there! suppose i drew a cube, with a vertex shader outputing the world vertex positions to a texcoord (so that the pixel shader can pick the interpolated values up). I noticed that the interpolated values are rather "distorted", as in if u move the camera(spherical) around. considering that they are just simple world coordinates, is there a way around this problem?? thk! RC

Share this post


Link to post
Share on other sites
ah ok!
erm... i realized what was wrong
i went to do a perspective divide (divide by w) in the vertexshader, removing it helps entirely now.

i was doing it for obtaining correct depth value[0,1] in HLSL,
think i kinda accidentally extended this operation to the final xy coords.

cheers!
RC

Share this post


Link to post
Share on other sites

This topic is 4833 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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