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.
26 lines
449 B
26 lines
449 B
2 years ago
|
import LightingNode from './LightingNode.js';
|
||
|
import { float, add, mul, sub } from '../shadernode/ShaderNodeElements.js';
|
||
|
|
||
|
class AONode extends LightingNode {
|
||
|
|
||
|
constructor( aoNode = null ) {
|
||
|
|
||
|
super();
|
||
|
|
||
|
this.aoNode = aoNode;
|
||
|
|
||
|
}
|
||
|
|
||
|
construct( builder ) {
|
||
|
|
||
|
const aoIntensity = 1;
|
||
|
const aoNode = add( mul( sub( float( this.aoNode ), 1.0 ), aoIntensity ), 1.0 );
|
||
|
|
||
|
builder.context.ambientOcclusion.mul( aoNode );
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
export default AONode;
|