OpenGL 3.2 Explicit Multisample Demo



OpenGL 3.2 Explicit Multisample Demo



Tomasz Dąbrowski has released a small deferred shading demo that shows the use of explicit multisample, a recent feature exposed by NVIDIA graphics cards. The demo use an OpenGL 3.2 codepath (OpenGL 3.2 is not required for NVIDIA explicit multisample). Explicit multisample is accessible via the GL_NV_explicit_multisample. This extension is available in ForceWare 180.42 and in the latest R190.89.

You can download the demo HERE

Explicit multisample allows to access to individual samples of an multisample buffer. In a deferred rendering, you can, for example, accuratly read the normals of a normal buffer with a routine like this one (GLSL pixel shader):

#extension GL_NV_explicit_multisample : enable
...
const int samples = 4;
...
...
for (int i = 0; i < samples; i++)
{
  // AA renderbuffers are addressed with integers
  vec3 diffuse = texelFetchRenderbuffer(diffuseSamp, uv, i).rgb;
  vec3 position = texelFetchRenderbuffer(positionSamp, uv, i).xyz;
  vec3 normal = texelFetchRenderbuffer(normalSamp, uv, i).xyz;
  result += compute_lighting(diffuse, position, normal);
}
...

In a word, we can use mulisampled buffers with the precision of non sampled buffer. For more explanation, read Tomasz article:
What is and why do we need explicit_multisample? (or how to do real antialiasing in deferred shading).

The FPS evolution on my GeForce GTX 295:

OpenGL 3.2 Explicit Multisample Demo

OpenGL 3.2 Explicit Multisample Demo

OpenGL 3.2 Explicit Multisample Demo

[via]




Geeks3D.com

↑ Grab this Headline Animator