2
0
Эх сурвалжийг харах

Revert "WebGLRenderer: Simplify env map rotation. (#27788)" (#27789)

This reverts commit 7f65c011ff3aae8e898abb79b1def31170d278be.
Michael Herzog 1 жил өмнө
parent
commit
7c8cd7a322

+ 4 - 1
src/renderers/webgl/WebGLBackground.js

@@ -111,7 +111,10 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
 
 
 			_e1.copy( scene.backgroundRotation );
 			_e1.copy( scene.backgroundRotation );
 
 
-			if ( ( background.isCubeTexture && background.isRenderTargetTexture === true ) || background.mapping === CubeUVReflectionMapping ) {
+			// accommodate left-handed frame
+			_e1.x *= - 1; _e1.y *= - 1; _e1.z *= - 1;
+
+			if ( background.isCubeTexture && background.isRenderTargetTexture === false ) {
 
 
 				// environment maps which are not cube render targets or PMREMs follow a different convention
 				// environment maps which are not cube render targets or PMREMs follow a different convention
 				_e1.y *= - 1;
 				_e1.y *= - 1;

+ 5 - 2
src/renderers/webgl/WebGLMaterials.js

@@ -1,4 +1,4 @@
-import { BackSide, CubeUVReflectionMapping } from '../../constants.js';
+import { BackSide } from '../../constants.js';
 import { getUnlitUniformColorSpace } from '../shaders/UniformsUtils.js';
 import { getUnlitUniformColorSpace } from '../shaders/UniformsUtils.js';
 import { Euler } from '../../math/Euler.js';
 import { Euler } from '../../math/Euler.js';
 import { Matrix4 } from '../../math/Matrix4.js';
 import { Matrix4 } from '../../math/Matrix4.js';
@@ -225,7 +225,10 @@ function WebGLMaterials( renderer, properties ) {
 
 
 			_e1.copy( envMapRotation );
 			_e1.copy( envMapRotation );
 
 
-			if ( ( envMap.isCubeTexture && envMap.isRenderTargetTexture === true ) || envMap.mapping === CubeUVReflectionMapping ) {
+			// accommodate left-handed frame
+			_e1.x *= - 1; _e1.y *= - 1; _e1.z *= - 1;
+
+			if ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) {
 
 
 				// environment maps which are not cube render targets or PMREMs follow a different convention
 				// environment maps which are not cube render targets or PMREMs follow a different convention
 				_e1.y *= - 1;
 				_e1.y *= - 1;