Jump to content
  • Advertisement
Sign in to follow this  
tokaplan

Screen-aligned quad: texture coordinates

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

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!