8000 GitHub - radiatoryang/UnityVATBaker: Vertex Animation Texture tool in unity for skinned characters.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

radiatoryang/UnityVATBaker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Updates:

  • Add Low mode (Very small texture size, normalized positions and normals [0..1], TextureFormat.RGBA32)

Unity VAT Baker GitHub License

This repository contains a tool for baking Vertex Animation Textures (VAT) directly within Unity. The tool is currently focused on working with SkinnedMeshRenderer components (primarily characters).

Examples showing different animation step sizes

Important Note:
This tool still has areas that could be improved, such as adding more automation to the baking process or optimizing how data is packed. I may address these enhancements in the future.

A sample scene for comparisons is included in the project

System requirements

  • Unity 6 and above.
    (The tool might also work in older versions that support Shader Graph, but this hasn't been tested.)

Tool Features

  • Localization into Russian, English, Japanese, and Simplified Chinese (I wanted to practice adding localization. 😃)
  • Prefab validation checks and helpful warnings
  • Ability to gather all animation clips from the Animator Controller into a list
  • Prefab preview with a selected animation clip
  • Adjustable frame step (to reduce frame count and texture size, with minimal quality loss)
  • No vertex count limit (the tool uses multiple rows per frame)
  • Option to bake positions and normals
  • Two Shader Graph subgraphs included:
    • VAT_Simple: Uses 2 texture samplers
    • VAT_WithFrameBlend: Uses 4 texture samplers and simple blending logic
  • Example scene included for:
    • Comparing FrameStep and Blend modes
    • Performance testing with 1000+ Animator Controllers vs. GPU instancing using VAT

How to Use the VAT Baker

1. Open the tool window: Tools/VatBaker

2. Assign a prefab with a SkinnedMeshRenderer and an Animator Controller containing animations

3. Select an animation clip from the list (all clips in the Animator Controller are listed)

4. Adjust the animation length and frame step.
Frame step determines how many frames are skipped between baked frames, reducing the final texture size while preserving most of the animation quality. This is especially useful for simple animations.

5. Choose the texture width (height is computed automatically and rounded up to a power-of-two). You can skip baking normals if they're not needed, and specify the output path and filename. The tool will append the mesh name, animation clip name, and data type to the filename.

6. You'll need to manually adjust the textures using a preset or by editing their import settings as shown below:

7. Create a material and assign VAT_Debug shader (for example)

8. Set up the material as follows (in the future, I'll automate this):

  1. Total Frames = source frame count / frame step (e.g., 60/4 = 15)
  2. Frame Rate = source frame rate / frame step (e.g., 24/4 = 6), or adjust to control animation playback speed
  3. Vertex Count can be found in the tool window
  4. Texture Width/Height matches the baked texture
  5. Rows Per Frame = ceil(VertexCount / TextureWidth). For example, if 2204/1024 ≈ 2.15 => 3 rows
  6. Compare different sampling modes as desired.

Result

Shader Implementation

To integrate VAT in your shader, simply select one of the provided subgraphs (VAT_Simple or VAT_WithFrameBlend) and connect the output positions and normals to your shader's vertex stage. The HLSL version will be made available later.

When will this be updated?

If enough people show interest in this tool, I plan to make further improvements.

It's not working for me. Can you help?

Please leave your feedback. When I have some free time, I'll do my best to address any issues and improve the tool.

Can I use this tool freely?

Absolutely! Feel free to use it in your projects, including commercial ones. You can modify and improve it as you like. However, please do not sell or redistribute the asset itself as a standalone product—it’s meant to remain free.

About

Vertex Animation Texture tool in unity for skinned characters.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • ShaderLab 65.8%
  • C# 20.6%
  • HLSL 13.6%
0