Functions
@vertex
Processes each 3D point in a model before it's drawn
fn
prepare_surface_foam
(
in: SurfaceVertexOutput,
surface_lod: u32,
foam_density: f32,
lighting_distance: f32
)
->
FoamState
fn
directional_scatter
(
in: SurfaceVertexOutput,
surface_lod: u32,
near: NearSurface,
primary: PrimaryLightState,
medium: MediumState,
mode: u32
)
->
vec3<f32>
fn
shade_water_body
(
in: SurfaceVertexOutput,
near: NearSurface,
primary: PrimaryLightState,
medium: MediumState,
foam: FoamState,
mode: u32
)
->
BodyLightingState
fn
shade_environment_and_sun
(
surface_level: f32,
near: NearSurface,
primary: PrimaryLightState,
body_lighting: BodyLightingState,
)
->
vec3<f32>
fn
shade_local_lights
(
in: SurfaceVertexOutput,
near: NearSurface,
primary: PrimaryLightState,
body_lighting: BodyLightingState,
foam: FoamState,
mode: u32
)
->
LocalLightingState
fn
compose_water
(
primary: PrimaryLightState,
body_lighting: BodyLightingState,
local: LocalLightingState,
foam: FoamState,
far_tier: f32,
mode: u32
)
->
vec4<f32>
@fragment
Calculates the final color of each pixel on the screen