Tag Archives: BRDF

Disney BRDF

Implementation of the Disney principled BRDF

After reading the papers from the 2012 siggraph shading courses I really wanted to try the BRDF described by Disney. It’s possible to use the awesomeopen source tool BRDF explorer, but I really wanted to try it in my own renderer.

You can download it here: PBRViewer.

In his talk, Brent Burley describe the BRDF adopted by Disney and used for every materials in Wreck-it Ralph, except for hairs. He also explain how they come up with this BRDF, the tools they used, etc. The course notes are full of informations, it’s really something anyone interested in physically based shading should read.

I already wrote a bit about the Disney BRDF in a previous post, but I’ll just remind the set of rules they choose to follow:

  1. Use intuitive rather than physical parameters.
  2. Use as few parameters as possible.
  3. Paramters should be zero to one, remapped over their plausible range.
  4. Parameters should be allowed to be pushed beyond their plausible range where it makes sense.
  5. All combinations of parameters should be as robust and plausible as possible.

The BRDF is defined by a base color, and 10 scalar parameters:

  • Subsurface
  • Metallic
  • Specular
  • Specular tint
  • Roughness
  • Anisotropic
  • Sheen
  • Sheen tint
  • Clearcoat
  • Clearcoat gloss

They are described in the slides, and in the viewer it’s easy to see the impact of each parameters on the shading.

That’s a lot of parameters more than what we can afford in our games, and even if they are quite easy to understand it’s still a bit overwhelming at first. But on the other hand it gives a lot of control.

Disney principled BRDF

The anisotropic parameter

The anisotropic parameter is really cool, and it’s something that could be great in a game (but it’s tricky to implement as it requires the tangent and binormal in the GBuffer). In my implementation it looks a bit strange because it should change the specular reflection. I need to work on that.

The sheen parameter is very subtle in BRDF explorer, and I’m not sure it’s working at all in my implementation. I’ll need to check  that, and I will upload a new version if I found a bug.

I added this BRDF in my renderer as a new workflow. Unlike the metallic and specular workflow the “Disney” workflow use a completly different code path, so the normal distribution, fresnel and visibility terms can’t be changed.

Disney principled BRDF

Subsurface parameter from 0 to 1

Textures are not supported yet for the disney’s parameters, only base color, normal roughness and metallic textures are supported for now. I’ll add the other parameters later.

The updated version of PBRViewer can be found here.

As always, if you have any feedback, feel free to contact me !

marble2

Tweaking the Cook Torrance BRDF

I’m still learning things about physically based shading using my PBRViewer, and this time, I wanted  to be able to experiment the variations of the Cook Torrance BRDF.

The Cook Torrance BRDF looks like this:

Cook Torrance BRDF

 

This equation is composed of three distinct terms:

  • F: The fresnel, represents how the reflectivity change at grazing angles.
  • G: The Geometry term, represents the probability that a microfacet will be visible from the light and view directions.
  • D The normal distribution term, defines the distribution of the orientation of the microfacets.

For more infomations you can read the very interesting “Physics and math of shading” by Naty Hoffman. For each term there is more than one possibility, and you can choose according to your need, and your budget the terms of your BRDF. Even if GGX is becoming the new standard, I wanted to experiment the other possibilities.

Brian Karis, while he was doing research on physically based shading for the Unreal Engine 4, listed all lot of variation for the different terms. This wonderful blog post can be found here. I used this references to implement each term in my viewer, so I can directly see the impact of each functions on the lightning, the shader being recompiled automatically when a term is changed.

I also added some other modifications, like beeing able to change the background color, light position, intensity, ambient light and reflection intensity, etc.

If you want to try it, you can download it here.

As always, if you see an error or if you have any feedback, please contact me, as I’m doing this to learn I would be happy to hear from you.

I also made my first step with substance designer, trying to do a marble texture.

Marble