UNITY SHADERS FOR VERTEX ANIMATION EXPORT TOOLS
Setting up the unity shaders is relatively straight forward but there are a couple of things you need to change to the import settings of the mesh and textures for correct results. Watch the video or follow along with the details below.
1. Setting up the shaders
- Download the latest version of the Game Dev tools from GitHub - https://github.com/sideeffects/GameDevelopmentToolset/tree/Development
- Drag and Drop the Unity shaders from the downloaded folder into your Unity project.
- Create a material and set the shader to the desired vertex animation shader.
2. Import the Mesh and Textures into your project and match the Import Settings below.
Texture Import Settings
Mesh Import Settings
3. Assign the textures to the material and match the values from Houdini.
The BBOX Max and Min values are setup for ue4's unit scale so divide the value by 100 when setting the numbers in Unity.
Issues with the rbd rotation texture
The setup above works for most of the textures except for one little problem - the rbd rotation texture. If you setup an rbd material and set the speed to 0, you will notice that in my simple example we can see the cracks between the chunks before the object has started moving. This is not correct.
To fix this we have to make a change to the colour space setting of the project. If you're already in the middle of a project and using the gamma color space this is a problem because it will change all of your textures as well as the look of the lighting. If you know a better way of doing this please let me know. Below are the changes you need to make to fix this for now.
Change Color Space
You can change the colour space by going to the menu Edit > Project Settings > Player. Under "Other Settings" change color space from Gamma to Linear.
Change the Texture Import Settings for the rotation texture
You can read more about how Unity deals with linear textures here - https://docs.unity3d.com/Manual/LinearRendering-LinearTextures.html
Change the Texture Type to Editor GUI and make sure Wrap Mode is still set to Repeat
I don't think this is the best way to handle this so if you find a better way please let me know!