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.
25 lines
449 B
25 lines
449 B
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;
|
|
|