Skip to content

Commit e799625

Browse files
authored
Add binned 2d/3d Wireframe render phase (#18587)
# Objective Fixes #16896 Fixes #17737 ## Solution Adds a new render phase, including all the new cold specialization patterns, for wireframes. There's a *lot* of regrettable duplication here between 3d/2d. ## Testing All the examples. ## Migration Guide - `WireframePlugin` must now be created with `WireframePlugin::default()`.
1 parent 6c61939 commit e799625

File tree

10 files changed

+1473
-175
lines changed

10 files changed

+1473
-175
lines changed

crates/bevy_core_pipeline/src/core_2d/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub mod graph {
1919
MainOpaquePass,
2020
MainTransparentPass,
2121
EndMainPass,
22+
Wireframe,
2223
Bloom,
2324
PostProcessing,
2425
Tonemapping,

crates/bevy_core_pipeline/src/core_3d/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pub mod graph {
2828
MainTransmissivePass,
2929
MainTransparentPass,
3030
EndMainPass,
31+
Wireframe,
3132
LateDownsampleDepth,
3233
Taa,
3334
MotionBlur,
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#import bevy_pbr::forward_io::VertexOutput
22

3-
struct WireframeMaterial {
4-
color: vec4<f32>,
5-
};
3+
struct PushConstants {
4+
color: vec4<f32>
5+
}
6+
7+
var<push_constant> push_constants: PushConstants;
68

7-
@group(2) @binding(0)
8-
var<uniform> material: WireframeMaterial;
99
@fragment
1010
fn fragment(in: VertexOutput) -> @location(0) vec4<f32> {
11-
return material.color;
11+
return push_constants.color;
1212
}

0 commit comments

Comments
 (0)