getGeometryRoughness.js 375 B

12345678910111213
  1. import { normalGeometry } from '../../accessors/NormalNode.js';
  2. import { tslFn } from '../../shadernode/ShaderNode.js';
  3. const getGeometryRoughness = tslFn( () => {
  4. const dxy = normalGeometry.dFdx().abs().max( normalGeometry.dFdy().abs() );
  5. const geometryRoughness = dxy.x.max( dxy.y ).max( dxy.z );
  6. return geometryRoughness;
  7. } );
  8. export default getGeometryRoughness;