Jump to content
  • Advertisement

Archived

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

Xeno

Implementing Anti-Aliasing

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

where i can find some useful tutorial about anti-aliasing? coz i created some aliased images for my game so i can render them with transparent background , but when i render them i want them to be anti-aliased - so i guess i have to implement the effect by myself, so , is there any resource i can learn from?

Share this post


Link to post
Share on other sites
Advertisement
What API are you using? If your using OGL or D3D, there are Anti-Aliasing functions built in. In D3D, just set the MultiSampleType member of D3DPRESENT_PARAMETERS to the desired number of samples (more samples == better AA). If your using an API that doesn''t have it built in, here is a tutorial on how to antialias lines in software.

------------------------------
BASIC programmers don''t die, they just GOSUB and don''t return.

Share this post


Link to post
Share on other sites
Maybe I just haven't looked into the topic, but can't anti-aliasing be completed through a full screen blur? IE render the scene to a texture, and then display that texture billboarded with another texture blurred (Jittered?) over it. OpenGL has an implimentation for anti-ailasing, however it only supports an ON and OFF mode pretty much.
Actually I found some interesting articles in the OpenGL redbook here: At redbook
There's also a technique called "Jittering" which deals with anti-ailiasing specificly, you might want to look into that as well.

~Main

==
Colt "MainRoach" McAnlis
Programmer
www.badheat.com/sinewave

[edited by - duhroach on September 15, 2002 12:07:18 PM]

[edited by - duhroach on September 15, 2002 12:08:36 PM]

Share this post


Link to post
Share on other sites
Bluring will get rid of the jaggies but it will also result in a blurry image (of course.) People playing your game will think their monitor is on the fritz.

To see the difference, pull up Adobe''s Photoshop and draw a diagonal line using the line tool. Make sure anti-alias is selected. Open a new picture, turn off anti-alias on the line tool and draw another diagonal line. Now, go to Filters and select the Blur filter. Compare the two pictures. I think you will agree the anti-aliased one looks much better.


LostLogic
www.lostlogic.com
Author, Multiplayer Game Programming
Author, Strategy Game Programming with Direct X 9 (Not yet released)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If you just want the pictures to be "anti-aliased", add an 8-bit alpha-channel to the picture that describes how transparent it is. PNG/TGA and many other formats support this.

Share this post


Link to post
Share on other sites
Hardware antialiasing by nVidia cards is done by setting the actual screen resolution to 2 or 4 times the desired size. If you''re running at 800x600 with 2xAntiA, you''re actually rendering to a backbuffer of 1600x1200 pixels, which is then downsampled using the average value of 2x2 pixel blocks to get the final pixels. At 4xAntiA at 800x600, that''s 3200x2400 pixels in your backbuffer, being downsampled with 4x4 pixel blocks to get the final value.

There is also "quincunx", or "3x" anti aliasing. This uses a 2x backbuffer size, but samples using an "X" pattern...

. . . . .
. O . O .
. . O . .
. O . O .
. . . . .

With each of those dots being a pixel, and the Os being the pixels that we sample to get the final color. This gives the same quality and detail as 4xAAliasing, but with the memory costs of 2xAAliasing. It''s called "quincunx" because it uses 5 samples, "quint" being a word for five.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!