Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.

Bindings

preprocessed_depth

#
@group(0)
@binding(0)
var preprocessed_depth: texture_2d<f32>

normals

#
@group(0)
@binding(1)
var normals: texture_2d<f32>

hilbert_index_lut

#
@group(0)
@binding(2)
var hilbert_index_lut: texture_2d<u32>

ambient_occlusion

#
@if(USE_R16FLOAT)
@group(0)
@binding(3)
var ambient_occlusion: texture_storage_2d<r16float, write>
@else()
@group(0)
@binding(3)
var ambient_occlusion: texture_storage_2d<r32float, write>

depth_differences

#
@group(0)
@binding(4)
var depth_differences: texture_storage_2d<r32uint, write>

globals

#
@group(0)
@binding(5)
var<uniform> globals: Globals

settings

#
@group(0)
@binding(6)
var<uniform> settings: SsaoSettings

point_clamp_sampler

#
@group(1)
@binding(0)
var point_clamp_sampler: sampler

linear_clamp_sampler

#
@group(1)
@binding(1)
var linear_clamp_sampler: sampler

view

#
@group(1)
@binding(2)
var<uniform> view: View

Structures

SsaoSettings

#
struct SsaoSettings {
radius: f32 ,
thickness: f32 ,
}

Functions

load_noise

#
fn load_noise (
pixel_coordinates: vec2<i32>
) -> vec2<f32>

calculate_neighboring_depth_differences

#

Calculate differences in depth between neighbor pixels (later used by the spatial denoiser pass to preserve object edges)

fn calculate_neighboring_depth_differences (
pixel_coordinates: vec2<i32>
) -> f32

load_normal_view_space

#
fn load_normal_view_space (
uv_normals: vec2<f32>
) -> vec3<f32>

reconstruct_view_space_position

#
fn reconstruct_view_space_position (
depth: f32
, 
uv: vec2<f32>
) -> vec3<f32>

load_and_reconstruct_view_space_position

#
fn load_and_reconstruct_view_space_position (
uv: vec2<f32>
, 
sample_mip_level: f32
) -> vec3<f32>

updateSectors

#
fn updateSectors (
min_horizon: f32
, 
max_horizon: f32
, 
samples_per_slice: f32
, 
bitmask: u32
) -> u32

processSample

#
fn processSample (
delta_position: vec3<f32>
, 
view_vec: vec3<f32>
, 
sampling_direction: f32
, 
n: vec2<f32>
, 
samples_per_slice: f32
, 
bitmask: ptr<function, u32>
)

ssao

#
@compute
Runs custom parallel code on the GPU, not limited to graphics
@workgroup_size(8, 8, 1)
Defines the size of a thread group. One to three numbers: width (x), height (y), and depth (z). Missing values default to 1
fn ssao (
@builtin(global_invocation_id)
global_id: vec3<u32>
)
Contents