V_GGX_SmithCorrelated top-level property

dynamic V_GGX_SmithCorrelated
getter/setter pair

Implementation

var V_GGX_SmithCorrelated = 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));
});