Skip to content

Make sure prepass notices changes in alpha mode #19170

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

Merged
merged 2 commits into from
May 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion crates/bevy_pbr/src/prepass/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -983,12 +983,18 @@ pub fn specialize_prepass_material_meshes<M>(
AlphaMode::Blend
| AlphaMode::Premultiplied
| AlphaMode::Add
| AlphaMode::Multiply => continue,
| AlphaMode::Multiply => {
// In case this material was previously in a valid alpha_mode, remove it to
// stop the queue system from assuming its retained cache to be valid.
view_specialized_material_pipeline_cache.remove(visible_entity);
continue;
}
}

if material.properties.reads_view_transmission_texture {
// No-op: Materials reading from `ViewTransmissionTexture` are not rendered in the `Opaque3d`
// phase, and are therefore also excluded from the prepass much like alpha-blended materials.
view_specialized_material_pipeline_cache.remove(visible_entity);
continue;
}

Expand Down