Sign in to follow this  
sofakng

Can I draw textures side-by-side and have them antialiased?

Recommended Posts

I'm using a DirectX v9.0 wrapper for Delphi called Asphyre v4.0 and I'm trying to draw a 2D terrain like Worms or Scorched Earth. What I'm doing is drawing a curved line (using a cubic algorithm and a Bezier algorithm) and as I draw the line I'm drawing textured quads. What I end up with is a LOT of textured quads each being about 1 pixel wide (but they are floating-point values so each quad might be smaller than 1 pixel, I think). The problem I'm having is that the edges of the textures are very jagged looking. I know the textures are being antialiased because if I draw a single textured quad the edges are nice and antialiased, but I'm guessing that because I'm drawing a ton of them next to each other it looks jagged. Can I do something else to solved this problem?

Share this post


Link to post
Share on other sites
Somebody else can comment on your technique, but you might want to try disabling mipmap (levels = 1) when you load your textures. Then you can see if this is influencing your image quality, since D3D is definitely going to use a mipmap by default for rendering a very small texture. In a 3D environment, the pixels you're rendering are likely to be in the distance and/or otherwise unimportant. I've had problems with 2D image quality because of D3D choosing an ugly mipmap instead of using my texture for things like fonts, icons, etc. when scaled down.

Other than that, you could check the filtering states to see which one looks best for your purposes. D3DTSS_MAGFILTER, D3DTSS_MINFILTER, etc.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this