Parcourir la source

Fixed postprocessing Object.assign()s.

Mr.doob il y a 9 ans
Parent
commit
87ae9e7153

+ 2 - 2
examples/js/postprocessing/AdaptiveToneMappingPass.js

@@ -123,9 +123,9 @@ THREE.AdaptiveToneMappingPass = function ( adaptive, resolution ) {
 
 };
 
-THREE.AdaptiveToneMappingPass.prototype = Object.create( THREE.Pass.prototype );
+THREE.AdaptiveToneMappingPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), {
 
-Object.assign( THREE.AdaptiveToneMappingPass.prototype, {
+	constructor: THREE.AdaptiveToneMappingPass,
 
 	render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
 

+ 2 - 2
examples/js/postprocessing/BloomPass.js

@@ -73,9 +73,9 @@ THREE.BloomPass = function ( strength, kernelSize, sigma, resolution ) {
 
 };
 
-THREE.BloomPass.prototype = Object.create( THREE.Pass.prototype );
+THREE.BloomPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), {
 
-Object.assign( THREE.BloomPass.prototype, {
+	constructor: THREE.BloomPass,
 
 	render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
 

+ 2 - 2
examples/js/postprocessing/BokehPass.js

@@ -67,9 +67,9 @@ THREE.BokehPass = function ( scene, camera, params ) {
 
 };
 
-THREE.BokehPass.prototype = Object.create( THREE.Pass.prototype );
+THREE.BokehPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), {
 
-Object.assign( THREE.BokehPass.prototype, {
+	constructor: THREE.BokehPass,
 
 	render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
 

+ 2 - 2
examples/js/postprocessing/ClearPass.js

@@ -10,9 +10,9 @@ THREE.ClearPass = function () {
 
 };
 
-THREE.ClearPass.prototype = Object.create( THREE.Pass.prototype );
+THREE.ClearPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ),
 
-Object.assign( THREE.ClearPass.prototype, {
+	constructor: THREE.ClearPass,
 
 	render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
 

+ 2 - 2
examples/js/postprocessing/DotScreenPass.js

@@ -33,9 +33,9 @@ THREE.DotScreenPass = function ( center, angle, scale ) {
 
 };
 
-THREE.DotScreenPass.prototype = Object.create( THREE.Pass.prototype );
+THREE.DotScreenPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), {
 
-Object.assign( THREE.DotScreenPass.prototype, {
+	constructor: THREE.DotScreenPass,
 
 	render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
 

+ 4 - 6
examples/js/postprocessing/EffectComposer.js

@@ -34,7 +34,7 @@ THREE.EffectComposer = function ( renderer, renderTarget ) {
 
 };
 
-THREE.EffectComposer.prototype = {
+Object.assign( THREE.EffectComposer.prototype, {
 
 	swapBuffers: function() {
 
@@ -142,7 +142,7 @@ THREE.EffectComposer.prototype = {
 
 	}
 
-};
+} );
 
 
 THREE.Pass = function () {
@@ -161,9 +161,7 @@ THREE.Pass = function () {
 
 };
 
-THREE.Pass.prototype = {
-
-	constructor: THREE.Pass,
+Object.assign( THREE.Pass.prototype, {
 
 	setSize: function( width, height ) {},
 
@@ -173,4 +171,4 @@ THREE.Pass.prototype = {
 
 	}
 
-};
+} );

+ 2 - 2
examples/js/postprocessing/FilmPass.js

@@ -34,9 +34,9 @@ THREE.FilmPass = function ( noiseIntensity, scanlinesIntensity, scanlinesCount,
 
 };
 
-THREE.FilmPass.prototype = Object.create( THREE.Pass.prototype );
+THREE.FilmPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), {
 
-Object.assign( THREE.FilmPass.prototype, {
+	constructor: THREE.FilmPass,
 
 	render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
 

+ 2 - 2
examples/js/postprocessing/GlitchPass.js

@@ -35,9 +35,9 @@ THREE.GlitchPass = function ( dt_size ) {
 
 };
 
-THREE.GlitchPass.prototype = Object.create( THREE.Pass.prototype );
+THREE.GlitchPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), {
 
-Object.assign( THREE.GlitchPass.prototype, {
+	constructor: THREE.GlitchPass,
 
 	render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
 

+ 2 - 2
examples/js/postprocessing/ManualMSAARenderPass.js

@@ -43,9 +43,9 @@ THREE.ManualMSAARenderPass = function ( scene, camera ) {
 
 };
 
-THREE.ManualMSAARenderPass.prototype = Object.create( THREE.Pass.prototype );
+THREE.ManualMSAARenderPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), {
 
-Object.assign( THREE.ManualMSAARenderPass.prototype, {
+	constructor: THREE.ManualMSAARenderPass,
 
 	dispose: function() {
 

+ 2 - 2
examples/js/postprocessing/MaskPass.js

@@ -16,9 +16,9 @@ THREE.MaskPass = function ( scene, camera ) {
 
 };
 
-THREE.MaskPass.prototype = Object.create( THREE.Pass.prototype );
+THREE.MaskPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), {
 
-Object.assign( THREE.MaskPass.prototype, {
+	constructor: THREE.MaskPass,
 
 	render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
 

+ 2 - 2
examples/js/postprocessing/RenderPass.js

@@ -22,9 +22,9 @@ THREE.RenderPass = function ( scene, camera, overrideMaterial, clearColor, clear
 
 };
 
-THREE.RenderPass.prototype = Object.create( THREE.Pass.prototype );
+THREE.RenderPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), {
 
-Object.assign( THREE.RenderPass.prototype, {
+	constructor: THREE.RenderPass,
 
 	render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
 

+ 3 - 3
examples/js/postprocessing/SMAAPass.js

@@ -104,10 +104,10 @@ THREE.SMAAPass = function ( width, height ) {
 
 };
 
-THREE.SMAAPass.prototype = Object.create( THREE.Pass.prototype );
+THREE.SMAAPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), {
+
+	constructor: THREE.SMAAPass,
 
-Object.assign( THREE.SMAAPass.prototype, {
-
 	render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
 
 		// pass 1

+ 2 - 2
examples/js/postprocessing/SavePass.js

@@ -42,9 +42,9 @@ THREE.SavePass = function ( renderTarget ) {
 
 };
 
-THREE.SavePass.prototype = Object.create( THREE.Pass.prototype );
+THREE.SavePass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), {
 
-Object.assign( THREE.SavePass.prototype, {
+	constructor: THREE.SavePass,
 
 	render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
 

+ 2 - 2
examples/js/postprocessing/ShaderPass.js

@@ -38,9 +38,9 @@ THREE.ShaderPass = function( shader, textureID ) {
 
 };
 
-THREE.ShaderPass.prototype = Object.create( THREE.Pass.prototype );
+THREE.ShaderPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), {
 
-Object.assign( THREE.ShaderPass.prototype, {
+	constructor: THREE.ShaderPass,
 
 	render: function( renderer, writeBuffer, readBuffer, delta, maskActive ) {
 

+ 3 - 3
examples/js/postprocessing/TAARenderPass.js

@@ -28,9 +28,9 @@ THREE.TAARenderPass = function ( scene, camera, params ) {
 
 THREE.TAARenderPass.JitterVectors = THREE.ManualMSAARenderPass.JitterVectors;
 
-THREE.TAARenderPass.prototype = Object.create( THREE.ManualMSAARenderPass.prototype );
+THREE.TAARenderPass.prototype = Object.assign( Object.create( THREE.ManualMSAARenderPass.prototype ), {
 
-Object.assign( THREE.TAARenderPass.prototype, {
+	constructor: THREE.TAARenderPass,
 
 	render: function ( renderer, writeBuffer, readBuffer, delta ) {
 
@@ -95,7 +95,7 @@ Object.assign( THREE.TAARenderPass.prototype, {
 			}
 
 			if ( this.camera.clearViewOffset ) this.camera.clearViewOffset();
-			
+
 		}
 
 		var accumulationWeight = this.accumulateIndex * sampleWeight;

+ 2 - 2
examples/js/postprocessing/TexturePass.js

@@ -34,9 +34,9 @@ THREE.TexturePass = function ( texture, opacity ) {
 
 };
 
-THREE.TexturePass.prototype = Object.create( THREE.Pass.prototype );
+THREE.TexturePass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), {
 
-Object.assign( THREE.TexturePass.prototype, {
+	constructor: THREE.TexturePass,
 
 	render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {