|
@@ -1,4 +1,6 @@
|
|
|
import {
|
|
|
+ CubeReflectionMapping,
|
|
|
+ CubeRefractionMapping,
|
|
|
CubeUVReflectionMapping,
|
|
|
GammaEncoding,
|
|
|
LinearEncoding,
|
|
@@ -364,7 +366,9 @@ class PMREMGenerator {
|
|
|
|
|
|
const renderer = this._renderer;
|
|
|
|
|
|
- if ( texture.isCubeTexture ) {
|
|
|
+ const isCubeTexture = ( texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping );
|
|
|
+
|
|
|
+ if ( isCubeTexture ) {
|
|
|
|
|
|
if ( this._cubemapShader == null ) {
|
|
|
|
|
@@ -382,14 +386,14 @@ class PMREMGenerator {
|
|
|
|
|
|
}
|
|
|
|
|
|
- const material = texture.isCubeTexture ? this._cubemapShader : this._equirectShader;
|
|
|
+ const material = isCubeTexture ? this._cubemapShader : this._equirectShader;
|
|
|
const mesh = new Mesh( _lodPlanes[ 0 ], material );
|
|
|
|
|
|
const uniforms = material.uniforms;
|
|
|
|
|
|
uniforms[ 'envMap' ].value = texture;
|
|
|
|
|
|
- if ( ! texture.isCubeTexture ) {
|
|
|
+ if ( ! isCubeTexture ) {
|
|
|
|
|
|
uniforms[ 'texelSize' ].value.set( 1.0 / texture.image.width, 1.0 / texture.image.height );
|
|
|
|