getGeometryRoughness.js 382 B

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