Advanced search tips: use spaces to require multiple terms (AND), | for alternatives (OR), wrap phrases in quotes (="a b"), =term for exact match, 'term to include, !term to exclude, ^term to match prefix, !^term to exclude prefix, .ext$ to match suffix, and !.ext$ to exclude suffix.

anim_waves_combine.wgsl

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 {
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 { }

Functions

combine_lod

#
fn combine_lod (
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

Shader defs requirments:

🟢 COMBINE_1

fn main (
@builtin(global_invocation_id)
id: vec3<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

Shader defs requirments:

🟢 COMBINE_2

fn main (
@builtin(global_invocation_id)
id: vec3<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

Shader defs requirments:

🟢 COMBINE_3

fn main (
@builtin(global_invocation_id)
id: vec3<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

Shader defs requirments:

🟢 COMBINE_4

fn main (
@builtin(global_invocation_id)
id: vec3<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

Shader defs requirments:

🟢 COMBINE_0

fn main (
@builtin(global_invocation_id)
id: vec3<u32>
)