mesh_functions.wgsl

Import path
Functions
fn
mesh_position_local_to_world
(
world_from_local:
mat4x4<f32>
,

vertex_position:
vec4<f32>
)
->
vec4<f32>


fn
mesh_position_local_to_clip
(
world_from_local:
mat4x4<f32>
,

vertex_position:
vec4<f32>
)
->
vec4<f32>


Calculates the sign of the determinant of the 3x3 model matrix based on a mesh flag
fn
mesh_tangent_local_to_world
(
world_from_local:
mat4x4<f32>
,

vertex_tangent:
vec4<f32>
,

instance_index:
u32
)
->
vec4<f32>


Shader defs requirments:
š¢ VISIBILITY_RANGE_DITHER
NOTE: The intermediate world_position assignment is important for precision purposes when using the ‘equals’ depth comparison function.