Vertex Animation Textures Guide
The Vertex Animation Textures asset, commonly known as VAT, enables you to render simulations from SideFX's Houdini and import them into Lens Studio. This asset is useful for dynamic simulations that would be difficult to animate, such as fluids, or require a lot of data to store and render, such as softbody or rigidbody simulations.
By the end of this guide, you will learn the following:
- How the VAT resource works
- How to export simulations from Houdini into Lens Studio
- How to achieve the best results in Lens Studio.
Requirements
This guide is an advanced topic that assumes you have an understanding of the following:
- Houdini 18.0
- Particle Simulations and Rendering
You can add a dedicated VAT asset to your project through the Asset Library.
How it works
The Vertex Animation Textures asset uses data stored in one or more textures to animate the vertices of a mesh.
This uses the same underlying technique as Vertex Animation. However, Vertex Animation uses an FBX and stores data for each vertex using animation keyframes, whereas the Vertex Animation Textures asset stores the data in separate textures and animates it using a vertex shader. This can improve both performance and memory costs. The Vertex Animation Textures asset also enables you to run simulations with inconsistent topology, such as fluids, and provides additional artistic controls.
First, Houdini processes the simulation and stores it as a mesh and series of textures. Each pixel contains data about the position, rotation, or normals of a vertex during a specific frame in the animation. The types of data stored depend on the type of animation rendered.
Once imported into Lens Studio, the vertex shader in the Vertex Animation Textures material processes the texture data and applies it to the vertices in the mesh.
Exporting a simulation from Houdini using the Labs Vertex Animation Textures (VAT) Node
Before starting, make sure you can create older versions of the Labs Vertex Animation Texture (VAT) output node. To do this in Houdini:
-
Navigate to:
Houdini FX → Preferences → Shelf Tools and Tab Menu
. -
Under
TAB Menu and Namespace Filtering
, selectShow All Operators
.
After you have your simulation ready and older versions of the Labs Vertex Animation Textures (VAT) output node available in Houdini, we can export the simulation.
Exporting the simulation
- Create a Labs Vertex Animation Textures (VAT) node in the
Out
network. The fastest way to do this is to type "VAT" in the tab menu.
Make sure the Labs Vertex Animation Textures (VAT) node correct version by clicking the Info
icon on the node. The node version should be Labs Vertex Animation Textures Driver (labs::vertex_animation_textures)
, with no numbers following vertex_animation_textures
. If you see a version number, delete the node and try a different version from the context menu.
- Change the
Method
parameter to an appropriate type for your simulation: Softbody, Fluid, Rigidbody, or Sprite.
The differences between simulation types are:
- Softbody maintains consistent topology throughout the simulation that deforms over time, such as draped or waving cloth.
- Outputs: Mesh, Position Map, and Normal Map.
- Fluid changes topology between frames, such as fluid or smoke.
- Outputs: Mesh, Position Map, and Normal Map.
- Rigidbody maintains consistent geometry using packed geometry pieces with rigidbody physics, such as glass breaking or concrete fracturing.
- Outputs: Mesh, Position Map, and Rotation Map.
- Sprite outputs multiple camera-facing quads, such as particle simulations.
- Outputs: Mesh and Position Map.
- Set the
Export Node
parameter to the Geometry or SOP path that captures your simulation’s final geometry.- Optionally, you can change the
Target Texture Size
, which controls the maximum width of the exported texture maps.
- Optionally, you can change the
Lens Studio cannot import images larger than 2048x2048 pixels.
-
Change the
Position Map Path
file extension from EXR to PNG. -
Ensure
Normalize Data to 0-1
space is checked. -
For Softbody and Fluid simulations, set up the Normal Map parameters.
- Uncheck
Pack Normal into Alpha
. - Change the
Normal Map Path
file extension from EXR to PNG.
- Uncheck
-
For Rigidbody simulations, set up the Rotation Map parameters.
- Change the
Rotation Map Path
file extension from EXR to PNG. - Right-click on the Labs Vertex Animation Textures (VAT) output node and click
Allow Editing of Contents
.
- Double-click on the Labs Vertex Animation Textures (VAT) node to dive into the network.
- Find the Rigidbody group and select the
RENDER_ORIENT
node. - On the
RENDER_ORIENT
node’s parameters, go to theMetadata
tab, and change thePNG/TGA Premultiplication
parameter toUnpremultiplied
.
- Change the
Alternatively, you can export the Rigidbody Rotation Map as an EXR image and convert it to unpremultiplied alpha using the SideFX Image Viewer. To do this:
- Open the Rotation Map EXR file in SideFX Image Viewer.
- Navigate to
File → Save Frame As
. - Set the Rotation Map's
Format
toPNG
,Image is
toUnpremultiplied
, and enableConvert to Image Format's Colorspace
.
-
Click
Render
. -
After the simulation has rendered, note the information under
Data for Realtime Shader
. This data will be used to set up the Vertex Animation Textures material in Lens Studio.
Importing the Vertex Animation Texture simulation into Lens Studio
Now that your simulation has been exported from Houdini, you can import it into Lens Studio.
-
Add the Vertex Animation Textures asset to your project through the Asset Library.
-
Import the mesh and texture map(s) into Lens Studio by clicking
File → Import
and selecting the relevant assets. -
Click on the imported texture map(s) in the
Asset Browser
panel and change theCompression Settings → Optimization Type
toNone
. -
In the Object Hierarchy, adjust the imported mesh’s
Scale
as necessary (typically by a factor of0.01
to0.1
). -
Create a Vertex Animation Textures material by modifying or duplicating a VAT Template material from the
Asset Browser
panel. Alternatively, you can copy and paste theVertex Animation Texture
subgraph and associated parameters into another material, and connect thePosition
andNormal
outputs to thePosition
andNormal
ports on theShader 3D
node. -
On your Vertex Animation Textures material, adjust the following material parameters:
- Change
Mesh Type
to match your simulation type. - Assign the Position Map texture to the
Position Map
parameter. - Assign any other relevant maps (such as Rotation or Normal maps).
- Enter the values for
Number of Frames
andBBOX Max/Min
from Houdini'sData for Realtime Shader
output. - For Rigidbody simulations, enter
BBOX Max1/Min1
from Houdini'sData for Realtime Shader
output. - Optionally, you can adjust any other
Vertex Animation Textures
material parameters as you see fit. Example optional parameters includeInterpolation
,Speed
, andSprite Scale
.
- Change
-
Fine-tune your Vertex Animation Textures material as needed to achieve the result you are looking for.
Parameters
Some parameters within the Vertex Animation Textures subgraph only affect specific simulation types. The subgraph hides irrelevant parameters by default.
Inputs
Mesh Type
The type of simulation being rendered. This should match the export parameter used in Houdini. The four mesh types are:
- Softbody maintains consistent topology throughout the simulation that deforms over time, such as draped or waving cloth.
- Fluid changes topology between frames, such as fluid or smoke.
- Rigidbody maintains consistent geometry using packed geometry pieces with rigidbody physics, such as glass breaking or concrete fracturing.
- Sprite outputs multiple camera-facing quads, such as particle simulations.
Position Map
A PNG file that contains the Position Map created by Houdini. Position is used by all 4 simulation types.
Normal Map
(Softbody and Fluid only) a PNG file that contains the Normal Map created by Houdini.
Rotation Map
(Rigidbody only) a PNG file that contains the Rotation Map created by Houdini.
Interpolate
(Softbody and Rigidbody only) When enabled, creates a smoother animation by linearly interpolating data between frames. You can also use interpolation to optimize your projects by using less data from Houdini. See the Tips section for more information.
Interpolation Rate
(Rigidbody only) Useful for reducing jitter in Rigidbody animations. A value of 1 creates linear interpolation between every frame, 2 between every 2 frames, 3 between every 3 frames, and 4 between every 4 frames. Though higher Interpolation Rate
values create smoother animations, they may cause your animation to look less lively.
Speed
The playback speed of the animation. The default speed of 1.0
plays the animation at normal playback speed.
By default, Houdini animations play at 24 FPS, while Lenses play at 30 FPS. To get more consistent results between software, you can change Houdini’s FPS to 30.
Number of Frames
The total number of frames in the simulation. Houdini’s Labs Vertex Animation Texture (VAT) output node provides Number of Frames
under Data for Realtime Shader
after rendering a simulation.
BBOX Max/Min
The bounding box for the animation. Houdini’s Labs Vertex Animation Texture (VAT) output node provides BBOX Max/Min
under Data for Realtime Shader
after rendering a simulation.
BBOX Max1/Min1
(Rigidbody only) The secondary bounding box for the animation. Houdini’s Labs Vertex Animation Texture (VAT) output node provides BBOX Max1/Min1
under Data for Realtime Shader
after rendering a Rigidbody simulation.
Sprite Scale
(Sprite only) the size of the quads used for Sprite simulations. This enables you to scale the entire simulation and the size of the Sprites independently.
Manual Playback
Toggle used to play the animation at a specific frame. This is useful for controlling animations via script and debugging.
Frame
The frame shown while Manual Playback
is enabled.
Outputs
Position
The final worldspace Position of each vertex. This should be connected to the World Position
port of the Shader 3D
node in your material. If you want to perform additional vertex animations (such as adjusting position based on noise), these operations should be done after the Vertex Animation Texture subgraph.
Normal
The final worldspace Normal of each vertex. This should be connected to the World Normal
port of the Shader 3D
node in your material.
Current Texture Coordinate
The UV coordinate used to calculate vertex animation data from a texture. This can be used to read additional texture maps, such as Color Maps, exported by the Houdini’s Labs Vertex Animation Texture (VAT) output node. It can also help control additional effects on a per-vertex or per-frame basis. Each UV coordinate corresponds to a specific vertex (U) at a specific frame (V).
The “Color by Vertex” simulation (left) uses the U coordinate to control a gradient, which assigns a different color to each vertex particle in the simulation. The U coordinate is the normalized 0-1 value of the index of a vertex (vertex ID / total vertices). It can be used in similar ways to Particle Index Ratio in the VFX graph.
The “Color by Time” simulation (right) uses the V coordinate to control the color over the animation’s time. The V coordinate is a normalized 0-1 value indicating the current place within the animation (current animation frame / Number of Frames
).
The Labs’s Vertex Animation Texture (VAT) output node stores frames from top to bottom (1 to 0 on the V axis). By default, this means that the V coordinate uses a value of 1 for the start of the animation and 0 for the end of the animation. In Lens Studio, you can use a One-Minus node in your material to make V go from 0 to 1 instead. The Sprite example within the Vertex Animation Textures asset shows this method.
Tips
While Vertex Animation Textures are generally a great way to render complex animations, they can still take up a lot of space relative to the 8MB limit of Lenses. Here are a few ways to help optimize your projects:
-
Reduce the number of vertices of the original simulation within Houdini. This can include reducing the original number of points on the geometry for Softbody and Rigidbody simulations, using dynamic remeshing with multiple iterations on Fluid simulations, reducing the detail of Rigidbody fracturing, and reducing the number of particles per frame for Sprite simulations.
-
(Rigidbody and Softbody only) Use
Interpolate
to calculate data between frames. Within Houdini, you can increase the timescale of the simulation by 2 to output every other frame of the original animation. Note that you may need to increase the number of substeps when increasing the timescale. Then, within Lens Studio, use theInterpolate
toggle on your material to compute the middle frames. You may need to change theSpeed
of your animation by half to correct the timing. This can effectively halve the amount of data needed to render the simulation while maintaining visual quality. -
(Softbody and Fluid only) Use Screen Space Normals instead of Normal Maps. Normal maps often have a large memory footprint in Fluid and Softbody simulations. Using Screen Space Normals instead of the Normal Map texture allows you to reduce the total size of your Lens. However, this can also sometimes reduce visual quality. See the Screen Space Normals Generation guide as well as the Fluid Screen Space Normals example in the Vertex Animation Textures asset to see implementation of this technique.
You can also use Screen Space Normals on Rigidbody and Sprite simulation. However, Rigidbody and Sprite simulations calculate their normals during VAT processing instead of using a Normal Map, so this may not grant any additional performance benefits.
Troubleshooting
Here are solutions to a few common issues that might occur while working with the Vertex Animation Textures asset:
-
The simulation looks chunky, spiky, or glitchy: Double check that the texture map’s
Compression Settings → Optimization
is set toNone
.-
Lens Studio may ask you if you want to optimize your project on load, which can also cause this effect on your textures even if they previously had optimization off. Make sure you carefully read dialogue pop ups when they appear so as to not accidentally compress resources.
-
You can also disable compression on import in Lens Studio by going to
Preferences
and un-checkingAuto Compress Textures
.
-
-
The simulation disappeared or drastically changed after making a change in the Material Editor: Check that your material’s parameters are all set to the correct values for your simulation. Sometimes changing settings within a parameter or renaming it will cause the parameter to revert to its default value. This can cause unexpected behavior in the animation such as moving, disappearing, or stopping.
-
The simulation’s normals or UVs look incorrect: Make sure that your normals or UVs have been explicitly created within Houdini before exporting.
-
Houdini will not exit the Compositing stage after clicking
Render
: When you click Render, the button will turn blue as it is rendering, then return to gray once rendering has finished. You can safely clickInterrupt
on the Interrupt pop-up onceRender
has returned to gray. You can also clickRender
a second time, and the Interrupt pop up will not appear as long as you have made no changes to the simulation.