Field Notes: Shaders Are Spells

I done handcuffed lightning. And put thunder in jail.

A screen capture from the UI Material Lab example project in Unreal that shows of several material effects for Unreal Motion Graphics.
This example project was free from Unreal, and includes both hearts AND cats.

I've been working on graphics effects recently, what with all the hazards I've been developing, and not for the first time I've remarked to myself how incredibly wizard-like coding graphics makes me feel. It's truly a mix of arcane knowledge, positioning of powerful symbols, and the creation of a web of mystic interconnections to produce a concrete effect.

Take, for example, the lightning storms that pass over the ship in Running Late. Here's the spell for creating the bolt of energy across a plane.

A picture showing the visual programming graph of the lightning shader used in Running Late.
I learned this from CodeLikeMe, who has a lovely YouTube channel. If you're into game development, I've found a LOT of their videos helpful. Check them out!

Now, I can tell you this is variation of another spell called Generated Band, that takes a noise source as an input. I can tell you that Time is an input to this spell so that the electricity can grow and shrink as time goes on. I can show you the parameters that govern how wide the electrical bolts can be, what color they are, how they pulse.

But it honestly feels completely amazing to me this works at all. Like, I know it DOES work, I've seen it work, I can make it do what I want. But that doesn't mean I understand it. I am but a student of an arcane art for which answers are buried under years of learning.

Still, how cool is this effect?

A screen capture of the lightning shader at work, with jagged lines and frayed edges.
Literally magical.

It feels like we're in an amazing time to be developing video games. Don't get me wrong. I understand the pessimism of the field—things are so perennially a mess that someone keeps a live tracker of layoffs in the video game space. But between the vast sum of knowledge growing daily on YouTube and the swathes of high quality, nearly free software available, there's almost nothing you can't make happen in a video game.

Do you want to make a 3D model? You could use any of several professional applications, such as Maya or ZBrush. Or you could use the absolutely free and honestly quite good Blender. Do you want to create incredible looking textures for that model? Welcome to Adobe Substance Painter, or ArmorPaint, or Blender plugins like ucupaint.

Maybe you're a 2D artist, chasing those halcyon days of sprites and pixels? Aseprite is literally available on the Steam store for $20. PyxelEdit is half that cost. Maybe you're more into audio than visual? Audacity is free as in beer. The amount of incredibly powerful tools we have at our disposal as a society is truly staggering and almost every tool you might use has dozens of hours of YouTube videos showing you how to do cool things with those tools.

So yeah, I have been feeling like a wizard, but not just any kind of wizard. I feel like a wizard attending a wizard college, where classes are all elective, the library is full of personal biographies that include spells, and I'm able to make things of my own that I used to only dream of doing. I'm able to leverage all this stuff to make art I want to bring forth into the world.

It's magic at my fingertips.