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.

displace.wgsl

Import path

Constants

NORMAL_DIRECTION_0

#
const NORMAL_DIRECTION_0: vec2<f32> = vec2(0.94, 0.34)

NORMAL_DIRECTION_1

#
const NORMAL_DIRECTION_1: vec2<f32> = vec2(-0.85, -0.53)

CAPILLARY_DIRECTION

#
const CAPILLARY_DIRECTION: vec2<f32> = vec2(0.4226, 0.9063)

CAPILLARY_ROTATION

#
const CAPILLARY_ROTATION: mat2x2<f32> = mat2x2( vec2(0.819152, 0.573576), vec2(-0.573576, 0.819152), )

WAVE_NORMALS_SLOPE_VARIANCE

#
const WAVE_NORMALS_SLOPE_VARIANCE: f32 = 0.05602466

NORMAL_SCROLL_MULTIPLIER

#
const NORMAL_SCROLL_MULTIPLIER: f32 = 1.875

NORMAL_SCROLL_POWER

#
const NORMAL_SCROLL_POWER: f32 = 1.4

FFT_JONSWAP_SLOPE_VARIANCE

#
const FFT_JONSWAP_SLOPE_VARIANCE: array<f32, 5> = array( 0.06393624, 0.06369724, 0.06306524, 0.06170338, 0.06048288, )

GERSTNER_SLOPE_VARIANCE

#
const GERSTNER_SLOPE_VARIANCE: array<f32, 5> = array( 0.0194041, 0.027484603, 0.015417861, 0.0066486476, 0.010458008, )

Functions

direct_displacement

#
fn direct_displacement (
world_xz: vec2<f32>
lod: u32
) -> vec3<f32>

direct_fft_normal_cross

#
fn direct_fft_normal_cross (
world_xz: vec2<f32>
lod: u32
) -> vec3<f32>

sample_fft_normal_cross

#
fn sample_fft_normal_cross (
world_xz: vec2<f32>
lod: u32
alpha: f32
) -> vec3<f32>

outer_cascade_weight

#
fn outer_cascade_weight (
world_xz: vec2<f32>
) -> f32

far_displacement

#
fn far_displacement (
world_xz: vec2<f32>
) -> vec3<f32>

far_normal_cross

#
fn far_normal_cross (
world_xz: vec2<f32>
) -> vec3<f32>

displacement_jacobian

#
fn displacement_jacobian (
world_xz: vec2<f32>
lod: u32
) -> f32

crest_sss

#
fn crest_sss (
world_xz: vec2<f32>
lod: u32
alpha: f32
) -> f32

sample_detail_normal

#
fn sample_detail_normal (
lod: f32
) -> vec3<f32>

detail_normal_sample

#

Crest OceanNormalMapping.hlsl::SampleNormalMaps: two opposed scroll directions and a second doubled scale blended by the cascade transition. z carries LEAN slope variance removed by mip filtering.

fn detail_normal_sample (
world_xz: vec2<f32>
lod: u32
alpha: f32
ripple: f32
) -> vec3<f32>

capillary_normal_slope

#

GodotOceanWaves anchors this as a displacement-free fine normal cascade. DIVERGENCE: Aqua reuses Crest’s trilinear WaveNormals at 16x frequency and its shipped 0.08 strength because minification makes it weaker than an FFT normal field; rotation avoids aligning its period with the authored layers.

fn capillary_normal_slope (
world_xz: vec2<f32>
ripple: f32
) -> vec2<f32>