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

globals

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

water_normals_texture

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

water_normals_sampler

#
@group(constants::MATERIAL_BIND_GROUP)
@binding(101)
var water_normals_sampler: sampler

water_settings

#
@group(constants::MATERIAL_BIND_GROUP)
@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 (
uv: vec2<f32>
, 
strength: f32
) -> vec3<f32>

sample_noise

#

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

fn sample_noise (
uv: vec2<f32>
, 
time: f32
) -> vec3<f32>

fragment

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