Amazing BRDF

Physically-Based Rendering! Implementation of Disney's BRDF principles. My level is quite average, and I spent a considerable amount of time on understanding and coding the BRDF. However, it's time to summarize. I have previously implemented ray tracing on the GPU using OpenGL multiple times, achieving impressive (not really) results. Unfortunately, our code only supported diffuse reflection materials. To simulate more materials, we have to continue learning.

Linqing

Although we can use some naive methods, like the Phong model, which interpolates between random vectors and specular reflection vectors based on roughness, to simply simulate blurred specular reflections. These methods are fast and seem to have decent effects. However, this is ultimately very subjective.

Microplane theory

Microplane theory plays an important role in photorealistic rendering

If you look carefully at the reflected trees, you can't see the outlines of the branches. According to people's experience, the flatter the plane, the closer the reflection is to a mirror. Why are reflections from nearly horizontal ground so blurry and rough? Before exploring this question, recall the causes of ambiguity. Repeated sampling in the neighbor area This is what creates the blur.

Then the ground is blurred. The reason is that the reflected light does not strictly follow the direction of specular reflection, but is distributed near the standard specular reflection direction, which is equivalent to sampling the surrounding pixels:

For multiple different normal vectors, there are many exit directions calculated according to the law of reflection, and the average color of multiple light rays produces blur. This also explains why seemingly smooth floors can reflect blurry images

fr(p,wi,wo)f_r(p, w_i, w_o)

BRDF has some properties that make it scientific and reasonable. The first is the law of conservation of energy, which means that the sum of the energy of all reflected light must be equal to the energy of the incident light. For diffuse reflection, its BRDF is equal everywhere, so the BRDF of a simple diffuse reflection material can be approximately considered to be a constant.

Adjust the roughness to 0.1. At this time, the specular parameter is the default value of 0.5, and 0.5 * 0.008 = 0.004 is exactly the F0 value of the varnish material. You can see the visual impact brought by the distinct smooth coating. Adjust the metallic degree to 0.3, 0.6, 0.9 from left to right, while the roughness is still 0.1. You can see that the metal has stronger specular reflection and Weaker Fresnel effect

Although physically based rendering is complicated and has many formulas, the effect is also very stunning. These formulas can basically cover all materials in nature. More importantly, Disney's PBR is already an industry standard and is indispensable on the road to learning photorealistic rendering. Although the partial Disney BRDF is real, it also has obvious shortcomings: heavy computational burden and difficulty in convergence. Notice that many of the sample images above have obvious noise. This is because hemispheric uniform sampling cannot converge well at the sharp points of the BRDF (the lower the roughness, the harder it is). In the next part of the blog, we will use importance sampling strategy, focusing on optimizing the latter.

©2023 Cyan. All rights reserved.
Lama DevLama DevLama DevLama Dev