瀏覽代碼

update flipEnvMap setting

06wj 6 年之前
父節點
當前提交
5bbe295d55
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      examples/js/loaders/GLTFLoader.js
  2. 1 1
      src/renderers/WebGLRenderer.js

+ 1 - 1
examples/js/loaders/GLTFLoader.js

@@ -957,7 +957,7 @@ THREE.GLTFLoader = ( function () {
 					//  WebGLRenderTargetCube will be flipped for backwards compatibility
 					//  WebGLRenderTargetCube.texture will be flipped because it's a Texture and NOT a CubeTexture
 					// this check must be handled differently, or removed entirely, if WebGLRenderTargetCube uses a CubeTexture in the future
-					uniforms.flipEnvMap.value = ( ! ( material.envMap && material.envMap.isCubeTexture ) ) ? 1 : - 1;
+					uniforms.flipEnvMap.value = material.envMap.isCubeTexture ? - 1 : 1;
 
 					uniforms.reflectivity.value = material.reflectivity;
 					uniforms.refractionRatio.value = material.refractionRatio;

+ 1 - 1
src/renderers/WebGLRenderer.js

@@ -1937,7 +1937,7 @@ function WebGLRenderer( parameters ) {
 			//  WebGLRenderTargetCube will be flipped for backwards compatibility
 			//  WebGLRenderTargetCube.texture will be flipped because it's a Texture and NOT a CubeTexture
 			// this check must be handled differently, or removed entirely, if WebGLRenderTargetCube uses a CubeTexture in the future
-			uniforms.flipEnvMap.value = ( ! ( material.envMap && material.envMap.isCubeTexture ) ) ? 1 : - 1;
+			uniforms.flipEnvMap.value = material.envMap.isCubeTexture ? - 1 : 1;
 
 			uniforms.reflectivity.value = material.reflectivity;
 			uniforms.refractionRatio.value = material.refractionRatio;