Jump to content
  • Advertisement
Sign in to follow this  
blairhartley

[DX9, C++] Smooth scaling 2D sprites

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

I'm in the process of reducing my engine's reliance on ID3DXSprite by implementing my own 2D-quad-based class. At each stage I'm comparing the equivalent result I get using the ID3DXSprite method with the new one, and it's here I'm seeing a reduced quality scaling compared to ID3DXSprite. The scaled ID3DXSprite sprites appear smoothed. My equivalent scaled quads don't. I appreciate there are 1001 render settings, but for this simple thing - to match the basic quality ID3DXSprite gives you when scaling a texture - is there an obvious setting for rendering my quads? Many thanks in advance, Tim

Share this post


Link to post
Share on other sites
Advertisement
You could use PIX to see what your code and ID3DXSprite are doing differently by running both methods through PIX and comparing the D3D call logs (PIX is a utility that comes with the DX SDK).

Share this post


Link to post
Share on other sites
If you look here it shows you all of the render, texture, and sampler states set when you call ID3DXSprite::Begin. What you're interested are the MINFILTER, MAGFILTER, and MIPFILTER sampler states.

Share this post


Link to post
Share on other sites
Quote:
Original post by MJP
If you look here it shows you all of the render, texture, and sampler states set when you call ID3DXSprite::Begin. What you're interested are the MINFILTER, MAGFILTER, and MIPFILTER sampler states.


Thankyou - that's also useful... I am now setting those filter values and the scaling blending is now identical.

I'm now struggling trying to match the texture and display coordinates so they are exactly the same regardless of scale or rotation... seems I'm doing something slightly different to ID3DXSprite as I can match everything pixel for pixel in one orientation, but not in another.

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.

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!