Back home 🏡 WGSL Spec Bevy WGSL Functions

preprocess_depth.wgsl

Bindings

Name Group Binding index Binding type Type
input_depth # 0 0 texture_depth_2d
preprocessed_depth_mip0 # 0 1 texture_storage_2d<r16float, write>
preprocessed_depth_mip1 # 0 2 texture_storage_2d<r16float, write>
preprocessed_depth_mip2 # 0 3 texture_storage_2d<r16float, write>
preprocessed_depth_mip3 # 0 4 texture_storage_2d<r16float, write>
preprocessed_depth_mip4 # 0 5 texture_storage_2d<r16float, write>
point_clamp_sampler # 1 0 sampler
linear_clamp_sampler # 1 1 sampler
view # 1 2 <uniform> View

Functions

weighted_average

#
Using 4 depths from the previous MIP, compute a weighted average for the depth of the current MIP
fn weighted_average(depth0: f32, depth1: f32, depth2: f32, depth3: f32) -> f32
Parameter Type
depth0 f32
depth1 f32
depth2 f32
depth3 f32
Returns: f32

preprocess_depth

#
@compute
fn preprocess_depth(global_id: vec3<u32>, local_id: vec3<u32>)
Parameter Type
global_id vec3<u32>
local_id vec3<u32>