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

CASCADE_COUNT

#
const CASCADE_COUNT: u32 = 6u

VERTEX_SNAP_MULTIPLIER

#
const VERTEX_SNAP_MULTIPLIER: f32 = 2.0

COARSE_GRID_MULTIPLIER

#
const COARSE_GRID_MULTIPLIER: f32 = 4.0

LOD_TRANSITION_START

#
const LOD_TRANSITION_START: f32 = 1.0

MORPH_BLACK_POINT

#
const MORPH_BLACK_POINT: f32 = 0.05

MORPH_FADE_SIDES

#
const MORPH_FADE_SIDES: f32 = 2.0

MORPH_INNER_RADIUS

#
const MORPH_INNER_RADIUS: f32 = 0.375

GRID_CELL_CENTER

#
const GRID_CELL_CENTER: f32 = 0.5

UV_CENTER

#
const UV_CENTER: f32 = 0.5

MIN_SAMPLE_WEIGHT

#

MIN_NORMAL_Y

#

SAFE_LENGTH_SQUARED

#

LUMINANCE_EPSILON

#

DEBUG_MODE_WATER_PATH

#
const DEBUG_MODE_WATER_PATH: u32 = 1u

DEBUG_MODE_REFRACTION_VALIDITY

#
const DEBUG_MODE_REFRACTION_VALIDITY: u32 = 2u

DEBUG_MODE_TRANSMISSION

#
const DEBUG_MODE_TRANSMISSION: u32 = 3u

DEBUG_MODE_UNREFRACTED

#
const DEBUG_MODE_UNREFRACTED: u32 = 4u

DEBUG_MODE_BEER_LAMBERT

#
const DEBUG_MODE_BEER_LAMBERT: u32 = 5u

DEBUG_MODE_SEA_FLOOR

#
const DEBUG_MODE_SEA_FLOOR: u32 = 6u

DEBUG_MODE_BEAUTY

#

DEBUG_MODE_REFLECTION

#
Used by 1 shader in bevy-aqua-core 0.1.3
const DEBUG_MODE_REFLECTION: u32 = 8u

DEBUG_MODE_FOAM

#
Used by 1 shader in bevy-aqua-core 0.1.3
const DEBUG_MODE_FOAM: u32 = 9u

DEBUG_MODE_WAVE_HEIGHT

#
Used by 1 shader in bevy-aqua-core 0.1.3
const DEBUG_MODE_WAVE_HEIGHT: u32 = 10u

DEBUG_MODE_LIGHT_RADIANCE

#
Used by 1 shader in bevy-aqua-core 0.1.3
const DEBUG_MODE_LIGHT_RADIANCE: u32 = 11u

DEBUG_MODE_REFLECTION_FRACTION

#
Used by 1 shader in bevy-aqua-core 0.1.3
const DEBUG_MODE_REFLECTION_FRACTION: u32 = 12u

DEBUG_MODE_FAR_TIER

#

CREST_SSS_MAXIMUM

#
Used by 1 shader in bevy-aqua-waves 0.1.3
const CREST_SSS_MAXIMUM: f32 = 0.6

CREST_SSS_RANGE

#

CREST_SSS_UNCOMPRESSED

#
Used by 1 shader in bevy-aqua-core 0.1.3
const CREST_SSS_UNCOMPRESSED: f32 = CREST_SSS_MAXIMUM - CREST_SSS_RANGE

PLANAR_PROJECTION_GUARD

#
const PLANAR_PROJECTION_GUARD: f32 = 0.03

MAX_BODIES

#
const MAX_BODIES: u32 = 16u

Bindings

lod_data

