displace.wgsl
Import path
Constants
NORMAL_DIRECTION_0
#NORMAL_DIRECTION_1
#CAPILLARY_DIRECTION
#CAPILLARY_ROTATION
#
const
CAPILLARY_ROTATION:
mat2x2<f32>
=
mat2x2(
vec2(0.819152, 0.573576),
vec2(-0.573576, 0.819152),
)
WAVE_NORMALS_SLOPE_VARIANCE
#NORMAL_SCROLL_MULTIPLIER
#NORMAL_SCROLL_POWER
#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
#direct_fft_normal_cross
#sample_fft_normal_cross
#outer_cascade_weight
#far_displacement
#far_normal_cross
#displacement_jacobian
#crest_sss
#sample_detail_normal
#detail_normal_sample
#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.
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.