소스 검색

WebGPURenderer: Fix `BachedMesh` coordinate system in case of `WebGLBackend` (#27567)

sunag 1 년 전
부모
커밋
0b91656c4f
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 0
      examples/jsm/renderers/webgpu/WebGPUBackend.js
  2. 1 3
      src/objects/BatchedMesh.js

+ 2 - 0
examples/jsm/renderers/webgpu/WebGPUBackend.js

@@ -2,6 +2,8 @@
 import 'https://greggman.github.io/webgpu-avoid-redundant-state-setting/webgpu-check-redundant-state-setting.js';
 //*/
 
+import { WebGPUCoordinateSystem } from 'three';
+
 import { GPUFeatureName, GPUTextureFormat, GPULoadOp, GPUStoreOp, GPUIndexFormat, GPUTextureViewDimension } from './utils/WebGPUConstants.js';
 
 import WGSLNodeBuilder from './nodes/WGSLNodeBuilder.js';

+ 1 - 3
src/objects/BatchedMesh.js

@@ -8,8 +8,6 @@ import { RGBAFormat } from '../constants.js';
 import { Box3 } from '../math/Box3.js';
 import { Sphere } from '../math/Sphere.js';
 import { Frustum } from '../math/Frustum.js';
-import { WebGLCoordinateSystem } from '../constants.js';
-import { WebGPUCoordinateSystem } from '../constants.js';
 import { Vector3 } from '../math/Vector3.js';
 
 function sortOpaque( a, b ) {
@@ -909,7 +907,7 @@ class BatchedMesh extends Mesh {
 				.multiply( this.matrixWorld );
 			_frustum.setFromProjectionMatrix(
 				_projScreenMatrix,
-				renderer.isWebGPURenderer ? WebGPUCoordinateSystem : WebGLCoordinateSystem
+				renderer.coordinateSystem
 			);
 
 		}