Incorporate OIT into MeshPipelineKey used by the LineGizmoPipeline (#17946)
Fixes #17945 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. 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.
This commit is contained in:
parent
8628545122
commit
6f8e403702
@ -7,6 +7,7 @@ use crate::{
|
||||
use bevy_app::{App, Plugin};
|
||||
use bevy_core_pipeline::{
|
||||
core_3d::{Transparent3d, CORE_3D_DEPTH_FORMAT},
|
||||
oit::OrderIndependentTransparencySettings,
|
||||
prepass::{DeferredPrepass, DepthPrepass, MotionVectorPrepass, NormalPrepass},
|
||||
};
|
||||
|
||||
@ -294,6 +295,7 @@ fn queue_line_gizmos_3d(
|
||||
Has<DepthPrepass>,
|
||||
Has<MotionVectorPrepass>,
|
||||
Has<DeferredPrepass>,
|
||||
Has<OrderIndependentTransparencySettings>,
|
||||
),
|
||||
)>,
|
||||
) {
|
||||
@ -304,7 +306,7 @@ fn queue_line_gizmos_3d(
|
||||
view,
|
||||
msaa,
|
||||
render_layers,
|
||||
(normal_prepass, depth_prepass, motion_vector_prepass, deferred_prepass),
|
||||
(normal_prepass, depth_prepass, motion_vector_prepass, deferred_prepass, oit),
|
||||
) in &mut views
|
||||
{
|
||||
let Some(transparent_phase) = transparent_render_phases.get_mut(&view_entity) else {
|
||||
@ -332,6 +334,10 @@ fn queue_line_gizmos_3d(
|
||||
view_key |= MeshPipelineKey::DEFERRED_PREPASS;
|
||||
}
|
||||
|
||||
if oit {
|
||||
view_key |= MeshPipelineKey::OIT_ENABLED;
|
||||
}
|
||||
|
||||
for (entity, main_entity, config) in &line_gizmos {
|
||||
if !config.render_layers.intersects(render_layers) {
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user