diff --git a/examples/js/postprocessing/CubeTexturePass.js b/examples/js/postprocessing/CubeTexturePass.js index ee149c5c1c9fe2fb2562ef8e9ca21a29085ed2ad..628cf9b7dd6cf7ba7a00ad79bdea560f33757ece 100644 --- a/examples/js/postprocessing/CubeTexturePass.js +++ b/examples/js/postprocessing/CubeTexturePass.js @@ -23,6 +23,16 @@ THREE.CubeTexturePass = function ( camera, envMap, opacity ) { } ) ); + Object.defineProperty( this.cubeMesh.material, 'envMap', { + + get: function () { + + return this.uniforms.envMap.value; + + } + + } ); + this.envMap = envMap; this.opacity = ( opacity !== undefined ) ? opacity : 1.0; @@ -44,8 +54,8 @@ THREE.CubeTexturePass.prototype = Object.assign( Object.create( THREE.Pass.proto this.cubeCamera.projectionMatrix.copy( this.camera.projectionMatrix ); this.cubeCamera.quaternion.setFromRotationMatrix( this.camera.matrixWorld ); - this.cubeMesh.material.envMap = this.envMap; - this.cubeMesh.material.opacity = this.opacity; + this.cubeMesh.material.uniforms.envMap.value = this.envMap; + this.cubeMesh.material.uniforms.opacity.value = this.opacity; this.cubeMesh.material.transparent = ( this.opacity < 1.0 ); renderer.setRenderTarget( this.renderToScreen ? null : readBuffer ); diff --git a/examples/jsm/postprocessing/CubeTexturePass.js b/examples/jsm/postprocessing/CubeTexturePass.js index ab627eb843a898c33824bed7b84386b97e342b11..b85553247aeb72fe40b4c965ac115f62e449af64 100644 --- a/examples/jsm/postprocessing/CubeTexturePass.js +++ b/examples/jsm/postprocessing/CubeTexturePass.js @@ -34,6 +34,16 @@ var CubeTexturePass = function ( camera, envMap, opacity ) { } ) ); + Object.defineProperty( this.cubeMesh.material, 'envMap', { + + get: function () { + + return this.uniforms.envMap.value; + + } + + } ); + this.envMap = envMap; this.opacity = ( opacity !== undefined ) ? opacity : 1.0; @@ -55,8 +65,8 @@ CubeTexturePass.prototype = Object.assign( Object.create( Pass.prototype ), { this.cubeCamera.projectionMatrix.copy( this.camera.projectionMatrix ); this.cubeCamera.quaternion.setFromRotationMatrix( this.camera.matrixWorld ); - this.cubeMesh.material.envMap = this.envMap; - this.cubeMesh.material.opacity = this.opacity; + this.cubeMesh.material.uniforms.envMap.value = this.envMap; + this.cubeMesh.material.uniforms.opacity.value = this.opacity; this.cubeMesh.material.transparent = ( this.opacity < 1.0 ); renderer.setRenderTarget( this.renderToScreen ? null : readBuffer );