Giter Club home page Giter Club logo

vatbaker's Introduction

VatBaker

A tool to bake VAT (Vertex Animation Texture) from AnimationClip with sample shaders for Unity.

Installation

Edit > ProjectSettings... > Package Manager > Scoped Registries

Enter the following and click the Save button.

"name": "fuqunaga",
"url": "https://registry.npmjs.com",
"scopes": [ "ga.fuquna" ]

Window > Package Manager

Select MyRegistries in Packages:

Select VatBaker and click the Install button

Usage

  1. Window > VatBaker
  2. Set a GamObject with Animation and SkinnedMeshRenderer.
  3. (Optional) Set other parameters.
  4. Push the Bake button.
  5. Assets are created under Assets/VatBakerOutput and a VAT GameObject is put in the hierarchy.

Use VAT on your shader

Use VAT functions at the vertex shader.

#include `Packages/ga.fuquna.vatbaker/Shader/vat.hlsl`

vertex shader

float animationTime = CalcVatAnimationTime(<baseTime[sec]>);
float vertexPositionLocal = GetVatPosition(vertexId, animationTime);
float vertexNormalLocal = GetVatNormal(vertexId, animationTime);

See VatUnlit.shader, VatSurfaceStandard.shader

Set material properties for VAT.

Property name Value
_VatPositionTex Assets/VatBakderOutput/*/*.posTex.asset
_VatNormalTex Assets/VatBakderOutput/*/*.normTex.asset
_VatAnimFps Baked animation fps
_VatAnimLength Baked animation length[sec]

It is recommended to duplicate the material under Assets/VatBakerOutput and change the shader so that the original property values can be used as they are.

Example Asset

Reference

vatbaker's People

Contributors

fuqunaga avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vatbaker's Issues

URP Support?

Any chance this gets URP support? I'm trying to make my own, maybe I can fork it and update it to URP, only think needed would be subgraph I guess, everything else seems to be working fine

Some animation are off

On the first model I was testing only 2 animations out of 12 tested looked correct. Figured out the clip.length seemed to be rounded wrong. I have changed to clip.length +.000001f on the Bake function and then all the animations look correct.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.