computeSkinning
A helper function that performs skeletal skinning calculations on the GPU and exposes the animated vertex positions as a reusable node, effectively unlocking the 'black box' of skeletal animation.
Core Advantages
Its core value is decoupling the skinning calculation from the final rendering. This allows the animation result to be used as a data source, freely composable with other nodes (like noise, distortion) or used to drive physics effects, greatly enhancing shader flexibility and composability.
Common Uses
Precisely attaching visual effects (particles, lightning) to the surface of an animated model.
Triggering secondary dynamics (like dust splashes) based on the animated vertex positions.
Layering procedural deformations (like jiggling, melting) on top of standard skeletal animations.
Visualizing debugging information, such as bone weights, as colors.
How to adjust
It's adjusted not via function parameters, but by post-processing its output. For example, adding a noise node to the output of `computeSkinning()` and controlling the noise strength with a uniform variable can create visual effects like the character 'disintegrating' or 'petrifying' while maintaining its animated pose.
Code Examples
1// Get the vertex position after skinning animation
2const animatedPosition = computeSkinning( skinnedMesh ).position;
3
4// Add a disintegration effect on top of the animation
5const finalPosition = animatedPosition.add( disintegrationNoise );