-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding RenderBundles and Group.static
- Loading branch information
Showing
5 changed files
with
125 additions
and
85 deletions.
There are no files selected for viewing
3 changes: 1 addition & 2 deletions
3
examples/jsm/renderers/RenderBundle.js → ...ples/jsm/renderers/common/RenderBundle.js
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,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