-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
WebGLRenderLists: Use stack approach. #21254
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -174,24 +174,26 @@ function WebGLRenderLists( properties ) { | |
|
|
||
| let lists = new WeakMap(); | ||
|
|
||
| function get( scene, camera ) { | ||
| function get( scene, renderCallDepth ) { | ||
|
|
||
| const cameras = lists.get( scene ); | ||
| let list; | ||
|
|
||
| if ( cameras === undefined ) { | ||
| if ( lists.has( scene ) === false ) { | ||
|
|
||
| list = new WebGLRenderList( properties ); | ||
| lists.set( scene, new WeakMap() ); | ||
| lists.get( scene ).set( camera, list ); | ||
| lists.set( scene, [] ); | ||
| lists.get( scene ).push( list ); | ||
|
Comment on lines
+184
to
+185
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think these two lines can be simplified to this? lists.set( scene, [ list ] );
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll change it on my end.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same change can be applied in
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, you were faster than my comment 😅 af07e8a |
||
|
|
||
| } else { | ||
|
|
||
| list = cameras.get( camera ); | ||
| if ( list === undefined ) { | ||
| if ( renderCallDepth >= lists.get( scene ).length ) { | ||
|
|
||
| list = new WebGLRenderList( properties ); | ||
| cameras.set( camera, list ); | ||
| lists.get( scene ).push( list ); | ||
|
|
||
| } else { | ||
|
|
||
| list = lists.get( scene )[ renderCallDepth ]; | ||
|
|
||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.