See how Developer Tiberiu Stefan made their transforming wall effect for Psych Rift using Vertex Animation Textures in Godot.
Tiberiu Stefan from
Ablaze Interactive showed us how they created the wall transformation effect from
Psych Rift, an
upcoming horror game built in Godot.
The effect uses Vertex Animation Textures, or VAT: the movement of each vertex gets baked into a texture, and the shader reads that texture to recreate the animation. This makes it very efficient for complex effects.
The wall transformation is made of two separate VAT meshes:
- The outer wall surface
- The brick wall underneath
They were split to keep each mesh below 4096 vertices, which is the limit Tiberiu used for this setup.
The outer wall surface has 4016 vertices and was animated in 3ds Max using modifiers like XForm and Bend.
According to Tiberiu, the final modifier stack ended up using 65 modifiers to achieve the transformation they were looking for.
The brick wall is a different story. It has 437 individual bricks and 3496 vertices. Tiberiu rigged all the bricks with bones, which made the animation easier to control.
VAT comes with a few restrictions. The entire animation has to stay inside a single mesh, and the topology cannot change from one frame to the next.
It also requires a special UV layout on UV channel 2. Tiberiu made this using a small script, which links each vertex to its position in the VAT texture.
Tiberiu generates the VAT textures using tyFlow and uses them in Godot as .exr files. These textures need to stay uncompressed, since any compression ruins the vertex data inside them.
For example, the wall surface needed 85 frames to avoid artifacts. The brick wall needed 45.
One recent improvement was moving the flat normal calculation into the shader. Before this change, normals had to be baked into the VAT texture, which doubled the memory cost.
Now the shader calculates them itself, cutting the VRAM usage in half. According to Tiberiu, this works well on models with mostly flat surfaces.
If you want to follow the release of Psych Rift, the links will be right below.
If you want to learn more about shaders in Godot,
The Godot Shaders Bible covers topics like stylized shading, screen-space VFX, lighting, and vertex manipulation through step-by-step examples.
It is a good starting point for developers who want to better understand how shaders work and improve the visuals of their games.
Not sure about it yet? Check out the live preview!