Jump to content
  • Advertisement
Sign in to follow this  
sirlemonhead

Resolution independant ortho quads have gaps between them

This topic is 2479 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've got Orthographic projection set up in D3D9 with shaders and also using some code to convert from pixel values (ie 0-1024) to device coordinates (-1.0 to 1.0), taking the current resolution into consideration.

Basically, I have a virtual resolution on my game menu of 640x480, and even if the actual D3D device is drawing to a 1280x1024 backbuffer, my code will position and scale all my menu elements correctly.

Unfortunately, there's one case where I have to draw 3 quads together, all lined up touching each other, to basically create a single seamless image comprised of 3 different textures. If my D3D resolution is set to the same as my virtual resolution (640x480), these draw perfectly. If my resolution is say, 1280x1024, there are either pixel wide gaps or overlaps where I'm guessing floating point imprecision is coming into play and D3D isn't positioning things quite correctly.

Is there any way around this? Would using an old style RHW vertex format (with shaders) still have the same issue?

What I have is great for positioning individual items such as menu graphics or text characters, as none of them have to be flush up against another texture, so any imprecision would never be noticed.

Appreciate any help I can get, thanks!

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!