Original Post
🔒 Locked
Antialias Algorithm
Advertisement
quote:
Original post by Damien
Where can I find an antialias algorithm and other image processing algorithms,,,
working with ddraw surfaces at the moment, trying to smooth fonts
I don't know to what you are actually referring but Anti-aliasing in Ray Tracing is a very costly process. It involves sampling a pixel many times for color.
How is this done? Essentially, the primary ray that is cast through the pixel is cast at least 10 more times (more is better though) through the pixel by varying the direction enough to keep the ray going through only that pixel and testing for intersections with objects. The average color computed for each anti-alias ray is then assigned to that pixel.
As you can see, this means that the whole process of rendering the image is X-times slower where X is the number of Anti-Alias rays to be cast.
Regards,
Jumpster
Edited by - Jumpster on October 24, 2000 9:56:22 AM
I would recommend Computer Graphics: Principles and Practice. It covers a wide range of graphics topics from 2D to 3D. It is an academic book so it is just how to do it as opposed to how to do it with C++ and DirectX under Windows. The basic idea with Anti-aliasing lines is that the pixels form a grid. Actually the pixels are at the center of each grid square. Rather than painting a line you are painting a rectangle with a thickness of the distance between two pixels. The intensity of the pixel is determined by the percentage of the pixels box that lies within the rectangle. That percentage effectively gives you an alpha to use to blend the line''s color with the existing pixel colors. That is rather computationally intense so the book details several means to approximate the process.
You could render the fonts to a buffer 4x the size you want them and then sample down... i think most people do it this way... i know sonique does this
Antialiasing is not at all raytracing specific. There are three different ways I know of to do it in a scanline renderer. The first of those is to simply render the scene at a higher resolution, and then average the pixels together to get the smaller image. The second method is to render the same image multiple times, but jittering the vertices at a sub-pixel level AFTER the vertices have been transformed to 2d space (that is, if you are using this for 3d graphics). The third method is to over sample only the scanlining, and use that information to antialias the edges of the polygons. The last method is the least computationally expensive since you are only antialiasing the edges, but it also will not do any antialiasing of textures etc, so you will need to use standard filtering techniques for that.
Anyway, good luck!
Anyway, good luck!
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement