node-ejs-renderer/node_modules/three/examples/jsm/renderers/common/PostProcessing.js
2024-06-09 13:55:01 -04:00

34 lines
579 B
JavaScript

import { vec4, NodeMaterial } from '../../nodes/Nodes.js';
import QuadMesh from '../../objects/QuadMesh.js';
const quadMesh = new QuadMesh( new NodeMaterial() );
class PostProcessing {
constructor( renderer, outputNode = vec4( 0, 0, 1, 1 ) ) {
this.renderer = renderer;
this.outputNode = outputNode;
}
render() {
quadMesh.material.fragmentNode = this.outputNode;
quadMesh.render( this.renderer );
}
renderAsync() {
quadMesh.material.fragmentNode = this.outputNode;
return quadMesh.renderAsync( this.renderer );
}
}
export default PostProcessing;