VatBaker
所属分类:图形图像处理
开发工具:ShaderLab
文件大小:24437KB
下载次数:0
上传日期:2022-08-25 07:19:13
上 传 者:
sh-1993
说明: 用于从AnimationClip烘焙VAT(顶点动画纹理)的工具,具有Unity的示例着色器。
(A tool to bake VAT (Vertex Animation Texture) from AnimationClip with sample shaders for Unity.)
文件列表:
.idea (0, 2022-08-25)
.idea\.idea.VatBaker (0, 2022-08-25)
.idea\.idea.VatBaker\.idea (0, 2022-08-25)
.idea\.idea.VatBaker\.idea\encodings.xml (169, 2022-08-25)
.idea\.idea.VatBaker\.idea\indexLayout.xml (198, 2022-08-25)
.idea\.idea.VatBaker\.idea\vcs.xml (180, 2022-08-25)
Assets (0, 2022-08-25)
Assets\Fbx.meta (172, 2022-08-25)
Assets\Fbx (0, 2022-08-25)
Assets\Fbx\rhino-animation-walk.meta (172, 2022-08-25)
Assets\Fbx\rhino-animation-walk (0, 2022-08-25)
Assets\Fbx\rhino-animation-walk\source.meta (172, 2022-08-25)
Assets\Fbx\rhino-animation-walk\source (0, 2022-08-25)
Assets\Fbx\rhino-animation-walk\source\Rhino Walk.meta (172, 2022-08-25)
Assets\Fbx\rhino-animation-walk\source\Rhino Walk (0, 2022-08-25)
Assets\Fbx\rhino-animation-walk\source\Rhino Walk\Rhino Base.tga (3145772, 2022-08-25)
Assets\Fbx\rhino-animation-walk\source\Rhino Walk\Rhino Base.tga.meta (2170, 2022-08-25)
Assets\Fbx\rhino-animation-walk\source\Rhino Walk\Rhino Normal.tga (2343793, 2022-08-25)
Assets\Fbx\rhino-animation-walk\source\Rhino Walk\Rhino Normal.tga.meta (2170, 2022-08-25)
Assets\Fbx\rhino-animation-walk\source\Rhino Walk\Rhino Walk.fbx (5930656, 2022-08-25)
Assets\Fbx\rhino-animation-walk\source\Rhino Walk\Rhino Walk.fbx.meta (3541, 2022-08-25)
Assets\Fbx\rhino-animation-walk\textures.meta (172, 2022-08-25)
Assets\Fbx\rhino-animation-walk\textures (0, 2022-08-25)
Assets\Fbx\rhino-animation-walk\textures\Rhino Base.png (1260915, 2022-08-25)
Assets\Fbx\rhino-animation-walk\textures\Rhino Base.png.meta (2170, 2022-08-25)
Assets\Fbx\rhino-animation-walk\textures\Rhino Normal.png (1389733, 2022-08-25)
Assets\Fbx\rhino-animation-walk\textures\Rhino Normal.png.meta (2170, 2022-08-25)
Assets\Scenes.meta (172, 2022-08-25)
Assets\Scenes (0, 2022-08-25)
Assets\Scenes\Example.unity (73974, 2022-08-25)
Assets\Scenes\Example.unity.meta (155, 2022-08-25)
Assets\Scenes\PerformanceTest.meta (172, 2022-08-25)
Assets\Scenes\PerformanceTest.unity (12000, 2022-08-25)
Assets\Scenes\PerformanceTest.unity.meta (155, 2022-08-25)
... ...
# VatBaker
A tool to bake [VAT (Vertex Animation Texture)][VAT] from AnimationClip with sample shaders for Unity.
[VAT]:https://medium.com/tech-at-wildlife-studios/texture-animation-techniques-1daecb316657
![](https://github.com/fuqunaga/VatBaker/blob/master/Documentation~/vatbaker.webp)
# 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" ]
```
![](https://github.com/fuqunaga/VatBaker/blob/master/Documentation~/2022-04-12-17-29-38.png)
**Window > Package Manager**
Select `MyRegistries` in `Packages:`
![](https://github.com/fuqunaga/VatBaker/blob/master/Documentation~/2022-04-12-17-40-26.png)
Select `VatBaker` and click the Install button
# Usage
1. **Window > VatBaker**
1. Set a GamObject with Animation and SkinnedMeshRenderer.
1. (Optional) Set other parameters.
1. Push the Bake button.
1. Assets are created under `Assets/VatBakerOutput` and a VAT GameObject is put in the hierarchy.
![](https://github.com/fuqunaga/VatBaker/blob/master/Documentation~/vatbaker_window.webp)
# Use VAT on your shader
### Use VAT functions at the vertex shader.
```hlsl
#include `Packages/ga.fuquna.vatbaker/Shader/vat.hlsl`
```
vertex shader
```hlsl
float animationTime = CalcVatAnimationTime();
float vertexPositionLocal = GetVatPosition(vertexId, animationTime);
float vertexNormalLocal = GetVatNormal(vertexId, animationTime);
```
See [VatUnlit.shader][VatUnlit], [VatSurfaceStandard.shader][VatSurfaceStandard]
[VatUnlit]:https://github.com/fuqunaga/VatBaker/blob/main/Packages/ga.fuquna.vatbaker/Shader/VatUnlit.shader
[VatSurfaceStandard]:https://github.com/fuqunaga/VatBaker/blob/main/Packages/ga.fuquna.vatbaker/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
- [Rhino Animation Walk](https://github.com/fuqunaga/VatBaker/blob/master/https://sketchfab.com/3d-models/rhino-animation-walk-a915d9179fe***22b9d669a3a0d726b8e) GremorySaiyan [(Licensed under CC BY 4.0)](https://github.com/fuqunaga/VatBaker/blob/master/https://creativecommons.org/licenses/by/4.0/)
# Reference
- [Texture Animation: Applying Morphing and Vertex Animation Techniques](https://github.com/fuqunaga/VatBaker/blob/master/https://medium.com/tech-at-wildlife-studios/texture-animation-techniques-1daecb316657)
- [VertexAnimator](https://github.com/fuqunaga/VatBaker/blob/master/https://github.com/nobnak/VertexAnimator)
- [Animation-Texture-Baker](https://github.com/fuqunaga/VatBaker/blob/master/https://github.com/sugi-cho/Animation-Texture-Baker)
近期下载者:
相关文件:
收藏者: