Implementing Anti-Aliasing

Started by
4 comments, last by Xeno 21 years, 7 months ago
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?

------------------------------- Goblineye Entertainment------------------------------

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.
------------------------------BASIC programmers don't die, they just GOSUB and don't return.
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]
==Colt "MainRoach" McAnlisGraphics Engineer - http://mainroach.blogspot.com
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)

LostLogicwww.GamerOutfit.comXBox 360 Community Games Reviews and NewsExisled - 2D/3D Shooter for XBox 360

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.
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.
RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.

This topic is closed to new replies.

Advertisement