we started pursuing physically based shading during black ...we started pursuing physically based...
TRANSCRIPT
![Page 1: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/1.jpg)
We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of the “Advances in Real-Time Rendering” course. Here I’ll present a brief summary of the important aspects and then dive into improvements we made on Black Ops II.
1
![Page 2: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/2.jpg)
2
![Page 3: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/3.jpg)
D = normal distribution function (NDF) F = reflectance function (Fresnel function) G = shadowing-masking function (Geometry function) Grouped into three “lego” pieces for easier experimentation with different formulations and approximations. D_pl = NDF for point lights grouped with pi/4. V = visibility function: shadowing-masking grouped with foreshortening terms.
3
![Page 4: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/4.jpg)
4
![Page 5: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/5.jpg)
Microfacet H-dot-L-based formulation. Everyone seems to use this.
5
![Page 6: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/6.jpg)
Schlick-Smith gave the most plausible (albeit the most expensive) specular response. Lesson learned: very important to have high quality shadow-masking for PBS.
6
![Page 7: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/7.jpg)
Switching gears: indirect specular via environment maps. We capture environment maps at artist-selected locations in the level. We wanted to use as few and as high resolution environment maps as possible. We came up with a method that lets us better “fit” and hence “reuse” the same environment map in very different lighting environments compared to where the environment map was captured.
7
![Page 8: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/8.jpg)
env_sh[0] is the DC term, which is equivalent to evaluating the SH with a (0, 0, 0) direction. pixel_average_irradiance can usually be calculated as a cheap byproduct from most forms of light baking.
8
![Page 9: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/9.jpg)
9
![Page 10: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/10.jpg)
Here we’re using the N-dot-V form of the Fresnel formulation. 1/(4 – 3g) acts as a shadowing-masking factor
10
![Page 11: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/11.jpg)
11
![Page 12: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/12.jpg)
The picture shows conceptually the problem through the use of colors. In practice, the problems were mostly intensity related and less often about color. The environment map is normalized from a light probe sample (full sphere of lighting information). However, lightmap bakes often store only a hemisphere worth of information, hence when we de-normalize the environment map we can’t compensate for the missing hemisphere.
12
![Page 13: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/13.jpg)
13
![Page 14: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/14.jpg)
pixel_irradiance can usually be calculated as a cheap byproduct of most forms of light baking. It’s virtually guaranteed to exist considering geometric normal irradiance is the most important direction to reproduce correctly.
14
![Page 15: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/15.jpg)
The same mesh with three different light bakes. The image shows environment specular, boosted 3 stops for easier comparison.
15
![Page 16: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/16.jpg)
Notice how the specular from the different light bakes is a lot closer now.
16
![Page 17: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/17.jpg)
The Black Ops pre-filtering used a Gaussian, which was not an exact match to our cosine power distribution function.
17
![Page 18: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/18.jpg)
18
![Page 19: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/19.jpg)
Notice how the environment map blurs much more linearly across the gloss range. Also notice how the environment blur is a closer match to the sun hotspot diffusion.
19
![Page 20: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/20.jpg)
Before we talk about how we improved the Environment BRDF, let’s talk about what we’re trying to solve first. One option for solving this integral is to importance sample the environment map and the BRDF in the pixel shader. This is very expensive, but it’s a good ground truth. Note that the environment NDF has a division by pi, as opposed to the point-light NDF which does not.
20
![Page 21: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/21.jpg)
Environment BRDF: conceptually you can think of it as the BRDF result for a white environment map.
21
![Page 22: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/22.jpg)
22
![Page 23: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/23.jpg)
On the x-axis we plot N-dot-V, where rf0 is to the right, glancing angles are to the left.
23
![Page 24: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/24.jpg)
We fitted curves by trial and error, using Mathematica to guide the process.
24
![Page 25: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/25.jpg)
We deployed the “cheaper” curves, with good visual results. However, we needed even cheaper expressions.
25
![Page 26: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/26.jpg)
26
![Page 27: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/27.jpg)
27
![Page 28: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/28.jpg)
This is what we shipped with. It was actually faster than the Black Ops Environment “Fresnel”.
28
![Page 29: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/29.jpg)
29
![Page 30: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/30.jpg)
Notice the much more natural looking specular on the shadowed side of the truck. The car paint is a dielectric material (non-metallic paint).
30
![Page 31: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/31.jpg)
31
![Page 32: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/32.jpg)
32
![Page 33: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/33.jpg)
33
![Page 34: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/34.jpg)
Note: this is to approximate the (1 – H-dot-L)^5 part of Schlick’s Fresnel function.
34
![Page 35: We started pursuing Physically Based Shading during Black ...We started pursuing Physically Based Shading during Black Ops, details of which I presented at SIGGRAPH 2011, as part of](https://reader030.vdocuments.us/reader030/viewer/2022040523/5e83b0e60da5934e304d5aa1/html5/thumbnails/35.jpg)
35