-
-
Notifications
You must be signed in to change notification settings - Fork 4k
[Merged by Bors] - Add depth and normal prepass #6284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
111 commits
Select commit
Hold shift + click to select a range
d2af71e
robswain depth prepass
IceSentry 0ecce68
robtfm depth prepass
IceSentry 8458d1f
fix update to main
IceSentry e6bd4a2
show_depth example
IceSentry 3327950
custom prepass shaders per material
IceSentry 9754bae
reorder some stuff
IceSentry 48c16e4
Prepass naming/doc cleanup
JMS55 1e7cb75
Remove PrepassSettings from example/3d_scene.rs
JMS55 06fa29e
Add PrepassPlugin within MaterialPlugin
JMS55 c0d528a
Misc fixes
JMS55 0b9f67b
Merge pull request #1 from JMS55/depth-prepass
IceSentry 793352e
prepass wip
IceSentry 40591ab
Merge branch 'main' into depth-prepass
IceSentry a3f2121
fix merge
IceSentry 6c60290
simplify configuration
IceSentry 5e9de81
yeet match bool
IceSentry 4a3be2d
extract prepass node
IceSentry c619e94
rename phases
IceSentry 8763721
fix targets for alpha mask only
IceSentry f26c4f7
rename some things
IceSentry a64cb56
remove unnecessary comment
IceSentry 98da061
pr fixes
IceSentry 8112944
Merge branch 'main' into depth-prepass
IceSentry d637d5b
Update crates/bevy_core_pipeline/src/prepass/node.rs
IceSentry 745586d
Update crates/bevy_pbr/src/render/prepass.rs
IceSentry c584835
Apply suggestions from code review
IceSentry 3a10291
Merge branch 'main' into depth-prepass
IceSentry 0b43b35
use match to unwrap textures
IceSentry d312da4
fix plugin
IceSentry b3e2415
fmt
IceSentry 9a5511e
update normal mapping
IceSentry 94c5ac3
more warn
IceSentry b6efa0e
depth format
IceSentry 3de2d75
Merge branch 'main' into depth-prepass
IceSentry a238ca7
Merge branch 'main' into depth-prepass
IceSentry 1ffe9b4
Merge branch 'main' into depth-prepass
IceSentry 47b41d6
simplify code related to texture cache
IceSentry 1f776b3
reduce nesting a bit with let else
IceSentry f5bf3f8
Apply suggestions from code review
IceSentry 1754e29
docs and minor renames
IceSentry a40b3bd
docs
IceSentry 400bb5f
create new layout_entries
IceSentry a0d722a
docs
IceSentry 4426530
fix docs ci
IceSentry 24080de
update normal prepass
IceSentry e41ca17
Merge branch 'main' into depth-prepass
IceSentry 7d3effd
remove unwraps
IceSentry 8dc5bac
fix shader_defs
IceSentry f31a04d
clean up
IceSentry 6dd5272
Merge branch 'main' into depth-prepass
IceSentry c2f1698
Apply suggestions from code review
IceSentry cc419af
Merge remote-tracking branch 'origin/depth-prepass' into depth-prepass
IceSentry 7c5a5eb
docs
IceSentry 9be7e5e
Merge branch 'main' into depth-prepass
IceSentry d077237
address pr comments
IceSentry ef4b3e9
Merge branch 'main' into depth-prepass
IceSentry 314dea0
docs
IceSentry 4ebf55c
Merge branch 'main' into depth-prepass
IceSentry 433605d
use separate prepass components
IceSentry 722b580
fix ci
IceSentry 1e5fb5a
derive default and don't run when not present
IceSentry 324eecf
Merge branch 'main' into depth-prepass
IceSentry e20e15f
use depth buffer if present
IceSentry 7b2fbbc
enable prepass by default
IceSentry 005dcb8
extract prepass to module and standardize naming
IceSentry a54b73e
register type in core_pipeline
IceSentry fab7dc3
fix FragmentInput
IceSentry e083a7d
better example
IceSentry b5d37d9
Merge branch 'main' into depth-prepass
IceSentry d42b611
Apply suggestions from code review
IceSentry 684a061
Apply suggestions from code review
IceSentry c3fa4e0
Apply suggestions from code review
IceSentry d134000
Update crates/bevy_pbr/src/prepass/prepass.wgsl
IceSentry 1cb5ed6
Merge branch 'main' into depth-prepass
IceSentry 51c7eea
remove unnecessary comment
IceSentry f61053e
use pbr_functions import
IceSentry 1e3b173
clean up example
IceSentry 969f3ad
add TODOs
IceSentry 2f83d4b
add comment
IceSentry 134b27c
clean up pbr_prepass
IceSentry 2b0f4f9
Apply suggestions from code review
IceSentry 715ca65
fix unwrap on empty frag shader in prepass
IceSentry 35093ed
docs
IceSentry d95cc01
Merge branch 'main' into depth-prepass
IceSentry 8e1ffbc
Merge branch 'main' into depth-prepass
IceSentry d64286f
update to main
IceSentry c9159a5
add alpha_mask_phase items is_empty check
IceSentry c99f582
shorten comment
IceSentry 27db3b8
fix ci
IceSentry fdbb4d2
Merge branch 'main' into depth-prepass
IceSentry a5ec2f5
Merge branch 'main' into depth-prepass
IceSentry 8e3c28b
remove needless viewport
IceSentry 4fdb631
fix ci
IceSentry 4113981
Merge branch 'main' into depth-prepass
IceSentry 37dc019
fix ci again
IceSentry 4c93b78
reintroduce viewport
IceSentry 40a6ed5
Merge branch 'main' into depth-prepass
IceSentry 30c0c8b
fix merge
IceSentry 59cdf6f
Update crates/bevy_pbr/src/render/pbr_functions.wgsl
IceSentry 66e4ab4
Update crates/bevy_pbr/src/render/pbr_functions.wgsl
IceSentry 55839ea
fix fallback with multisamples
IceSentry 30393b0
wording
IceSentry 048b08c
fix
IceSentry b002ef6
spelling
IceSentry 522f49b
don't create or bind prepass textures with webgl
IceSentry 0dd8d89
Merge branch 'main' into depth-prepass
IceSentry ed86541
don't log warning
IceSentry 69a1da5
Merge branch 'main' into depth-prepass
IceSentry 8a2b381
Apply suggestions from code review
IceSentry 678aec7
Merge branch 'main' into depth-prepass
IceSentry 9dc998e
add backticks
IceSentry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.