A GGX (Trowbridge-Reitz) microfacet BRDF shader.
The BRDF is:
$f_r = k_d / π + D(h) · F(l,h) · G(l,v) / (4 · cos θ_i · cos θ_o)$
where:
D(h) := GGX normal distribution function:
$D = α² / (π · (cos²θ_h · (α²−1) + 1)²)$
F(l,h) := Schlick Fresnel approximation:
$F = F₀ + (1−F₀)(1−cos θ_{lh})⁵$
, where F₀ = specular
G(l,v) := Smith height-correlated masking-shadowing:
$G = G₁(l) · G₁(v), G₁(v) = 2/(1 + √(1 + α² tan²θ_v))$
Importance sampling uses GGX NDF half-vector sampling:
$θ_h = atan(α √(ξ₁/(1−ξ₁))), φ_h = 2π ξ₂.$
Transmission is supported via the optional transparency, which enables Fresnel-weighted straight-through (delta BTDF) in the CPU light model only.