GLSL-based Sort-Last Recomposition


Equalizer just got a lot faster for database (sort-last) compounds.

The problem with the recomposition is that if you are using a fixed-function pipeline the standard algorithm is using stencilling and glDrawPixels. The latter is dreadfully slow for depth values, since the depth and stencil values are interleaved in the frame buffer.

Equalizer’s new default algorithm uses a GLSL fragment shader (when available) and two textures. The shader simply reads the color and depth values from the two textures and uses them as the fragment’s color and depth value, respectively. The depth test will take care of the correct fragment ordering.

The performance speedup is impressive, even without any tuning. So far I’ve tested it on a Linux system with a GeForce 7800 – the speedup is roughly 2.3x ( 171ms old, 72ms new at 2560×1600 and 42ms old, 18ms new at 1280×800).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: