You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
448 B
28 lines
448 B
6 months ago
|
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 );
|