Smoke, mirrors, and scrolling textures: Behind the scenes of TUNIC
To ensure optimal performance, Shouldice used dynamic lighting and Global Illumination (GI) in TUNIC, and carefully considered the light count: “Because deferred rendering isn’t supported with ortho cams, light count was something I needed to keep an eye on. I used precomputed GI to do a lot of the lighting rather than Point lights, and leaned on batching to keep draw calls down.”
He used to write shaders by hand, but decided to use Shader Forge’s node-based shaders for TUNIC. “Even though I can write code, I’m a fairly visual person, so it was freeing to be able to see live previews and organize my thoughts spatially,” continues Shouldice. “The node editor clicked with my brain in a really nice way. It’s supremely noodly, and so much fun!”
Shouldice also made extensive use of scrolling textures to light up elements of the game world, substantially reducing the complexity of the task while achieving gorgeous (and highly performant) results.
Early in the game, TUNIC’s hero opens a golden doorway by interacting with a statue that emits a pulse of light when touched. Shouldice achieves this effect by using a few different components in the Unity Editor and Shader Forge.
The initial points of light – known as “starburst” – derive from three animated meshes, each rotating slightly out of sync. A donut-shaped “aura ring” surrounds these meshes, and by projecting a scrolling UV texture along this flattened cylinder, Shouldice makes the texture scroll outward, creating a radial glow. For this effect, UV coordinates are scrolled and multiplied before they’re inverted at the end to create the glow’s white-on-black effect.
By applying the scrolling texture to different meshes, Shouldice was able to change the glow’s behavior. In another example, he funnels the texture up a narrow, cone-shaped mesh to create the effect of magical energy coalescing skyward.