Resolution independant ortho quads have gaps between them

Started by
-1 comments, last by sirlemonhead 12 years, 5 months ago
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!

This topic is closed to new replies.

Advertisement