Advertisement

Antialiasing ?

Started by October 13, 2002 05:08 AM
11 comments, last by cippyboy 22 years, 4 months ago
How can someone make Antialiasing ?Is it build-in or I have to write code for that...but the question is where ?Antialiasing is made when coming out of 3d rendering and going to 2D screen rendering.... WHat is the solution ?

Relative Games - My apps

Hi

glHint(GL_SMOOTH_POLYGON_HINT,GL_NICEST);

Thinks is something like that

Filami

Techno Grooves
Techno Grooves
Advertisement
Yeah but where does the 2x-4x-16x part come ?

Relative Games - My apps

I think that''s video card stuff. Full Screen Anti-Aliasing. I think it became common with the GeForce3 cards. It''s not really that great of a feature yet in my opinion.
Deus Ex used antialiasing, thats all i know on this subject

,Matt

-= kill one your a murderer, kill thousands your a conquerer =-
-= kill one you're a murderer, kill thousands you're a conquerer =-
POLYGON_SMOOTH is not really anti-aliasing as we see it nowadays. First it looks ugly, and is not accelerated on todays graphics cards (except professional cards) not even on GeForce4 or Radeon9700.
Though, LINE_SMOOTH and POINT_SMOOTH are good anti-aliasing methods, but they are limited to points and lines respectively. I'm only claming that POLYGON_SMOOTH is not a good idea.

Actually, the most popular anti-aliasing method is Full-Scene Anti-Aliasing, also known as FSAA (there a few other nicks hanging around).
The concept is really simple : the viewport is rendered at a higher resolution in graphics memory and is resized when sent to the monitor. Say you're playing a 3D game at 1024x768, then a 2x2 FSAA simply renders the 3D scene in a 2048x1536 viewport and every pixel of the 1024x768 viewport is computed as the average of the 4 corresponding pixels in the 2048x1536 viewport.

Advantages :
- Simple method that works on all 3D worlds without having to rebuild a new 3D engine. Just a few lines of code.
- Improves quality over a wide range of graphics card.

Disadvantages :
- Uses more video memory (important on critical cases).
- Wastes alot of fillrate. Thus may reduce dramatically performance.
- Some implementation artefacts appears on special effects such as drawing a quad over the *whole* viewport. Really minor problem, still good to know.

Currently, there are two things you can do to use FSAA :
1- configure the drivers. Most NVIDIA and ATI drivers offer an 'antialiasing' slider or radio buttons in their 'advanced' part of Windows' Display Settings.
2- ask the driver to 'let the application decide' which means that FSAA is deactivated by default, and you can activate it by using the WGL_ARB_multisample extension (there is an equivalent extension for GLX if you're developing for linux or everything UNIX).

Hope this helps. I don't know if that's what you asked.

[edited by - vincoof on October 14, 2002 12:43:06 PM]
Advertisement
Read the redbook -> chapter about Framebuffer. The multisampling FSAA is explained there.
Basically, the FSAA is created by rendering the frame many times, with slight position (called multisampling). Or render the frame at the bigger size than usual then scale it down (called supersampling).

2x, 4x = (2-pass, 4-pass for multisampling or 2 times bigger, 4 times bigger for supersampling)

Anybody has an idea how to do supersampling in OpenGL? To be precise... How to render to a framebuffer that is 2 times bigger than render buffer?
For supersampling, pbuffers are the way to go. There''s an WGL ARB extension about that, and maybe a GLX ARB too.
Aren''t there any buffer in OpenGL that is allow me to specify its dimention and can be rendered on? AUX buffers, perhaps?
According to the redbook it is possible to render at the higher resolution than in your screen, but they didn''t state how.
The problem is not how to render into a greater viewport, the problem resides in allocating the buffer. The Red Book does not explain how because it is beyond the purpose of OpenGL.

You should really look into pbuffers, that is exactly what you want : allocate a buffer that is not *visible* to the user.

AUX buffers are not really a solution because they have the same resolution as the framebuffer. You can''t allocate an AUX buffer twice as big as the framebuffer ; it doesn''t make sense in OpenGL. Though you still can perform anti-aliasing with AUX buffers even though I would recommend the accumulation buffer instead. The trick is simple : render you scene multiple times with a slight transformation of the projection matrix (for sub-pixel accuracy), and accumulate the values of each fragment. That is explained in the Red Book I think.
Anyhow AUX buffers are (merely) not supported today (in fact, there are supported, but... the number of AUX buffers available is null!) and accumulation buffer is not supported in hardware.

This topic is closed to new replies.

Advertisement