Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Sprites in Direct3DX looked blurred - Transparent sprites lookin' bad.

This topic is 6921 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 trying to make a tiled game using D3DX and C++. Everything was going well until I got my voodoo 3 card working with it. OK, here''s what''s been giving me a migrane... I use color keying to display transparent sprites (I should use an alpha chanell, but I''m just trying to debug this first) Anyways, when I load a 32x32 sprite and display it in a 32x32 "square" on the screen, it looks blurred, almost as if it were enlarged or shrunk or something. You can understand what this does to my color values to certain transparent pixels. -_- But here''s the wierd thing... if I display the same 32x32 sprite at 31x31 or even 33x33, it comes out OK. o_O Of course this leaves little gaps between tiles. BTW: It''s not stretching the texture, if you tell it to put it in a 13x13 area, it puts down only a section of the texture... The surfacce itself hasn''t been altered. :/ I''ve read the documentation over and over, and I''m stuck. Could someone please give me some advice as how to correct this problem?

Share this post

Link to post
Share on other sites
I''m guessing that the blurring is caused because bilinear filtering is enabled. Try this:

lpD3DDevice->SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTFG_POINT);
lpD3DDevice->SetTextureStageState(0, D3DTSS_MINFILTER, D3DTFN_POINT );

This will set D3D to use regular point sampling, which should get rid of any blurring.


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!