• Advertisement
Sign in to follow this  

Vertex positions in pixel shader

This topic is 4904 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
Advertisement
what degree of precision are you using? are you using 16 bit or 24 bits?
May be this error in interpolation is due to truncation error?

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
Sign in to follow this  

  • Advertisement