Jump to content
  • Advertisement
Sign in to follow this  
RenderCache

Vertex positions in pixel shader

This topic is 4996 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
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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!