Skip to content

Commit 923bdd2

Browse files
committed
Revert "wip 3d"
This reverts commit 4b2b826.
1 parent ee04648 commit 923bdd2

File tree

7 files changed

+53
-399
lines changed

7 files changed

+53
-399
lines changed

crates/bevy_gizmos/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,3 @@ bevy_utils = { path = "../bevy_utils", version = "0.9.0" }
2121
bevy_core = { path = "../bevy_core", version = "0.9.0" }
2222
bevy_reflect = { path = "../bevy_reflect", version = "0.9.0" }
2323
bevy_core_pipeline = { path = "../bevy_core_pipeline", version = "0.9.0" }
24-
25-
radsort = "0.1"

crates/bevy_gizmos/src/lib.rs

Lines changed: 10 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use std::mem;
22

33
use bevy_app::{CoreSet, IntoSystemAppConfig, Plugin};
44
use bevy_asset::{load_internal_asset, Assets, Handle, HandleUntyped};
5-
use bevy_core_pipeline::{core_2d, core_3d};
65
use bevy_ecs::{
76
prelude::{Component, DetectChanges},
87
schedule::IntoSystemConfig,
@@ -13,8 +12,7 @@ use bevy_math::Mat4;
1312
use bevy_reflect::TypeUuid;
1413
use bevy_render::{
1514
mesh::Mesh,
16-
render_graph::RenderGraph,
17-
render_phase::{sort_phase_system, AddRenderCommand, DrawFunctions},
15+
render_phase::AddRenderCommand,
1816
render_resource::{PrimitiveTopology, Shader, SpecializedMeshPipelines},
1917
Extract, ExtractSchedule, RenderApp, RenderSet,
2018
};
@@ -26,15 +24,12 @@ use bevy_sprite::{Mesh2dHandle, Mesh2dUniform};
2624

2725
pub mod gizmos;
2826

29-
mod node_2d;
30-
mod node_3d;
31-
3227
#[cfg(feature = "bevy_sprite")]
3328
mod pipeline_2d;
3429
#[cfg(feature = "bevy_pbr")]
3530
mod pipeline_3d;
3631

37-
use crate::{gizmos::GizmoStorage, node_2d::GizmoNode2d, node_3d::GizmoNode3d};
32+
use crate::gizmos::GizmoStorage;
3833

3934
/// The `bevy_gizmos` prelude.
4035
pub mod prelude {
@@ -62,64 +57,26 @@ impl Plugin for GizmoPlugin {
6257

6358
#[cfg(feature = "bevy_sprite")]
6459
{
60+
use bevy_core_pipeline::core_2d::Transparent2d;
6561
use pipeline_2d::*;
6662

6763
render_app
68-
.init_resource::<GizmoPipeline2d>()
69-
.init_resource::<SpecializedMeshPipelines<GizmoPipeline2d>>()
70-
.init_resource::<DrawFunctions<GizmoLine2d>>()
71-
.add_render_command::<GizmoLine2d, DrawGizmoLines>()
72-
.add_system(sort_phase_system::<GizmoLine2d>)
73-
.add_system_to_schedule(ExtractSchedule, extract_gizmo_line_2d_camera_phase)
64+
.add_render_command::<Transparent2d, DrawGizmoLines>()
65+
.init_resource::<GizmoLinePipeline>()
66+
.init_resource::<SpecializedMeshPipelines<GizmoLinePipeline>>()
7467
.add_system(queue_gizmos_2d.in_set(RenderSet::Queue));
75-
76-
let gizmo_node = GizmoNode2d::new(&mut render_app.world);
77-
let mut binding = render_app.world.resource_mut::<RenderGraph>();
78-
let graph = binding.get_sub_graph_mut(core_2d::graph::NAME).unwrap();
79-
80-
graph.add_node(GizmoNode2d::NAME, gizmo_node);
81-
graph.add_slot_edge(
82-
graph.input_node().id,
83-
core_2d::graph::input::VIEW_ENTITY,
84-
GizmoNode2d::NAME,
85-
GizmoNode2d::IN_VIEW,
86-
);
87-
graph.add_node_edge(
88-
core_2d::graph::node::END_MAIN_PASS_POST_PROCESSING,
89-
GizmoNode2d::NAME,
90-
);
91-
graph.add_node_edge(GizmoNode2d::NAME, core_2d::graph::node::UPSCALING);
9268
}
9369

9470
#[cfg(feature = "bevy_pbr")]
9571
{
72+
use bevy_core_pipeline::core_3d::Opaque3d;
9673
use pipeline_3d::*;
9774

9875
render_app
99-
.init_resource::<GizmoPipeline3d>()
100-
.init_resource::<SpecializedMeshPipelines<GizmoPipeline3d>>()
101-
.init_resource::<DrawFunctions<GizmoLine3d>>()
102-
.add_render_command::<GizmoLine3d, DrawGizmoLines>()
103-
.add_system(sort_phase_system::<GizmoLine3d>)
104-
.add_system_to_schedule(ExtractSchedule, extract_gizmo_line_3d_camera_phase)
76+
.add_render_command::<Opaque3d, DrawGizmoLines>()
77+
.init_resource::<GizmoPipeline>()
78+
.init_resource::<SpecializedMeshPipelines<GizmoPipeline>>()
10579
.add_system(queue_gizmos_3d.in_set(RenderSet::Queue));
106-
107-
let gizmo_node = GizmoNode3d::new(&mut render_app.world);
108-
let mut binding = render_app.world.resource_mut::<RenderGraph>();
109-
let graph = binding.get_sub_graph_mut(core_3d::graph::NAME).unwrap();
110-
111-
graph.add_node(GizmoNode3d::NAME, gizmo_node);
112-
graph.add_slot_edge(
113-
graph.input_node().id,
114-
core_3d::graph::input::VIEW_ENTITY,
115-
GizmoNode3d::NAME,
116-
GizmoNode3d::IN_VIEW,
117-
);
118-
graph.add_node_edge(
119-
core_3d::graph::node::END_MAIN_PASS_POST_PROCESSING,
120-
GizmoNode3d::NAME,
121-
);
122-
graph.add_node_edge(GizmoNode3d::NAME, core_3d::graph::node::UPSCALING);
12380
}
12481
}
12582
}

crates/bevy_gizmos/src/node_2d.rs

Lines changed: 0 additions & 67 deletions
This file was deleted.

crates/bevy_gizmos/src/node_3d.rs

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)