-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,833 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#import bevy_pbr::mesh_types | ||
#import bevy_pbr::mesh_view_bindings | ||
#import bevy_pbr::utils | ||
|
||
@group(1) @binding(0) | ||
var<uniform> show_depth: f32; | ||
@group(1) @binding(1) | ||
var<uniform> show_normal: f32; | ||
|
||
@fragment | ||
fn fragment( | ||
@builtin(position) frag_coord: vec4<f32>, | ||
@builtin(sample_index) sample_index: u32, | ||
#import bevy_pbr::mesh_vertex_output | ||
) -> @location(0) vec4<f32> { | ||
if show_depth == 1.0 { | ||
let depth = prepass_depth(frag_coord, sample_index); | ||
return vec4(depth, depth, depth, 1.0); | ||
} else if show_normal == 1.0 { | ||
let normal = prepass_normal(frag_coord, sample_index); | ||
return vec4(normal, 1.0); | ||
} else { | ||
// transparent | ||
return vec4(0.0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.