Garrett Johnson %!s(int64=4) %!d(string=hai) anos
pai
achega
e88eb69930

+ 7 - 3
examples/jsm/postprocessing/ClearPass.js

@@ -1,3 +1,6 @@
+import {
+	Color
+} from "../../../build/three.module.js";
 import { Pass } from "../postprocessing/Pass.js";
 
 var ClearPass = function ( clearColor, clearAlpha ) {
@@ -8,6 +11,7 @@ var ClearPass = function ( clearColor, clearAlpha ) {
 
 	this.clearColor = ( clearColor !== undefined ) ? clearColor : 0x000000;
 	this.clearAlpha = ( clearAlpha !== undefined ) ? clearAlpha : 0;
+	this.oldClearColor = new Color();
 
 };
 
@@ -17,11 +21,11 @@ ClearPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 	render: function ( renderer, writeBuffer, readBuffer /*, deltaTime, maskActive */ ) {
 
-		var oldClearColor, oldClearAlpha;
+		var oldClearAlpha;
 
 		if ( this.clearColor ) {
 
-			oldClearColor = renderer.getClearColor().getHex();
+			renderer.getClearColor( this.oldClearColor );
 			oldClearAlpha = renderer.getClearAlpha();
 
 			renderer.setClearColor( this.clearColor, this.clearAlpha );
@@ -33,7 +37,7 @@ ClearPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 		if ( this.clearColor ) {
 
-			renderer.setClearColor( oldClearColor, oldClearAlpha );
+			renderer.setClearColor( this.oldClearColor, oldClearAlpha );
 
 		}
 

+ 7 - 3
examples/jsm/postprocessing/RenderPass.js

@@ -1,3 +1,6 @@
+import {
+	Color
+} from "../../../build/three.module.js";
 import { Pass } from "../postprocessing/Pass.js";
 
 var RenderPass = function ( scene, camera, overrideMaterial, clearColor, clearAlpha ) {
@@ -15,6 +18,7 @@ var RenderPass = function ( scene, camera, overrideMaterial, clearColor, clearAl
 	this.clear = true;
 	this.clearDepth = false;
 	this.needsSwap = false;
+	this.oldClearColor = new Color();
 
 };
 
@@ -27,7 +31,7 @@ RenderPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 		var oldAutoClear = renderer.autoClear;
 		renderer.autoClear = false;
 
-		var oldClearColor, oldClearAlpha, oldOverrideMaterial;
+		var oldClearAlpha, oldOverrideMaterial;
 
 		if ( this.overrideMaterial !== undefined ) {
 
@@ -39,7 +43,7 @@ RenderPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 		if ( this.clearColor ) {
 
-			oldClearColor = renderer.getClearColor().getHex();
+			renderer.getClearColor( this.oldClearColor );
 			oldClearAlpha = renderer.getClearAlpha();
 
 			renderer.setClearColor( this.clearColor, this.clearAlpha );
@@ -60,7 +64,7 @@ RenderPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 
 		if ( this.clearColor ) {
 
-			renderer.setClearColor( oldClearColor, oldClearAlpha );
+			renderer.setClearColor( this.oldClearColor, oldClearAlpha );
 
 		}
 

+ 4 - 2
examples/jsm/postprocessing/SSAARenderPass.js

@@ -1,5 +1,6 @@
 import {
 	AdditiveBlending,
+	Color,
 	LinearFilter,
 	RGBAFormat,
 	ShaderMaterial,
@@ -32,6 +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();
 
 	if ( CopyShader === undefined ) console.error( "SSAARenderPass relies on CopyShader" );
 
@@ -88,7 +90,7 @@ SSAARenderPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 		var autoClear = renderer.autoClear;
 		renderer.autoClear = false;
 
-		var oldClearColor = renderer.getClearColor().getHex();
+		renderer.getClearColor( this.oldClearColor );
 		var oldClearAlpha = renderer.getClearAlpha();
 
 		var baseSampleWeight = 1.0 / jitterOffsets.length;
@@ -145,7 +147,7 @@ SSAARenderPass.prototype = Object.assign( Object.create( Pass.prototype ), {
 		if ( this.camera.clearViewOffset ) this.camera.clearViewOffset();
 
 		renderer.autoClear = autoClear;
-		renderer.setClearColor( oldClearColor, oldClearAlpha );
+		renderer.setClearColor( this.oldClearColor, oldClearAlpha );
 
 	}