-
Notifications
You must be signed in to change notification settings - Fork 402
initial pass at sorted-and-binned render phase items #1491
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
initial pass at sorted-and-binned render phase items #1491
Conversation
…ncluding rc non-mesh fixes
60eb963 to
ddb512f
Compare
alice-i-cecile
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM in terms of technical writing and clarity.
alice-i-cecile
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a technical note though, this new file should be in migration-guides, and you need to update the .toml file at the top of that folder to reflect the two removed and one added file :)
|
I don't see any other entries in the toml file with combined/multiple PR urls so I left it as the original PR which introduced the Sorted/Binned. The other two PRs are the resource move and the non-mesh/hanabi fix |
|
I'll take a look at this once I finish the migration guides. (10 more to go!) |
release-content/0.14/migration-guides/12453_13277_14029_sorted_and_binned_render_phase_items.md
Show resolved
Hide resolved
release-content/0.14/migration-guides/12453_13277_14029_sorted_and_binned_render_phase_items.md
Outdated
Show resolved
Hide resolved
release-content/0.14/migration-guides/12453_13277_14029_sorted_and_binned_render_phase_items.md
Outdated
Show resolved
Hide resolved
release-content/0.14/migration-guides/12453_13277_14029_sorted_and_binned_render_phase_items.md
Outdated
Show resolved
Hide resolved
release-content/0.14/migration-guides/12453_13277_14029_sorted_and_binned_render_phase_items.md
Outdated
Show resolved
Hide resolved
release-content/0.14/migration-guides/12453_13277_14029_sorted_and_binned_render_phase_items.md
Outdated
Show resolved
Hide resolved
release-content/0.14/migration-guides/12453_13277_14029_sorted_and_binned_render_phase_items.md
Outdated
Show resolved
Hide resolved
Co-authored-by: BD103 <59022059+BD103@users.noreply.github.com>
Co-authored-by: BD103 <59022059+BD103@users.noreply.github.com>
djeedai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good start, but I'm not sure this is enough to migrate code. The move to resources for example definitely requires seeing a before/after to understand how to transform one's code. Selecting the sorted or binned phase item was also the easy part; it's after to implement the binned one that problems start.
I think we need to explain:
- what's binning? why is it better than sorting and when can you use it or not?
- how do you come up with a bin key?
- how do you query the phase item container from the resource and the camera view entity?
- caveats of using non mesh (there's actually no binning!)
|
|
||
| If you're looking for a quick migration, consider picking [`SortedPhaseItem`](https://docs.rs/bevy/0.14.0-rc.4/bevy/render/render_phase/trait.SortedPhaseItem.html) which requires the fewest code changes. | ||
|
|
||
| If you're looking for higher performance (and your phase doesn’t require sorting) you may want to pick [`BinnedPhaseItem`](https://docs.rs/bevy/0.14.0-rc.4/bevy/render/render_phase/trait.BinnedPhaseItem.html). Notably bins are populated based on `BinKey` and everything in the same bin is potentially batchable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"is potentially batchable" or is actually batched (binned)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"potentially batchable" is the wording used in the original PR, so I deferred to that - bevyengine/bevy#12453
|
|
||
| Examples of [`BinnedPhaseItem`s](https://docs.rs/bevy/0.14.0-rc.4/bevy/render/render_phase/trait.BinnedPhaseItem.html#implementors) include: | ||
|
|
||
| - Opaque3d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link them all maybe? (sorry for the extra work 😅)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could do. I linked Shadow specifically because to someone less familiar it looks out of place next to things that are clearly 2d/3d forward/deferred/prepass related. The full list is already available at the "Examples of" links.
release-content/0.14/migration-guides/12453_13277_14029_sorted_and_binned_render_phase_items.md
Outdated
Show resolved
Hide resolved
release-content/0.14/migration-guides/12453_13277_14029_sorted_and_binned_render_phase_items.md
Show resolved
Hide resolved
release-content/0.14/migration-guides/12453_13277_14029_sorted_and_binned_render_phase_items.md
Outdated
Show resolved
Hide resolved
|
I'm going to merge this as is to avoid unduly burdening @ChristopherBiscardi, whose help I really appreciate here. I agree that these are important things to explain @djeedai, but IMO these point to a failing of the underlying documentation, and don't belong in a migration guide. |
|
Looks like the name of the file doesn't match somehow; see the failed CI. I'll take a look later unless someone beats me to it. |
Head branch was pushed to by a user without write access
|
@alice-i-cecile merging the main branch into this branch caused the previously-removed file to be re-inserted into the toml file. I re-removed it |
|
Thanks! |
|
also @djeedai fwiw the length and content of this was informed by the length and content of other migration guides. I agree with @alice-i-cecile and do consider the new binned functionality to not just be a migration (migration would be to sorted, which is where "the previous functionality lives") but also an adoption of new functionality, thus I would expect implementing binning to require reading binning docs which should explain how to implement it (which they do not today imo, similar to most lower level rendering unfortunately). The new custom_phase_item example does show the larger context and is linked in the migration so I leaned on that existing for people who need larger context around an example. The example does show how to get view entities, etc. |
and resources, including rc non-mesh fixes.
fixes #1386
I picked URLs that would work today so review could be made, assuming they'd need to be changed either before or after merging.