Look at the paving between the two ninjas in Lantern Yard. That pink blossom is a metal inlay. Normally it’s gold. The violet on the edges of the stones comes from the two ends of a Shadow Warp. A moment later the blossom will still be there and the stones will have gone back to their usual color. One of the biggest changes to SHADOWFRAG’s look is that a fight can now light up the place where it happens.

We moved the game from raylib and OpenGL to our own Vulkan renderer in October. The first job was to get the familiar game back on screen. The big visual change came in late November, when we rewrote how the renderer draws light, surfaces and combat effects. We kept captures from November 20 as well as December 2. Both sets are running on Vulkan. Side by side, they show what we actually made with it.

A rail shot and the shape of lightning

Follow the Lightning trail across the top row below. In the November frame it’s a faint zigzag, about the same thickness from one end to the other. In December there’s a bright spine you can trace all the way to the hit. Short forks peel away from it and fade. Below it is Nova, the finisher that appears where a ninja falls. The old effect looks like a wheel built from orange matchsticks. In the new one, a hot rim holds together between the spikes. You can see right through its center.

November 20 and December 2 studio captures side by side. A thin zigzag gains electric forks, and a wheel of orange strokes becomes a bright ring with an open center.
November 20 on the left, December 2 on the right. Follow the forks along the Lightning rail trail in the top row and the outer rim of the Nova finisher below.

Those two shapes help explain why we rewrote the effects. The old renderer assembled the marks on the CPU. For the new rail trail, the game hands the graphics card the ends of the shot, its style and how long ago it fired. A shader, a small program on the graphics card, works out what you see from where you’re standing. The shot still follows the same path. We can give the bolt a narrow hot core and a softer edge, or leave a hole through the middle of a ring. Look along a Ray Gun shot and the rings have openings. Look across it and you can see the space between them.

What a moving ninja leaves behind

Watch the cloud over the ninja’s head in the first pair of clips. In November, a few dark puffs overhead and streaks of rain did most of the work for the Storm aura. In December the cloud lights up from inside. For an instant you can follow a fork of lightning all the way down past the ninja’s knee. The flash gives the cloud a shape you lose again when the light goes out.

Four effects from the two builds, played side by side. Each sequence repeats so you can follow one side and then the other. Silent, 16 seconds.

Sakura, the second pair, moves differently for a reason. Storm is a spree aura, so it belongs to the living player and stays overhead. Sakura is a glide, the effect a ninja sheds while moving along the ground. Look just behind the heel. The older petals bunch up in a pink blur. In the new glide you can pick out the notch in a blossom and watch the petals turn separately as the runner leaves them behind. You can follow those petals back along the runner’s path.

When the arena catches the light

We froze the warp in Lantern Yard and rendered the same instant twice. On the left below, both ends of the warp glow, but the metal blossom stays gold. On the right we switched on the light each end casts onto the world. The blossom turns pink. Look just outside the circle and you can pick out the violet edges of individual stones.

The same violet warp seen twice. The blossom in the paving is gold with local lighting off and glows pink with local lighting on.
Same map, camera and instant. Even with local lighting off, the warp itself shines. Turning on its lights changes the metal blossom from gold to pink and picks out the edges of the stones around it.

Each light falls away with distance. You can see that in the timber posts beyond the ring, where the lanterns are still warm. Breaking armor casts gold onto its surroundings. A broken Chi Shield casts cyan, even when the player chose a different color for the shield itself. If you’re following someone through a busy courtyard, that brief patch of color can tell you what just broke.

There are two kinds of glow at work here. The light on a paving stone depends on where the stone is. The soft halo around a bright effect is bloom. The renderer keeps the intensity of the brightest parts of a frame, spreads some of that light into neighboring pixels, then fits the result to the display. A rail can have a near-white center and a colored fringe while the dark doorway behind it stays dark. The optional player outline goes on afterward, so the halo around a shot doesn’t swallow the outline of the ninja who fired it.

Stone, steel and water up close

The same lighting has different work to do on the surfaces you see all match. A chip in a stone or a groove in a plank can catch light on one edge while the other stays in shade. The surface shader changes how the light meets that patch of material. The block you run across is still flat. Up close, linked wire in a ninja’s armor has a pattern you can make out. Across the courtyard the links blend into steel, where drawing every one would make the suit sparkle as it moved.

A sheet of turquoise water falls between two dark rock faces. Pale foam gathers at its foot and broken bands of reflected light stretch across the pool.
At Twin Castles the pale vertical streaks belong to the falling sheet. The broken highlights below it follow the ripples across the pool.

At Twin Castles, watch where the waterfall meets the pool. The pale lines on the vertical face follow the falling water. Below them the highlights break sideways across the surface as ripples tilt toward and away from the sun. The water shader can also tell how far the solid bed lies behind the surface. That gives shallow edges a trace of foam and deeper water a stronger tint. Lower your view toward the surface and it picks up more of the sky.

A grenade and a gust in the same courtyard

The same courtyard seen twice. An orange grenade blast spreads over the cobbles on the left. On the right a pale Wind Cannon ring surrounds a cloud of mist and red leaves.
The same spot in Lantern Yard a fraction of a second after impact. The grenade fills the center with fire. The Wind Cannon throws leaves through a pale ring, and you can still see the paving inside it.

The grenade on the left starts with a white flash just above the ground. Orange lobes swell out from it, a ring spreads across the floor, and the core burns down to cinder red. Smoke stays warm at its base while there’s still fire underneath. As it cools, the courtyard shows through again. Where smoke meets a step, the renderer uses the depth of the stone to soften the join. You don’t get a sharp line cutting a puff in half.

For the Wind Cannon on the right, the challenge was drawing something you can see through. Wisps pull inward at the impact, then a shell of condensation travels back out, carrying leaves with it. At its rim the renderer bends the image of the courtyard by a few pixels. A straight edge behind the wave briefly bows and settles back as the gust passes. Look at the blossom under each hit. In the grenade frame its far edge disappears into the fire. In the wind frame you can follow its outline through the gust.

Back to blogBrowse the glossary