reDirectPhysical top-level property
dynamic
reDirectPhysical
getter/setter pair
Implementation
var reDirectPhysical = shaderNode((inputs) {
var lightDirection = inputs.lightDirection;
var lightColor = inputs.lightColor;
var directDiffuse = inputs.directDiffuse;
var directSpecular = inputs.directSpecular;
var dotNL = saturate(dot(transformedNormalView, lightDirection));
var irradiance = mul(dotNL, lightColor);
irradiance = mul(irradiance, pi); // punctual light
addTo(directDiffuse, mul(irradiance, brdfLambert({diffuseColor})));
addTo(
directSpecular,
mul(irradiance,
brdfGGX({"lightDirection": lightDirection, "f0": specularColor, "f90": 1, "roughness": roughness})));
});