Sign in to follow this  

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

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

This topic is 2846 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.

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