#
Used by 1 shader in bevy-aqua-waves 0.1.3
@group(#{MATERIAL_BIND_GROUP})
@binding(0)
var lod_data: texture_2d_array<f32>

lod_sampler

#
Used by 1 shader in bevy-aqua-waves 0.1.3
@group(#{MATERIAL_BIND_GROUP})
@binding(1)
var lod_sampler: sampler

cascade_layout

#

surface

#

bed_height

#
Used by 1 shader in bevy-aqua-shore 0.1.3
@group(#{MATERIAL_BIND_GROUP})
@binding(4)
var bed_height: texture_2d<f32>

detail_normal

#
Used by 1 shader in bevy-aqua-waves 0.1.3
@group(#{MATERIAL_BIND_GROUP})
@binding(5)
var detail_normal: texture_2d<f32>

detail_sampler

#
Used by 1 shader in bevy-aqua-waves 0.1.3
@group(#{MATERIAL_BIND_GROUP})
@binding(6)
var detail_sampler: sampler

foam_data

#
Used by 1 shader in bevy-aqua-foam 0.1.3
@group(#{MATERIAL_BIND_GROUP})
@binding(7)
var foam_data: texture_2d_array<f32>

foam_sampler

#
Used by 1 shader in bevy-aqua-foam 0.1.3
@group(#{MATERIAL_BIND_GROUP})
@binding(8)
var foam_sampler: sampler

foam_pattern

#
Used by 1 shader in bevy-aqua-foam 0.1.3
@group(#{MATERIAL_BIND_GROUP})
@binding(9)
var foam_pattern: texture_2d<f32>

foam_pattern_sampler

#
Used by 1 shader in bevy-aqua-foam 0.1.3
@group(#{MATERIAL_BIND_GROUP})
@binding(10)
var foam_pattern_sampler: sampler

fft_surface

#
Used by 1 shader in bevy-aqua-waves 0.1.3
@group(#{MATERIAL_BIND_GROUP})
@binding(11)
var fft_surface: texture_2d_array<f32>

field_params

#
@group(#{MATERIAL_BIND_GROUP})
@binding(15)
var<uniform> field_params: FieldParams

field_maps

#
@group(#{MATERIAL_BIND_GROUP})
@binding(16)
var field_maps: texture_2d_array<f32>

field_sampler

#
@group(#{MATERIAL_BIND_GROUP})
@binding(17)
var field_sampler: sampler

reflection_a

#
@group(#{MATERIAL_BIND_GROUP})
@binding(19)
var reflection_a: texture_2d<f32>

reflection_sampler

#
@group(#{MATERIAL_BIND_GROUP})
@binding(20)
var reflection_sampler: sampler

reflection_b

#
@group(#{MATERIAL_BIND_GROUP})
@binding(21)
var reflection_b: texture_2d<f32>

planar_reflections

#
@group(#{MATERIAL_BIND_GROUP})
@binding(22)
var<uniform> planar_reflections: PlanarReflectionParams

caustics_texture

#
Used by 1 shader in bevy-aqua-shore 0.1.3
@group(#{MATERIAL_BIND_GROUP})
@binding(23)
var caustics_texture: texture_2d<f32>

caustics_sampler

#
Used by 1 shader in bevy-aqua-shore 0.1.3
@group(#{MATERIAL_BIND_GROUP})
@binding(24)
var caustics_sampler: sampler

Structures

CascadeParams

#
Used by 1 shader in bevy-aqua-foam 0.1.3
struct CascadeParams {
center: vec2<f32>,
scale: f32,
texture_res: f32,
inv_texture_res: f32,
texel_width: f32,
weight: f32,
max_wavelength: f32,
}

CascadeLayout

#
Used by 1 shader in bevy-aqua-motion 0.1.3
struct CascadeLayout {
cascades: array<CascadeParams, CASCADE_COUNT>,
center: vec4<f32>,
bed_transform: vec4<f32>,
bed_range: vec4<f32>,
}

PlanarReflectionView

#
struct PlanarReflectionView {
view_projection: mat4x4<f32>,
level: f32,
}

PlanarReflectionParams

#
struct PlanarReflectionParams {
view_count: u32,
distortion: f32,
}

PlanarReflectionSample

#
struct PlanarReflectionSample {
color: vec3<f32>,
weight: f32,
}

SurfaceParams

#
struct SurfaceParams {
deep_color: vec4<f32>,
grazing_color: vec4<f32>,
shallow_color: vec4<f32>,
fresnel: vec4<f32>,
reflection: vec4<f32>,
sun: vec4<f32>,
debug: vec4<f32>,
fog_density: vec4<f32>,
sea_floor: vec4<f32>,
sss_tint: vec4<f32>,
sss: vec4<f32>,
detail: vec4<f32>,
capillary: vec4<f32>,
foam: vec4<f32>,
advection: vec4<f32>,
far_tier: vec4<f32>,
caustics: vec4<f32>,
}

BodyParams

#
Used by 1 shader in bevy-aqua-core 0.1.3

Localized-water extent controls; mirrors lod::BodyParams. flags.x is 1.0 for bounded bodies: the vertex stage skips camera snap/morph and the fragment stage culls against extent.xy (centre) and extent.w (radius).

struct BodyParams {
flags: vec4<f32>,
extent: vec4<f32>,
aabb_min: vec4<f32>,
aabb_size: vec4<f32>,
optics_a: vec4<f32>,
optics_b: vec4<f32>,
}

FieldParams

#
struct FieldParams {
region: vec4<f32>,
info: vec4<f32>,
bodies: array<BodyParams, MAX_BODIES>,
}

LocalLightSample

#

RiverState

#
Used by 1 shader in bevy-aqua-foam 0.1.3

One snapshot of this invocation’s river state, handed to imported modules that cannot read this file’s private globals directly.

struct RiverState {
enabled: bool,
sample: vec4<f32>,
flow: vec2<f32>,
}

Functions

sample_planar_reflection

#
fn sample_planar_reflection (
world_position: vec3<f32>,
surface_level: f32,
surface_normal: vec3<f32>
) -> PlanarReflectionSample

set_xz_footprint

#
Used by 1 shader in bevy-aqua-core 0.1.3
fn set_xz_footprint (
value: f32
)

screen_xz_footprint

#
Used by 1 shader in bevy-aqua-optics 0.1.3
fn screen_xz_footprint () -> f32

screen_texture_lod

#

Analytic texture LOD: dUV/dpixel is the world-XZ footprint divided by metres per UV repeat, and mip LOD is log2(texels covered per pixel).

fn screen_texture_lod (
metres_per_repeat: f32,
texture_width: u32
) -> f32

begin_invocation

#

Stage entry: records the owning body slot’s parameters.

fn begin_invocation (
bounded: bool,
params: BodyParams
)

set_effective_flow

#

Stage entry: selects the advection current for wave-content sampling.

fn set_effective_flow (
flow: vec2<f32>
)

set_effective_time

#
fn set_effective_time (
time: f32
)

set_fragment_river

#
Used by 1 shader in bevy-aqua-core 0.1.3

Fragment entry: records the baked river-flow sample under the fragment.

fn set_fragment_river (
sample: vec4<f32>
)

set_body_optics

#
Used by 1 shader in bevy-aqua-core 0.1.3

Fragment entry: records the effective Beer-Lambert extinction and the scatter-endpoint scale after fresh-water optics override.

fn set_body_optics (
extinction: vec3<f32>,
scatter_scale: f32
)

set_river_ripple

#
Used by 1 shader in bevy-aqua-core 0.1.3

Fragment entry: records the river ripple-strength multiplier.

fn set_river_ripple (
scale: f32
)

invocation_extinction

#

invocation_scatter_scale

#
Used by 1 shader in bevy-aqua-core 0.1.3
fn invocation_scatter_scale () -> f32

invocation_river_state

#
Used by 1 shader in bevy-aqua-core 0.1.3
fn invocation_river_state () -> RiverState

invocation_ripple

#

advected_world

#

field_uv

#

Samples the baked river field; returns zero flow and a huge bank margin when this material has no flow texture.

fn field_uv (
world_xz: vec2<f32>
) -> vec2<f32>

sample_field_level

#

rg: surface level, one-based body slot (0 = unclaimed).

fn sample_field_level (
world_xz: vec2<f32>
) -> vec2<f32>

sample_field_flow

#

rgb: flow m/s; z: signed bank margin in metres; w: speed m/s.

fn sample_field_flow (
world_xz: vec2<f32>
) -> vec4<f32>

owning_body

#

Parameters of the body owning a point; slot 0 falls back to the inactive ocean defaults so unguarded reads stay harmless.

fn owning_body (
slot: u32
) -> BodyParams

lod_count

#

smootherstep01

#
fn smootherstep01 (
value: f32
) -> f32

far_tier_weight

#

lod_alpha

#

snap_and_transition

#
fn snap_and_transition (
world_xz: vec2<f32>,
object_xz: vec2<f32>,
cascade: CascadeParams
) -> vec3<f32>

world_to_uv

#

sample_displacement

#

Wave content advects at surface.advection.xy metres per second. A sampling-space shift is exact Doppler advection for both spectra: sampling at x - u * t turns every component’s phase into (k . x) - (omega + k . u) * t. Snap/transition, depth lookups, and foam gating stay world-anchored.

fn sample_displacement (
world_xz: vec2<f32>,
lod: u32,
alpha: f32
) -> vec3<f32>

flow_frame

#
Used by 1 shader in bevy-aqua-waves 0.1.3
fn flow_frame (
world_xz: vec2<f32>
) -> vec2<f32>

capillary_resolved_weight

#

godot_fresnel

#

GodotOceanWaves water.gdshader: bounded GGX distribution and its Smith masking-shadowing approximation. Aqua applies Fresnel later in Crest’s reflection composition, so this returns the remaining direct-sun factor.

fn godot_fresnel (
view_alignment: f32
) -> f32
Contents