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

Use built RenderBundle and RenderBundles #990

Merged
merged 4 commits into from
May 26, 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
11 changes: 9 additions & 2 deletions examples-jsm/changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1815,10 +1815,10 @@ index a684e444..6b643625 100644
this.id = _id++;

diff --git a/examples-jsm/examples/renderers/common/RenderBundle.ts b/examples-jsm/examples/renderers/common/RenderBundle.ts
index e59e4937..c7ba8cd4 100644
index e59e4937..95b0518a 100644
--- a/examples-jsm/examples/renderers/common/RenderBundle.ts
+++ b/examples-jsm/examples/renderers/common/RenderBundle.ts
@@ -1,5 +1,10 @@
@@ -1,11 +1,16 @@
+import { Camera, Object3D } from 'three';
+
class RenderBundle {
Expand All @@ -1830,6 +1830,13 @@ index e59e4937..c7ba8cd4 100644
this.scene = scene;
this.camera = camera;
}

clone() {
- return Object.assign(new this.constructor(), this);
+ return Object.assign(new (this.constructor as { new (): RenderBundle })(), this);
}
}

diff --git a/examples-jsm/examples/renderers/common/RenderBundles.ts b/examples-jsm/examples/renderers/common/RenderBundles.ts
index 29140365..48f5d598 100644
--- a/examples-jsm/examples/renderers/common/RenderBundles.ts
Expand Down
2 changes: 2 additions & 0 deletions examples-jsm/declarations.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const files = [
'renderers/common/DataMap',
'renderers/common/Info',
'renderers/common/RenderContexts',
'renderers/common/RenderBundle',
'renderers/common/RenderBundles',
'renderers/common/RenderList',
'renderers/common/RenderLists',
'renderers/common/Textures',
Expand Down
8 changes: 8 additions & 0 deletions types/three/examples/jsm/renderers/common/RenderBundle.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Camera, Object3D } from "three";
declare class RenderBundle {
scene: Object3D;
camera: Camera;
constructor(scene: Object3D, camera: Camera);
clone(): RenderBundle & this;
}
export default RenderBundle;
10 changes: 10 additions & 0 deletions types/three/examples/jsm/renderers/common/RenderBundles.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Camera, Object3D } from "three";
import ChainMap from "./ChainMap.js";
import RenderBundle from "./RenderBundle.js";
declare class RenderBundles {
lists: ChainMap<readonly [Object3D, Camera], RenderBundle>;
constructor();
get(scene: Object3D, camera: Camera): RenderBundle;
dispose(): void;
}
export default RenderBundles;
Loading