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 a custom phase instead of the main_opaque_3d phase. #1

Open
wants to merge 6 commits into
base: bevy-0.13
Choose a base branch
from

Conversation

Elabajaba
Copy link

@Elabajaba Elabajaba commented Apr 9, 2024

I wasn't sure if it was possible to get vertex pulling working with bevy's 0.13's Opaque3d pass, so I just re-implements bevy's old (0.12) Opaque3d phase as a custom render pass (called AabbOpaque3d) that's ordered before bevy's new Opaque3d pass. Performance wise I'd expect this to be very slightly slower since it's running 1 additional pass, and there'll be some overdraw over the AABBs if you're mixing regular bevy draws with AABBs (though since the AABB pass is before the Opaque3d you'll avoid overdraw where an Opaque3d objects is behind an AABB object).

I also fixed the bloom example.

edit: The bloom example may need its values cranked up or exposure change, I haven't compared it to what it looked like previously but bevy's lighting tends to require much higher values in 0.13.

fn sort(items: &mut [Self]) {
// Key negated to match reversed SortKey ordering
items.sort_by_key(|item| item.sort_key());
// radsort::sort_by_key(items, |item| -item.distance);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Iirc radsort is faster for this (it's what bevy used before), and bevy already depends on it, but it isn't re-exported. Probably fine to just add it as a crate level dependency if adding a new pipeline is the right way forward.

@Elabajaba
Copy link
Author

I'll pull the toggle fps controller in the examples changes out and resubmit them as a pr upstream. It was just annoying me when I was checking that this worked properly when mixed with regular opaque draws.

I think everything else is required to get this running though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant