D_GGX top-level property

dynamic D_GGX
getter/setter pair

Implementation

var D_GGX = 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(RECIPROCAL_PI, div(a2, pow2(denom)));
});