Skip to content

Pbr

Physically-based Rendering

  • notations:
    • p is the shading point.
    • ωo is the outgoing view direction (shading point to eye)
    • ωi is the outgoing lighting direction (shading point to light)
    • n is the normal vector
    • t=2(nωo)nωo is the reflective direction
    • h=wi+wo||wi+wo|| is the halfway vector (different from n !)
    • m is the metalness
    • ρ is the roughness
    • a is the ambient color (base color)
    • s(ωi) is the occlusion probability from the shading point to light.
  • rendering Equation:
c(ωo)=ΩL(ωi)f(ωi,ωo)(ωin)dωi
  • 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
    F0=ma+(1m)0.04F=F0+(1F0)(1(hωo))5
    • 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/

glossiness=1roughnessdiffuse=(1metallic)basecolorspecular=metallicbasecolor

A detailed documentation can be found: https://kcoley.github.io/glTF/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/