Jump to content
  • Advertisement
Sign in to follow this  

Mapping Texels to Pixels and Vertex Shaders

This topic is 4258 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! I'm doing some post processing by rendering fullscreen quads and I have been reading the "Directly Mapping Texels to Pixels" section in docs so now I define the quad vertices using D3DFVF_XYZRHW and subtract 0.5 from the screen space positions. All this works as expected but D3DFVF_XYZRHW vertices disables the vertex shader. Is there any way to avoid this? or can I instead use regular D3DFVF_XYZ vertices that are adjusted in the VS in a robust way so screen space positions end up correctly?

Share this post


Link to post
Share on other sites
Advertisement
I use to use the flag D3DFVF_XYZW|D3DFVF_TEX0
In xyzw I put the position in projection space and in tex0 I put the screen coordinate shifted HalfTextel, that way the shader only need to do a minimum of computation, just send the data thru.

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!