GLSL Post-Processing Effect Framework

Introduction

The SoPostEffectRenderer module and its extensions provide a framework for screen-space post-processing effects using GLSL shaders.

It offers:

  • Configurable super-sampling anti-aliasing
  • Anti-aliasing as a post-processing step (instead of MSAA)
  • Rendering of various effects (e.g., glow, edges, screen space ambient occlusion)
  • Custom shaders/buffers to build own effects

How to use

The SoPostEffectRenderer module collects all extensions in front of it and renders all effects in the order in which they have been placed into the scene. After applying all effects, it renders the buffers named colorBuffer and depthBuffer to the default Open Inventor framebuffer.

The order of the effects is important; for instance, it only makes sense to do anti-aliasing as one of the last effects; otherwise, you will get aliased effects on top of the anti-aliased color buffer. The same applies to SoPostEffectAmbientOcclusion: it should be applied after the main geometry pass and not after any transparent geometry that is rendered on top.

PostEffectRenderer macro module

The PostEffectRenderer macro module combines the typically used extensions into a default post effect renderer, which can be extended with additional effects. While it is not required to use this macro module, it merely provides an easier starting point for the post effect framework.

Effect extensions

Building custom effects

The main module for building custom effects is the SoPostEffectCustomPass module. It can have an arbitrary number of input buffers and writes/blends the results to an output buffer. In addition, there are various modules that allow for working with buffers to, for example, copy, downsample, and blur them.