aboutsummaryrefslogtreecommitdiff
path: root/src/resources.rs
diff options
context:
space:
mode:
authorLibravatar Silas Bartha <silas@soaos.dev>2025-02-25 19:48:54 -0500
committerLibravatar Silas Bartha <silas@soaos.dev>2025-02-25 19:48:54 -0500
commit035259fba7ec49484ad029f1f0670f2feb058f54 (patch)
tree8f29dae7dee84396cf88d66d265e71f6eaa6c438 /src/resources.rs
parent8c65dc75b366b1a13b825ae96312777bd132c3ed (diff)
Added Depth-based Outlines
Diffstat (limited to 'src/resources.rs')
-rw-r--r--src/resources.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/resources.rs b/src/resources.rs
index 072b21c..4460558 100644
--- a/src/resources.rs
+++ b/src/resources.rs
@@ -20,6 +20,7 @@ pub struct OutlinePostProcessPipeline {
pub layout: BindGroupLayout,
pub screen_sampler: Sampler,
pub normal_sampler: Sampler,
+ pub depth_sampler: Sampler,
pub pipeline_id: CachedRenderPipelineId,
}
@@ -36,7 +37,8 @@ impl FromWorld for OutlinePostProcessPipeline {
sampler(SamplerBindingType::Filtering),
texture_2d(TextureSampleType::Float { filterable: true }),
sampler(SamplerBindingType::Filtering),
- texture_2d(TextureSampleType::Uint),
+ texture_2d(TextureSampleType::Depth),
+ sampler(SamplerBindingType::NonFiltering),
uniform_buffer::<components::OutlinePostProcessSettings>(false),
),
),
@@ -44,6 +46,7 @@ impl FromWorld for OutlinePostProcessPipeline {
let screen_sampler = render_device.create_sampler(&SamplerDescriptor::default());
let normal_sampler = render_device.create_sampler(&SamplerDescriptor::default());
+ let depth_sampler = render_device.create_sampler(&SamplerDescriptor::default());
let shader = world.resource::<AssetServer>().load::<Shader>(
"embedded://bevy_outline_post_process/../assets/shaders/outline_post_process.wgsl",
@@ -77,6 +80,7 @@ impl FromWorld for OutlinePostProcessPipeline {
layout,
screen_sampler,
normal_sampler,
+ depth_sampler,
pipeline_id,
}
}