Screen-aligned quad: texture coordinates

Started by
3 comments, last by Sc4Freak 17 years ago
Hi everyone, I'm trying to set up a billboard which covers the whole screen. I keep getting artifacts near the edges, so I guess I'm not setting texture coordinates right. Can I just set the coordinates to (0, 0), (0, 1), (1, 0) and (1, 1)? I think I read somewhere that these values should be offset by half a pixel (-0.5*1/viewPort.Dimension) to get a proper result. Or should I set some specific wrapping options through SetSamplerState? Thank you
Advertisement
It's all right. I have the same result when rendering fullscreen quad.
I solved this problem with this example: 'EffectEdit' sample in DXSDK9.0.
Thanks a lot
EDIT: deleted post, realized what he was asking...lol
STUMP - http://scyanidegaming.com
Quote:Original post by tokaplan
Hi everyone,

I'm trying to set up a billboard which covers the whole screen. I keep getting artifacts near the edges, so I guess I'm not setting texture coordinates right. Can I just set the coordinates to (0, 0), (0, 1), (1, 0) and (1, 1)? I think I read somewhere that these values should be offset by half a pixel (-0.5*1/viewPort.Dimension) to get a proper result. Or should I set some specific wrapping options through SetSamplerState?

Thank you


No, the texture co-ordinates should be fine. You need to offset the position of your quad, not the texture, by -0.5 pixels.
NextWar: The Quest for Earth available now for Windows Phone 7.

This topic is closed to new replies.

Advertisement