GGX Specular Shading Model For
Metallic
Reflections By Neil Blevins Created On: May 1st 2015 Updated On: Dec 8th 2024 Software: Any
This tutorial discusses the GGX Shading Model which more closely
mimics the look of real reflections on rough surfaces.
So lets look at some real surfaces with bright light sources that I
took with my iphone...
Notice how the reflection of really bright lights (such as the sun)
tend to have a really hot center to them, and then have this longer
falloff.
Most CG specular shaders pre-2012 such as Blinn or Ward falloff do not
have the long soft tail of these
images. So in 2012 Disney released a paper on a new shading model that
was meant to capture this detail, known as GGX.
The first highlight is a reflection on real chrome which has been
captured using far more controlled conditions than my tests above, the
second is a GGX shader, and the 3rd is a Beckmann shader (closer to
Blinn). Notice how the GGX shader looks close to how the real chrome
reacts, with a sharp central highlight and then a softer falloff
(called a tail). And notice how similar their real chrome example is to
my photos.
GGX Shader
So here's my experiments with the GGX shader (using vray for 3dsmax,
but it works the same for any GGX shader)
First, here's a simple reflective sphere with a single high intensity
square area light shining at it. The sphere has a Vray Material set to
the Ward shader, the previous best shader for metallic highlights. The
shader also has a glossiness below 1 to make it a little rough (ie, the
reflection blurry)
Ward, 0.96 Glossiness
Now lets change the shader to GGX
GGX, 0.96 Glossiness, Tail 2.0
Now notice that it looks really different. Lets adjust the glossiness
value so that you get about the same amount of blur to the reflection...
GGX, 0.83 Glossiness, Tail 2.0
Notice how this looks a lot closer to the example of the real chrome
than the ward example.
Here's examples of a higher tail value, the larger the tail value, the
smaller the tail...
GGX, 0.83 Glossiness, Tail 3.0
GGX, 0.83 Glossiness, Tail 4.0
A lower tail value gives a reflection closer to the original ward
example, although notice that the square area light still appears a
little square with the GGX shader, whereas it appeared very round in
the Ward example. So the GGX shader still provides results that seem
more consistent with reality.
Now lets try it on something a little more complex, a bunch of pipes
with an hdr environment map and a high intensity square area light.
Ward, 0.96 Glossiness
Now switch to GGX...
GGX, 0.96 Glossiness, Tail 2.0
Now lets decrease the glossiness to compensate...
GGX, 0.83 Glossiness, Tail 2.0
Now the blurry parts of the environment map are approximately the same
level of blurriness in both the Ward and GGX example, but the bright
specular highlight has a much longer tail with GGX. My favorite part of
this image is shown below, notice how the longer tail makes a nice long
bright streak that is missing from the Ward example.
And of course you can play with the tail amount and glossiness to get
the exact type of highlight you want.
And here's a wedge of various values, click on the image to see it
higher res.
Some variation of the GGX shader is now the default in most modern
renderers (such as vray or Blender (although sadly Blender doesn't have
an exposed tail parameter)), so you should be all set to go.
And if your renderer of choice doesn't use it by default, see if you
can get it.