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