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 Hardware Clipping issues #1444

Merged
merged 4 commits into from
Dec 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src-testing/changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5502,7 +5502,7 @@ index 0ec34b04..573cae2b 100644

this.vertexProgram = vertexProgram;
diff --git a/src-testing/src/renderers/common/Renderer.ts b/src-testing/src/renderers/common/Renderer.ts
index bfb2ca00..43523339 100644
index 19153b35..b8930541 100644
--- a/src-testing/src/renderers/common/Renderer.ts
+++ b/src-testing/src/renderers/common/Renderer.ts
@@ -36,7 +36,34 @@ import {
Expand Down Expand Up @@ -6587,22 +6587,23 @@ index bfb2ca00..43523339 100644

//

@@ -1508,33 +1776,41 @@ class Renderer {
@@ -1508,17 +1776,26 @@ class Renderer {

this.backend.draw(renderObject, this.info);

- if (needsRefresh) this._nodes.updateAfter(renderObject);
+ if (needsRefresh) this._nodes!.updateAfter(renderObject);
}

- _createObjectPipeline(object, material, scene, camera, lightsNode, clippingContext, passId) {
- _createObjectPipeline(object, material, scene, camera, lightsNode, group, clippingContext, passId) {
- const renderObject = this._objects.get(
+ _createObjectPipeline(
+ object: Object3D,
+ material: Material,
+ scene: Scene,
+ camera: Camera,
+ lightsNode: LightsNode,
+ group: Group,
+ clippingContext: ClippingContext | null,
+ passId?: string,
+ ) {
Expand All @@ -6617,6 +6618,7 @@ index bfb2ca00..43523339 100644
clippingContext,
passId,
);
@@ -1527,16 +1804,16 @@ class Renderer {

//

Expand Down Expand Up @@ -8291,10 +8293,10 @@ index 9de87c2f..77fb975a 100644
const nodeData = this.getDataFromNode(node, shaderStage, this.globalCache);

diff --git a/src-testing/src/renderers/webgpu/WebGPUBackend.ts b/src-testing/src/renderers/webgpu/WebGPUBackend.ts
index 3864bb3a..ee443930 100644
index 8c191373..b960fd6c 100644
--- a/src-testing/src/renderers/webgpu/WebGPUBackend.ts
+++ b/src-testing/src/renderers/webgpu/WebGPUBackend.ts
@@ -984,7 +984,7 @@ class WebGPUBackend extends Backend {
@@ -992,7 +992,7 @@ class WebGPUBackend extends Backend {
this.textureUtils.destroyTexture(texture);
}

Expand Down
2 changes: 2 additions & 0 deletions types/three/src/renderers/common/Renderer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Vector4 } from "../../math/Vector4.js";
import MRTNode from "../../nodes/core/MRTNode.js";
import ComputeNode from "../../nodes/gpgpu/ComputeNode.js";
import LightsNode from "../../nodes/lighting/LightsNode.js";
import { Group } from "../../objects/Group.js";
import { Scene } from "../../scenes/Scene.js";
import { FramebufferTexture } from "../../textures/FramebufferTexture.js";
import { Texture } from "../../textures/Texture.js";
Expand Down Expand Up @@ -325,6 +326,7 @@ declare class Renderer {
scene: Scene,
camera: Camera,
lightsNode: LightsNode,
group: Group,
clippingContext: ClippingContext | null,
passId?: string,
): void;
Expand Down
Loading