node-ejs-renderer/node_modules/three/examples/jsm/nodes/lighting/AONode.js

28 lines
448 B
JavaScript
Raw Permalink Normal View History

2024-06-09 13:55:01 -04:00
import LightingNode from './LightingNode.js';
import { addNodeClass } from '../core/Node.js';
class AONode extends LightingNode {
constructor( aoNode = null ) {
super();
this.aoNode = aoNode;
}
setup( builder ) {
const aoIntensity = 1;
const aoNode = this.aoNode.x.sub( 1.0 ).mul( aoIntensity ).add( 1.0 );
builder.context.ambientOcclusion.mulAssign( aoNode );
}
}
export default AONode;
addNodeClass( 'AONode', AONode );