dGGX top-level property

dynamic dGGX
getter/setter pair

Implementation

var dGGX = shaderNode((inputs) {
  var alpha = inputs.alpha;
  var dotNH = inputs.dotNH;

  var a2 = pow2(alpha);

  var denom = add(mul(pow2(dotNH), sub(a2, 1.0)), 1.0); // avoid alpha = 0 with dotNH = 1

  return mul(reciprocalPi, div(a2, pow2(denom)));
});