Skip to main content
GameDev.net gamedev.net
🔒 Locked 🎮 Unity

how do I fix full screen quad drift

Started by Pseudo Sep 23, 2004 at 7:56 PM 1 replies 950+ views
Original Post
Pseudo
Pseudo
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.
Pseudo
Pseudo
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.