Cesium-Examples/libs/three/examples/jsm/nodes/lighting/AONode.js
2025-03-19 11:00:22 +08:00

28 lines
442 B
JavaScript

import LightingNode from './LightingNode.js';
import { addNodeClass } from '../core/Node.js';
class AONode extends LightingNode {
constructor( aoNode = null ) {
super();
this.aoNode = aoNode;
}
construct( 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 );