|
@@ -5,7 +5,8 @@ import {
|
|
PerspectiveCamera,
|
|
PerspectiveCamera,
|
|
Scene,
|
|
Scene,
|
|
ShaderLib,
|
|
ShaderLib,
|
|
- ShaderMaterial
|
|
|
|
|
|
+ ShaderMaterial,
|
|
|
|
+ UniformsUtils
|
|
} from '../../../build/three.module.js';
|
|
} from '../../../build/three.module.js';
|
|
import { Pass } from '../postprocessing/Pass.js';
|
|
import { Pass } from '../postprocessing/Pass.js';
|
|
|
|
|
|
@@ -21,7 +22,7 @@ var CubeTexturePass = function ( camera, envMap, opacity ) {
|
|
this.cubeMesh = new Mesh(
|
|
this.cubeMesh = new Mesh(
|
|
new BoxGeometry( 10, 10, 10 ),
|
|
new BoxGeometry( 10, 10, 10 ),
|
|
new ShaderMaterial( {
|
|
new ShaderMaterial( {
|
|
- uniforms: this.cubeShader.uniforms,
|
|
|
|
|
|
+ uniforms: UniformsUtils.clone( this.cubeShader.uniforms ),
|
|
vertexShader: this.cubeShader.vertexShader,
|
|
vertexShader: this.cubeShader.vertexShader,
|
|
fragmentShader: this.cubeShader.fragmentShader,
|
|
fragmentShader: this.cubeShader.fragmentShader,
|
|
depthTest: false,
|
|
depthTest: false,
|
|
@@ -62,6 +63,7 @@ CubeTexturePass.prototype = Object.assign( Object.create( Pass.prototype ), {
|
|
this.cubeCamera.quaternion.setFromRotationMatrix( this.camera.matrixWorld );
|
|
this.cubeCamera.quaternion.setFromRotationMatrix( this.camera.matrixWorld );
|
|
|
|
|
|
this.cubeMesh.material.uniforms.envMap.value = this.envMap;
|
|
this.cubeMesh.material.uniforms.envMap.value = this.envMap;
|
|
|
|
+ this.cubeMesh.material.uniforms.flipEnvMap.value = ( this.envMap.isCubeTexture && this.envMap._needsFlipEnvMap ) ? - 1 : 1;
|
|
this.cubeMesh.material.uniforms.opacity.value = this.opacity;
|
|
this.cubeMesh.material.uniforms.opacity.value = this.opacity;
|
|
this.cubeMesh.material.transparent = ( this.opacity < 1.0 );
|
|
this.cubeMesh.material.transparent = ( this.opacity < 1.0 );
|
|
|
|
|