Back home 🏡 WGSL Spec Bevy WGSL Functions

skinning.wgsl

Import path

Bindings

Name Group Binding index Binding type Type Shader Def
joint_matrices # 1 1 <uniform> SkinnedMesh 🟢 SKINNED
prev_joint_matrices # 1 6 <uniform> SkinnedMesh 🟢 SKINNED

Functions

skin_model

#

Shader defs:

🟢 SKINNED

fn skin_model(indexes: vec4<u32>, weights: vec4<f32>) -> mat4x4<f32>
Parameter Type
indexes vec4<u32>
weights vec4<f32>
Returns: mat4x4<f32>

skin_prev_model

#

Shader defs:

🟢 SKINNED

Returns the skinned position of a vertex with the given weights from the previous frame. This is used for motion vector computation.
fn skin_prev_model(indexes: vec4<u32>, weights: vec4<f32>) -> mat4x4<f32>
Parameter Type
indexes vec4<u32>
weights vec4<f32>
Returns: mat4x4<f32>

inverse_transpose_3x3m

#

Shader defs:

🟢 SKINNED

fn inverse_transpose_3x3m(in: mat3x3<f32>) -> mat3x3<f32>
Parameter Type
in mat3x3<f32>
Returns: mat3x3<f32>

skin_normals

#

Shader defs:

🟢 SKINNED

fn skin_normals(world_from_local: mat4x4<f32>, normal: vec3<f32>) -> vec3<f32>
Parameter Type
world_from_local mat4x4<f32>
normal vec3<f32>
Returns: vec3<f32>