Pbr
Physically-based Rendering
- notations:
is the shading point. is the outgoing view direction (shading point to eye) is the outgoing lighting direction (shading point to light) is the normal vector is the reflective direction is the halfway vector (different from !) is the metalness is the roughness is the ambient color (base color) is the occlusion probability from the shading point to light.
- rendering Equation:
-
micro-facet BRDF (Cook-Torrance 1982): $$ f(\omega_i, \omega_o) = (1 - m) \frac {\mathbf a} {\pi} + \frac {DFG} {4(\omega_i \cdot \mathbf n)(\omega_o \cdot \mathbf n)} $$ The BRDF can be divided into diffuse + specular terms, where the specular term includes:
- F = Fresnel term
- G = Geometry term (Schlick-GGX) $$ k = \rho^4 / 2 \ g(\mathbf v) = \frac {\mathbf n \cdot \mathbf v} {k + (1 - k)\mathbf n \cdot \mathbf v}\ G = g(\omega_o) g(\omega_i) $$
- D = Normal Distribution (Trowbridge-Reitz GGX) $$ \alpha = \rho^2 \ D = \frac {\alpha^2} {\pi((\mathbf n \cdot \mathbf h)(\alpha^2 - 1) + 1)^2} $$
- split-sum approximation (Karis and Games 2013) $$ \int_\Omega L(\omega_i)\frac {DFG} {4(\omega_i \cdot \mathbf n)(\omega_o \cdot \mathbf n)} (\omega_i \cdot \mathbf n)d \omega_i \ = \int_\Omega L(\omega_i)Dd\omega_i \int_\Omega \frac {DFG} {4(\omega_o \cdot \mathbf n)} d \omega_i \ $$
-
lighting representation $$ L(\omega_i) = (1 - s(\omega_i)) g_\text{direct}(\omega_i) + s(\omega_i) g_\text{indirect}(\omega_i, \mathbf p) \ s(\omega_i) = g_\text{occ}(\omega_i, \mathbf p) $$
- direct term (from light): only dependent on the outgoing light direction.
- indirect term (from other reflective surfaces): also dependent on the current shading point.
Metallic/Roughness v.s. Specular/Glossiness
Except for the common metallic-roughness model, there is also specular-glossiness model for PBR (e.g., Unity).
Both models can be converted between: https://kcoley.github.io/glTF/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/examples/convert-between-workflows/
A detailed documentation can be found: https://kcoley.github.io/glTF/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/