Skip to content

V-Sekai/unity-mesh-deform-direct-delta-mush

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real-Time Mesh Skinning with Direct Delta Mush (Unity) (Fire Edition)

Problem Solved

Efficient and high-quality skinning and animations for simply authored skinned meshes.

Project Description

A Unity project implementing real-time mesh skinning using the GPU-based Direct Delta Mush algorithm. This algorithm and its variants enable efficient and high-quality computation of mesh skinning and animations, even for simply authored skinned meshes.

Overview1

With Direct Delta Mush (left), we get less bulging effect than what we get with built-in skinning (right).

How to Build

Requirements

  • Unity 2020.3.36f1
  • Visual Studio 2022

Build Instructions

Add MeshDeformUnity to Unity Hub and select the Unity version to open this project.

Features Overview

  • Direct Delta Mush with GPU variant 0.
  • Precomputation of Direct Delta Mush with GPU.
Iterations Visual Effect
0 (LBS) img
2 img
16 img

The table above shows how the number of iterations affect the visual effect of skinning. With more iterations, the elbow appears smoother and has a reduced bulging effect.

Variants of Direct Delta Mush

The paper also presents some variants equivalent to special cases of several previous skinning algorithms.

  • Variant 0 is the full DDM model.
LBS v0
img img

See technical notes for technical details.

How to Use

  1. Load models and toggle Read/Write Enabled. Load Model

  2. Drag the model into the scene or select the object with this model in the scene. Drag to Scene

  3. Expand and find the mesh object of the model. Add a component to the mesh object. Ensure that there is a Skinned Mesh Render component in this object. Add Component

  4. Examine the component DDM skinned Mesh GPU Var 0. It has several attributes:

    • Iterations: The iteration count of the precomputation.
    • Smooth Lambda: Determines the smoothing result for each step.
    • Use Compute: Determines whether you use GPU skinning or CPU skinning, but currently, we only implemented GPU skinning for most of the variants.
    • Adjacency Matching Vertex Tolerance: Set with a small positive float number if you need to merge the adjacency data of the vertices close to each other, but enabling this process may cause longer precomputations.
    • Debug Mode: For comparison to the visual effect of built-in skinning if you assign Compare With Linear Blend to this attribute.

    Modify Iterations and Smooth Lambda to change the visual effect of runtime skinning. Add Component

  5. Set Iterations to 30, for example. For this model, set the Adjacency Matching Vertex Tolerance to a positive number to enable vertex matching. Then click the Play button and switch to the Scene view. Expand the skeleton in the Hierarchy window, and you can select which joint to edit. Select Joint

  6. Press E to rotate the joints to deform the mesh. Press W to translate the joints. Deform Mesh

  7. To play animation on the mesh, create an Animator Controller and set the animation as shown below. You can also set the speed as desired. Then choose the root of the model, add the component Animator, and set the animator controller mentioned before to the Controller attribute. Animator Controller Animator

After playing, you can see the animation. Some models can be found at mixamo.

Credit & References

  1. Xuntong Liang
  2. Bowen Deng
  3. Beini Gu
  4. Unity
  5. Math.NET Numerics
  6. Delta Mush: smoothing deformations while preserving detail
  7. Direct Delta Mush Skinning and Variants
  8. Direct Delta Mush Skinning Compression with Continuous Examples
  9. Mixamo

Presentations

  1. Pitch
  2. Milestone 1
  3. Milestone 2
  4. Milestone 3
  5. Final Presentation
  6. Sample Video

About

Real-time mesh skinning with DDM implemented in Unity

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 99.6%
  • Other 0.4%