Newbie Direct3D 8.0 question. Expanded textures are pixelating.

Started by
1 comment, last by Landon_Fox 18 years, 1 month ago
Hello. I'm making the transition from DirectDraw to Direct3d. I'm still learning so my knowledge is somewhat limited. I am using Direct3d 8.0 on SDK version 8.0. My game is going to be 2d, so I'm using pre-transformed vertices, the kind where you put in rhw with x, y, and z. I'm running into a problem when I try to draw a small texture onto a large area. Instead of anti-aliasing the image, it's just pixelating it! This does not please me. I know there must be a way to anti-alias the image because most of my commercial games do so. I've done some googling and article reading here on gamedev. The problem is that most of these articles involve math. I'm guessing that when pixel crunching starts, hardware acceleration stops. That doesn't please me either. Is there an easy, pre-packaged, vacuum-sealed solution? Did I miss a flag I was supposed to pass to someone or a render state I was supposed to set? Thanks for your time.
-- Landon
Advertisement
Look into using Device->SetTextureStageState with D3DTSS_MAGFILTER and D3DTSS_MINFILTER.

Device->SetTextureStageState( 0, D3DTSS_MAGFILTER, D3DTEXF_LINEAR );
Device->SetTextureStageState( 0, D3DTSS_MINFILTER, D3DTEXF_LINEAR );

If you want more advanced filters than point, linear and triangler I think you'll have to do pixel crunching.

Also this isn't going to perform any miracles. You can't just make a 32x32 image, 256x256 and expect it to look great.

If you want whole-screen anti-aliasing you'll have to turn multi-sampling on when setting the device parameters. Although I've found this usually murders the performance.
Thank you for the quick responce!

Linear will be just fine for my purposes. The small texture I'm blowing up is just a feint transparency I'm stretching over a tile-map to give it some more variation.
-- Landon

This topic is closed to new replies.

Advertisement