How do you do FSAA?

BlitzMax Forums/BlitzMax Programming/How do you do FSAA?

Diordna(Posted 2004) [#1]
See topic title. I don't know any OpenGL, so keep it simple for me. (I'm planning to do try some NeHe tutorials with Blitz when I get the time.)


teamonkey(Posted 2004) [#2]
Um, it's not a simple process unfortunately.

One way to do it is to render to a buffer slightly smaller than your viewport, then copy that image to the screen, scaling it up slightly as you go. That works OK, but tends to blur things.

Another method is to render the scene twice or more from slightly different angles. Blend the two images together and you get a pretty good image... but you have to render the scene twice. You can do some cool depth-of-field effects with this method. There's actually something called an "acumulation buffer" in OpenGL which is designed for this sort of thing, but it's really hard to implement so a lot of graphics cards don't support it very well. You're better off rendering to several buffers and blending them together.

I imagine you can do a pretty good implementation with pixel shaders too, if you want to dip in to GLSL.


flying willy(Posted 2004) [#3]
Perhaps it would be simpler to enable the driver FSAA? How is this done?


John Pickford(Posted 2004) [#4]
One way to do it is to render to a buffer slightly smaller than your viewport, then copy that image to the screen, scaling it up slightly as you go. That works OK, but tends to blur things.


Teamonkey that's the exact opposite of how FSAA works.

FSAA works by rendering a buffer bigger than the screen 2x at least but it can be more. The resulting image is then blended down to screen size. It's a hardware function on most cards. Unfortunately it seems hard to reliable switch on and off in B3D. Not sure about Max.