diff --git a/src/renderers/WebGLRenderer.js b/src/renderers/WebGLRenderer.js index f8349b95e61737..b9417ff672ebf8 100644 --- a/src/renderers/WebGLRenderer.js +++ b/src/renderers/WebGLRenderer.js @@ -52,7 +52,7 @@ import { WebGLUtils } from './webgl/WebGLUtils.js'; import { WebXRManager } from './webxr/WebXRManager.js'; import { WebGLMaterials } from './webgl/WebGLMaterials.js'; import { WebGLUniformsGroups } from './webgl/WebGLUniformsGroups.js'; -import { createCanvasElement, probeAsync, toNormalizedProjectionMatrix, toReversedProjectionMatrix, warnOnce } from '../utils.js'; +import { createCanvasElement, probeAsync, warnOnce } from '../utils.js'; import { ColorManagement } from '../math/ColorManagement.js'; /** @@ -313,7 +313,6 @@ class WebGLRenderer { // camera matrices cache - const _currentProjectionMatrix = new Matrix4(); const _projScreenMatrix = new Matrix4(); const _vector3 = new Vector3(); @@ -2384,22 +2383,13 @@ class WebGLRenderer { if ( reversedDepthBuffer && camera.reversedDepth !== true ) { - // @deprecated, r179 - warnOnce( 'THREE.WebGLRenderer: reversedDepthBuffer must be used with "camera.reversedDepth = true;" for correct results. Automatic conversion will be removed in r189.' ); - - _currentProjectionMatrix.copy( camera.projectionMatrix ); - - toNormalizedProjectionMatrix( _currentProjectionMatrix ); - toReversedProjectionMatrix( _currentProjectionMatrix ); - - p_uniforms.setValue( _gl, 'projectionMatrix', _currentProjectionMatrix ); - - } else { - - p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix ); + camera.reversedDepth = true; + camera.updateProjectionMatrix(); } + p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix ); + p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse ); const uCamPos = p_uniforms.map.cameraPosition;