Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 1 down vote accepted

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).

share|improve this answer

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.

share|improve this answer
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? – RecursiveCall Jul 5 '13 at 21:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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