提交 7a68f02f 编写于 作者: G Garrett Johnson

node modularize

上级 ecd8117e
......@@ -77,7 +77,7 @@ var BokehPass = function ( scene, camera, params ) {
this.fsQuad = new Pass.FullScreenQuad( this.materialBokeh );
this.oldClearColor = new Color();
this._oldClearColor = new Color();
};
......@@ -91,7 +91,7 @@ BokehPass.prototype = Object.assign( Object.create( Pass.prototype ), {
this.scene.overrideMaterial = this.materialDepth;
renderer.getClearColor( this.oldClearColor );
renderer.getClearColor( this._oldClearColor );
var oldClearAlpha = renderer.getClearAlpha();
var oldAutoClear = renderer.autoClear;
renderer.autoClear = false;
......@@ -122,7 +122,7 @@ BokehPass.prototype = Object.assign( Object.create( Pass.prototype ), {
}
this.scene.overrideMaterial = null;
renderer.setClearColor( this.oldClearColor );
renderer.setClearColor( this._oldClearColor );
renderer.setClearAlpha( oldClearAlpha );
renderer.autoClear = oldAutoClear;
......
......@@ -11,7 +11,7 @@ var ClearPass = function ( clearColor, clearAlpha ) {
this.clearColor = ( clearColor !== undefined ) ? clearColor : 0x000000;
this.clearAlpha = ( clearAlpha !== undefined ) ? clearAlpha : 0;
this.oldClearColor = new Color();
this._oldClearColor = new Color();
};
......@@ -25,7 +25,7 @@ ClearPass.prototype = Object.assign( Object.create( Pass.prototype ), {
if ( this.clearColor ) {
renderer.getClearColor( this.oldClearColor );
renderer.getClearColor( this._oldClearColor );
oldClearAlpha = renderer.getClearAlpha();
renderer.setClearColor( this.clearColor, this.clearAlpha );
......@@ -37,7 +37,7 @@ ClearPass.prototype = Object.assign( Object.create( Pass.prototype ), {
if ( this.clearColor ) {
renderer.setClearColor( this.oldClearColor, oldClearAlpha );
renderer.setClearColor( this._oldClearColor, oldClearAlpha );
}
......
......@@ -116,7 +116,7 @@ var OutlinePass = function ( resolution, scene, camera, selectedObjects ) {
this.enabled = true;
this.needsSwap = false;
this.oldClearColor = new Color();
this._oldClearColor = new Color();
this.oldClearAlpha = 1;
this.fsQuad = new Pass.FullScreenQuad( null );
......@@ -296,7 +296,7 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
if ( this.selectedObjects.length > 0 ) {
renderer.getClearColor( this.oldClearColor );
renderer.getClearColor( this._oldClearColor );
this.oldClearAlpha = renderer.getClearAlpha();
var oldAutoClear = renderer.autoClear;
......@@ -411,7 +411,7 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
renderer.setRenderTarget( readBuffer );
this.fsQuad.render( renderer );
renderer.setClearColor( this.oldClearColor, this.oldClearAlpha );
renderer.setClearColor( this._oldClearColor, this.oldClearAlpha );
renderer.autoClear = oldAutoClear;
}
......
......@@ -18,7 +18,7 @@ var RenderPass = function ( scene, camera, overrideMaterial, clearColor, clearAl
this.clear = true;
this.clearDepth = false;
this.needsSwap = false;
this.oldClearColor = new Color();
this._oldClearColor = new Color();
};
......@@ -43,7 +43,7 @@ RenderPass.prototype = Object.assign( Object.create( Pass.prototype ), {
if ( this.clearColor ) {
renderer.getClearColor( this.oldClearColor );
renderer.getClearColor( this._oldClearColor );
oldClearAlpha = renderer.getClearAlpha();
renderer.setClearColor( this.clearColor, this.clearAlpha );
......@@ -64,7 +64,7 @@ RenderPass.prototype = Object.assign( Object.create( Pass.prototype ), {
if ( this.clearColor ) {
renderer.setClearColor( this.oldClearColor, oldClearAlpha );
renderer.setClearColor( this._oldClearColor, oldClearAlpha );
}
......
......@@ -44,7 +44,7 @@ var SAOPass = function ( scene, camera, depthTexture, useNormals, resolution ) {
this.supportsNormalTexture = ( useNormals !== undefined ) ? useNormals : false;
this.originalClearColor = new Color();
this.oldClearColor = new Color();
this._oldClearColor = new Color();
this.oldClearAlpha = 1;
this.params = {
......@@ -220,7 +220,7 @@ SAOPass.prototype = Object.assign( Object.create( Pass.prototype ), {
}
renderer.getClearColor( this.oldClearColor );
renderer.getClearColor( this._oldClearColor );
this.oldClearAlpha = renderer.getClearAlpha();
var oldAutoClear = renderer.autoClear;
renderer.autoClear = false;
......@@ -331,7 +331,7 @@ SAOPass.prototype = Object.assign( Object.create( Pass.prototype ), {
// Rendering SAOPass result on top of previous pass
this.renderPass( renderer, outputMaterial, this.renderToScreen ? null : readBuffer );
renderer.setClearColor( this.oldClearColor, this.oldClearAlpha );
renderer.setClearColor( this._oldClearColor, this.oldClearAlpha );
renderer.autoClear = oldAutoClear;
},
......
......@@ -33,7 +33,7 @@ var SSAARenderPass = function ( scene, camera, clearColor, clearAlpha ) {
// as we need to clear the buffer in this pass, clearColor must be set to something, defaults to black.
this.clearColor = ( clearColor !== undefined ) ? clearColor : 0x000000;
this.clearAlpha = ( clearAlpha !== undefined ) ? clearAlpha : 0;
this.oldClearColor = new Color();
this._oldClearColor = new Color();
if ( CopyShader === undefined ) console.error( "SSAARenderPass relies on CopyShader" );
......@@ -90,7 +90,7 @@ SSAARenderPass.prototype = Object.assign( Object.create( Pass.prototype ), {
var autoClear = renderer.autoClear;
renderer.autoClear = false;
renderer.getClearColor( this.oldClearColor );
renderer.getClearColor( this._oldClearColor );
var oldClearAlpha = renderer.getClearAlpha();
var baseSampleWeight = 1.0 / jitterOffsets.length;
......@@ -147,7 +147,7 @@ SSAARenderPass.prototype = Object.assign( Object.create( Pass.prototype ), {
if ( this.camera.clearViewOffset ) this.camera.clearViewOffset();
renderer.autoClear = autoClear;
renderer.setClearColor( this.oldClearColor, oldClearAlpha );
renderer.setClearColor( this._oldClearColor, oldClearAlpha );
}
......
......@@ -147,7 +147,7 @@ var UnrealBloomPass = function ( resolution, strength, radius, threshold ) {
this.enabled = true;
this.needsSwap = false;
this.oldClearColor = new Color();
this._oldClearColor = new Color();
this.oldClearAlpha = 1;
this.basic = new MeshBasicMaterial();
......@@ -201,7 +201,7 @@ UnrealBloomPass.prototype = Object.assign( Object.create( Pass.prototype ), {
render: function ( renderer, writeBuffer, readBuffer, deltaTime, maskActive ) {
renderer.getClearColor( this.oldClearColor );
renderer.getClearColor( this._oldClearColor );
this.oldClearAlpha = renderer.getClearAlpha();
var oldAutoClear = renderer.autoClear;
renderer.autoClear = false;
......@@ -289,7 +289,7 @@ UnrealBloomPass.prototype = Object.assign( Object.create( Pass.prototype ), {
// Restore renderer settings
renderer.setClearColor( this.oldClearColor, this.oldClearAlpha );
renderer.setClearColor( this._oldClearColor, this.oldClearAlpha );
renderer.autoClear = oldAutoClear;
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册