-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebGPURenderer: RenderBundle (#28347)
* wip * add demo * add gpu metrics * fix bundeType condition * cleanup * refactor and cleanup * support postprocess and multisample * update * cache and pbr on bundle example * wip static mode * update * update * revert shared * ci * circular dep * move the logic to the renderContext * add screenshot for ci * cleanup * new RenderBundle API * TODO: Need to handle FBO too * cleanup * more cleanup * fix deepscan * fix framebuffer * update example * update scene too * reuse correct scene for update matrices * introduce renderBundle.needsUpdate and rename to private _renderBundle() * cleanup * improve example * fix capsule constructor * remove confusing gui in example * Adding RenderBundles and Group.static --------- Co-authored-by: sunag <[email protected]>
- Loading branch information
1 parent
2f55b35
commit 82b78e7
Showing
10 changed files
with
603 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class RenderBundle { | ||
|
||
constructor( scene, camera ) { | ||
|
||
this.scene = scene; | ||
this.camera = camera; | ||
|
||
} | ||
|
||
clone() { | ||
|
||
return Object.assign( new this.constructor(), this ); | ||
|
||
} | ||
|
||
} | ||
|
||
export default RenderBundle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import ChainMap from './ChainMap.js'; | ||
import RenderBundle from './RenderBundle.js'; | ||
|
||
class RenderBundles { | ||
|
||
constructor() { | ||
|
||
this.lists = new ChainMap(); | ||
|
||
} | ||
|
||
get( scene, camera ) { | ||
|
||
const lists = this.lists; | ||
const keys = [ scene, camera ]; | ||
|
||
let list = lists.get( keys ); | ||
|
||
if ( list === undefined ) { | ||
|
||
list = new RenderBundle( scene, camera ); | ||
lists.set( keys, list ); | ||
|
||
} | ||
|
||
return list; | ||
|
||
} | ||
|
||
dispose() { | ||
|
||
this.lists = new ChainMap(); | ||
|
||
} | ||
|
||
} | ||
|
||
export default RenderBundles; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.