Jump to content
  • Advertisement
Sign in to follow this  
Pseudo

how do I fix full screen quad drift

This topic is 5416 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

If I have a 512x512 texture that I want to render a full screen quad into so that I can copy another 512x512 texture into it such that the pixels line up exactly, how do I fix the position/texture coords for this? currently I have (C#): TexturedQuadVertex[] quad = new TexturedQuadVertex[4]; quad[0].position = new Vector3(-1,1,0); quad[0].texcoord= new Vector2(0,0); quad[1].position = new Vector3(1,1,0); quad[1].texcoord= new Vector2(1,0); quad[2].position = new Vector3(1,-1,0); quad[2].texcoord= new Vector2(1,1); quad[3].position = new Vector3(-1,-1,0); quad[3].texcoord= new Vector2(0,1); where my positions are in projection space...but I get a drift to the bottom right when doing this in a feed back loop. I need the pixel to line up exactly.

Share this post


Link to post
Share on other sites
Advertisement
Thanks for the link.

I've read the doc that you linked, but I'm still unclear on how to do it in projection space. They offset the position half a pixel in screen space, but didn't say explicity how projection space is converted to screen space.

I assumed you could also offset the texture coordinates, but it looks like 0...1 does map the entire texture based on that document.

I was hoping this was a common thing to do and someone could just drop some code or explain it in a different way than that document.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!