node-ejs-renderer/node_modules/three/examples/jsm/nodes/functions/BSDF/EnvironmentBRDF.js

14 lines
367 B
JavaScript
Raw Permalink Normal View History

2024-06-09 13:55:01 -04:00
import DFGApprox from './DFGApprox.js';
import { tslFn } from '../../shadernode/ShaderNode.js';
const EnvironmentBRDF = tslFn( ( inputs ) => {
const { dotNV, specularColor, specularF90, roughness } = inputs;
const fab = DFGApprox( { dotNV, roughness } );
return specularColor.mul( fab.x ).add( specularF90.mul( fab.y ) );
} );
export default EnvironmentBRDF;