Path: blob/main/projects/HexGL/libs/postprocessing/RenderPass.js
4627 views
/**1* @author alteredq / http://alteredqualia.com/2*/34THREE.RenderPass = function ( scene, camera, overrideMaterial, clearColor, clearAlpha ) {56this.scene = scene;7this.camera = camera;89this.overrideMaterial = overrideMaterial;1011this.clearColor = clearColor;12this.clearAlpha = ( clearAlpha !== undefined ) ? clearAlpha : 1;1314this.oldClearColor = new THREE.Color();15this.oldClearAlpha = 1;1617this.enabled = true;18this.clear = true;19this.needsSwap = false;2021this.prePass = null;22this.postPass = null;23};2425THREE.RenderPass.prototype = {2627render: function ( renderer, writeBuffer, readBuffer, delta ) {2829if( this.prePass )30{31this.prePass.call(this, renderer);32}3334this.scene.overrideMaterial = this.overrideMaterial;3536if ( this.clearColor ) {3738this.oldClearColor.copy( renderer.getClearColor() );39this.oldClearAlpha = renderer.getClearAlpha();4041renderer.setClearColor( this.clearColor, this.clearAlpha );4243}4445renderer.render( this.scene, this.camera, readBuffer, this.clear );4647if ( this.clearColor ) {4849renderer.setClearColor( this.oldClearColor, this.oldClearAlpha );5051}5253this.scene.overrideMaterial = null;5455if( this.postPass )56{57this.postPass.call(this, renderer);58}5960}6162};636465