GithubHelp home page GithubHelp logo

badjano / vatbaker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fuqunaga/vatbaker

7.0 0.0 1.0 40.95 MB

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

License: Other

C# 12.53% HLSL 13.39% ShaderLab 74.07%

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

badjano avatar fuqunaga avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

dguliev-github

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.