optics.wgsl
Import path
Constants
TRANSMISSION_OPAQUE_OPTICAL_DEPTH
#Functions
unresolved_wave_roughness
#deep_water_weight
#depth_aware_body_albedo
#far_field_water
#camera_eye_depth
#empty_camera_depth_path
#
fn
empty_camera_depth_path
()
camera_depth_path
#camera_depth_debug_from_path
#Reimplementation of the approach in Crest OceanEmission.hlsl:195-242. The opaque camera depth,
never SeaFloorDepth LodData, determines the view-ray water path and whether
a refracted sample landed on geometry in front of the water.
opaque_background
#Transmission samples the opaque buffer at full resolution. Distortion comes only from the displacement normal; no roughness mip or blur is used.
resolve_near_surface
#
fn
resolve_near_surface
(
,
surface_lod:
u32
,
geometric_normal:
vec3<f32>
,
far_tier:
f32
,
mode:
u32
)
->
NearSurface
sample_water_medium
#
fn
sample_water_medium
(
,
surface_lod:
u32
,
lighting_normal:
vec3<f32>
,
to_view:
vec3<f32>
,
mode:
u32
)
->
MediumState
illuminate_bed
#
fn
illuminate_bed
(
scene_colour:
vec3<f32>
,
,
medium:
MediumState
,
primary:
PrimaryLightState
)
->
vec3<f32>
resolve_transmission
#
fn
resolve_transmission
(
,
normal:
vec3<f32>
,
scatter_colour:
vec3<f32>
,
medium:
MediumState
,
foam:
FoamState
,
primary:
PrimaryLightState
,
mode:
u32
)
->
TransmissionState
Dupuy et al. 2013 LEADR-style slope filtering. A pixel cannot resolve waves shorter than twice its projected world footprint. Integrate each shipped wavelength band’s measured slope variance below that Nyquist cutoff. The logarithmic partial-band term matches the generator’s octave partition.