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.

Constants

LOD_COUNT

#
const LOD_COUNT: u32 = 5u

CASCADE_COUNT

#
const CASCADE_COUNT: u32 = LOD_COUNT + 1u

WAVE_COUNT

#
const WAVE_COUNT: u32 = 40u

Bindings

raw_waves

#
@group(0)
@binding(0)
var raw_waves: texture_2d_array<f32>

previous

#
@group(0)
@binding(1)
var previous: texture_2d_array<f32>

linear_sampler

#
@group(0)
@binding(2)
var linear_sampler: sampler

output

#
@group(0)
@binding(3)
var output: texture_storage_2d_array<rgba16float, write>

params

#
@group(0)
@binding(4)
var<uniform> params: AnimWavesUniform

Structures

CascadeParams

#
struct CascadeParams {
center: vec2<f32>,
scale: f32,
texture_res: f32,
inv_texture_res: f32,
texel_width: f32,
weight: f32,
max_wavelength: f32,
}

CascadeLayout

#
struct CascadeLayout {
cascades: array<CascadeParams, CASCADE_COUNT>,
center: vec4<f32>,
bed_transform: vec4<f32>,
bed_range: vec4<f32>,
}

GerstnerWave

#
struct GerstnerWave {
direction: vec2<f32>,
amplitude: f32,
wave_number: f32,
angular_frequency: f32,
phase: f32,
chop_amplitude: f32,
}

AnimWavesUniform

#
struct AnimWavesUniform {
cascade_layout: CascadeLayout,
waves: array<GerstnerWave, WAVE_COUNT>,
ranges: array<vec4<u32>, LOD_COUNT>,
time: vec4<f32>,
flow: vec4<f32>,
}

Functions

combine_lod

#
fn combine_lod (
id: vec3<u32>,
slice: u32
)

main

#
@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
Active when
COMBINE_1
fn main (
@builtin(global_invocation_id)
id: vec3<u32>
)
Active when
COMBINE_2
fn main (
@builtin(global_invocation_id)
id: vec3<u32>
)
Active when
COMBINE_3
fn main (
@builtin(global_invocation_id)
id: vec3<u32>
)
Active when
COMBINE_4
fn main (
@builtin(global_invocation_id)
id: vec3<u32>
)
Active when
COMBINE_0
fn main (
@builtin(global_invocation_id)
id: vec3<u32>
)
Contents