Skip to content

Commit

Permalink
Revert "WebGLRenderer: Simplify env map rotation. (#27788)" (#27789)
Browse files Browse the repository at this point in the history
This reverts commit 7f65c01.
  • Loading branch information
Mugen87 committed Feb 21, 2024
1 parent b43d4ee commit 7c8cd7a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/renderers/webgl/WebGLBackground.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,

_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
_e1.y *= - 1;
Expand Down
7 changes: 5 additions & 2 deletions src/renderers/webgl/WebGLMaterials.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BackSide, CubeUVReflectionMapping } from '../../constants.js';
import { BackSide } from '../../constants.js';
import { getUnlitUniformColorSpace } from '../shaders/UniformsUtils.js';
import { Euler } from '../../math/Euler.js';
import { Matrix4 } from '../../math/Matrix4.js';
Expand Down Expand Up @@ -225,7 +225,10 @@ function WebGLMaterials( renderer, properties ) {

_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
_e1.y *= - 1;
Expand Down

0 comments on commit 7c8cd7a

Please sign in to comment.