Skip to content

Commit 1cbaaba

Browse files
authored
Incorporate OIT into MeshPipelineKey used by the LineGizmoPipeline (#17946)
# Objective Fixes #17945 ## Solution Check if the view being extracted has OIT enabled and incorporate the associated bit into the mesh pipeline key. I basically have no idea what's going on in the renderer, so let me know if I missed something, which is extraordinarily possible. ## Testing I modified the `order_independent_transparency` example to put everything on the default render layer and render a gizmo at the origin. Previously, this would cause the application to panic.
1 parent bb09751 commit 1cbaaba

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

crates/bevy_gizmos/src/pipeline_3d.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use crate::{
77
use bevy_app::{App, Plugin};
88
use bevy_core_pipeline::{
99
core_3d::{Transparent3d, CORE_3D_DEPTH_FORMAT},
10+
oit::OrderIndependentTransparencySettings,
1011
prepass::{DeferredPrepass, DepthPrepass, MotionVectorPrepass, NormalPrepass},
1112
};
1213

@@ -301,6 +302,7 @@ fn queue_line_gizmos_3d(
301302
Has<DepthPrepass>,
302303
Has<MotionVectorPrepass>,
303304
Has<DeferredPrepass>,
305+
Has<OrderIndependentTransparencySettings>,
304306
),
305307
)>,
306308
) {
@@ -314,7 +316,7 @@ fn queue_line_gizmos_3d(
314316
view,
315317
msaa,
316318
render_layers,
317-
(normal_prepass, depth_prepass, motion_vector_prepass, deferred_prepass),
319+
(normal_prepass, depth_prepass, motion_vector_prepass, deferred_prepass, oit),
318320
) in &views
319321
{
320322
let Some(transparent_phase) = transparent_render_phases.get_mut(&view.retained_view_entity)
@@ -343,6 +345,10 @@ fn queue_line_gizmos_3d(
343345
view_key |= MeshPipelineKey::DEFERRED_PREPASS;
344346
}
345347

348+
if oit {
349+
view_key |= MeshPipelineKey::OIT_ENABLED;
350+
}
351+
346352
for (entity, main_entity, config) in &line_gizmos {
347353
if !config.render_layers.intersects(render_layers) {
348354
continue;

0 commit comments

Comments
 (0)