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

allow DeferredPrepass to work without other prepass markers #10223

Merged
merged 3 commits into from
Nov 3, 2023
Merged
Changes from 1 commit
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
26 changes: 13 additions & 13 deletions crates/bevy_core_pipeline/src/core_3d/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,10 @@ pub fn extract_camera_prepass_phase(
(
Entity,
&Camera,
Option<&DepthPrepass>,
Option<&NormalPrepass>,
Option<&MotionVectorPrepass>,
Option<&DeferredPrepass>,
Has<DepthPrepass>,
Has<NormalPrepass>,
Has<MotionVectorPrepass>,
Has<DeferredPrepass>,
),
With<Camera3d>,
>,
Expand All @@ -381,33 +381,33 @@ pub fn extract_camera_prepass_phase(
if camera.is_active {
let mut entity = commands.get_or_spawn(entity);

if depth_prepass.is_some()
|| normal_prepass.is_some()
|| motion_vector_prepass.is_some()
{
// deferred requires depth
let depth_prepass = depth_prepass || deferred_prepass;

if depth_prepass || normal_prepass || motion_vector_prepass {
entity.insert((
RenderPhase::<Opaque3dPrepass>::default(),
RenderPhase::<AlphaMask3dPrepass>::default(),
));
}

if deferred_prepass.is_some() {
if deferred_prepass {
entity.insert((
RenderPhase::<Opaque3dDeferred>::default(),
RenderPhase::<AlphaMask3dDeferred>::default(),
));
}

if depth_prepass.is_some() {
if depth_prepass {
entity.insert(DepthPrepass);
}
if normal_prepass.is_some() {
if normal_prepass {
entity.insert(NormalPrepass);
}
if motion_vector_prepass.is_some() {
if motion_vector_prepass {
entity.insert(MotionVectorPrepass);
}
if deferred_prepass.is_some() {
if deferred_prepass {
entity.insert(DeferredPrepass);
}
}
Expand Down