4
\$\begingroup\$

I'm working with a deferred shading technique. I have diffuse, normal and depth buffers, which I combine for the final scene composition. Where and when exactly do I apply an anti-aliasing pass (such as FXAA)? Just on the color buffer before lighting or any processing? Or as a separate pass on the final scene? Or something in-between?

\$\endgroup\$
2
\$\begingroup\$

Techniques like FXAA, MLAA etc. are normally applied almost at the very end of the graphics frame - after all lighting, postprocessing, color correction etc. is complete, but before rendering UI and text (because those normally already have sufficient antialiasing built in to their textures and don't need any more).

\$\endgroup\$
5
\$\begingroup\$

Anti-aliasing in a deferred shader is a complex topic. WikiPedia lists a number of techniques for doing anti-aliasing in a deferred-compatible way.

Typically you'll need to do it after lighting, otherwise you can end up with lighting artifacts. Most approaches I know of do another pass on the scene after the entire deferred pipeline is complete.

If you are using more recent hardware and APIs, you can "simply" use multisampled render targets for your color and light buffers (the newer APIs allow you to sample those as needed) at the usual cost of increased memory usage. The other techniques can work with nothing more than a small number of extra buffers/passes and have only compute time costs.

\$\endgroup\$
1
  • \$\begingroup\$ I'm steering clear of multisampling. As for applying FXAA for instance, done after the lighting pass, should it be before combining on diffuse target only or for the final image? \$\endgroup\$ – RecursiveCall Jul 5 '13 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.