vGGXSmithCorrelated top-level property

dynamic vGGXSmithCorrelated
getter/setter pair

Implementation

var vGGXSmithCorrelated = shaderNode((inputs) {
  var alpha = inputs.alpha;
  var dotNL = inputs.dotNL;
  var dotNV = inputs.dotNV;

  var a2 = pow2(alpha);

  var gv = mul(dotNL, sqrt(add(a2, mul(sub(1.0, a2), pow2(dotNV)))));
  var gl = mul(dotNV, sqrt(add(a2, mul(sub(1.0, a2), pow2(dotNL)))));

  return div(0.5, max(add(gv, gl), epsilon));
});