Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/jsm/renderers/webgpu/WebGPUBackend.js
Expand Up @@ -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';
Expand Down
4 changes: 1 addition & 3 deletions src/objects/BatchedMesh.js
Expand Up @@ -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 ) {
Expand Down Expand Up @@ -909,7 +907,7 @@ class BatchedMesh extends Mesh {
.multiply( this.matrixWorld );
_frustum.setFromProjectionMatrix(
_projScreenMatrix,
renderer.isWebGPURenderer ? WebGPUCoordinateSystem : WebGLCoordinateSystem
renderer.coordinateSystem
);

}
Expand Down