1//* 9fbef606107a605d69c0edbcd8029e5d *// 2/** 3 * @author alteredq / http://alteredqualia.com/ 4 */ 5 6THREE.RenderPass = function ( scene, camera, overrideMaterial, clearColor, clearAlpha ) { 7 8 THREE.Pass.call( this ); 9 10 this.scene = scene; 11 this.camera = camera; 12 13 this.overrideMaterial = overrideMaterial; 14 15 this.clearColor = clearColor; 16 this.clearAlpha = ( clearAlpha !== undefined ) ? clearAlpha : 0; 17 18 this.clear = true; 19 this.clearDepth = false; 20 this.needsSwap = false; 21 22}; 23 24THREE.RenderPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), { 25 26 constructor: THREE.RenderPass, 27 28 render: function ( renderer, writeBuffer, readBuffer /*, deltaTime, maskActive */ ) { 29 30 var oldAutoClear = renderer.autoClear; 31 renderer.autoClear = false; 32 33 this.scene.overrideMaterial = this.overrideMaterial; 34 35 var oldClearColor, oldClearAlpha; 36 37 if ( this.clearColor ) { 38 39 oldClearColor = renderer.getClearColor().getHex(); 40 oldClearAlpha = renderer.getClearAlpha(); 41 42 renderer.setClearColor( this.clearColor, this.clearAlpha ); 43 44 } 45 46 if ( this.clearDepth ) { 47 48 renderer.clearDepth(); 49 50 } 51 52 renderer.setRenderTarget( this.renderToScreen ? null : readBuffer ); 53 54 // TODO: Avoid using autoClear properties, see https://github.com/mrdoob/three.js/pull/15571#issuecomment-465669600 55 if ( this.clear ) renderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil ); 56 renderer.render( this.scene, this.camera ); 57 58 if ( this.clearColor ) { 59 60 renderer.setClearColor( oldClearColor, oldClearAlpha ); 61 62 } 63 64 this.scene.overrideMaterial = null; 65 renderer.autoClear = oldAutoClear; 66 67 } 68 69} );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.