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.

water_material.wgsl

Bindings

globals

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

water_normals_texture

#
@group(2)
@binding(100)
var water_normals_texture: texture_2d<f32>

water_normals_sampler

#
@group(2)
@binding(101)
var water_normals_sampler: sampler

water_settings

#
@group(2)
@binding(102)
var<uniform> water_settings: WaterSettings

Structures

WaterSettings

#

Parameters to the water shader.

struct WaterSettings {
octave_vectors: array<vec4<f32>,2> ,
octave_scales: vec4<f32> ,
octave_strengths: vec4<f32> ,
}

Functions

sample_noise_octave

#

Samples a single octave of noise and returns the resulting normal.

fn sample_noise_octave (
strength: f32
) -> vec3<f32>

sample_noise

#

Samples all four octaves of noise and returns the resulting normal.

fn sample_noise (
time: f32
) -> vec3<f32>

fragment

#
@fragment
Calculates the final color of each pixel on the screen
fn fragment (
@builtin(front_facing)
is_front: bool
) -> FragmentOutput