One I’ve thing noticed is that it’s hard to find good shader programming resources, especially for people with an artistic or non-technical background. Luckily there’s really been an upswing in accessibility since node-based shader editors became a thing, which has been a great entry-point for a lot of artists. But nodes have their limits, and I’ve realized that they work even better when acting as a complement to shader knowledge, rather than a replacement for it.
Below I’ll share some resources I’ve come across, with their usefulness depending on what sort of situation you currently find yourself in. I strongly encourage everyone to share their tips as well! I’m by no means an authority on the subject, but if you’re curious about anything specific, don’t hesitate to ask. I’m currently working on a tutorial on how to make a rudimentary GPU particle system in Unity using shader programming, so stay tuned for that
I know my way around node-based editors, but programming is intimidating!
Starting from zero is always daunting, but if you know how to author shaders in a node-based editor, you’re already half-way there. The principles are the same, but the approaches are a bit different. If you’re just looking to get your toes wet with programming, I warmly recommend Codecademy and their course on Python. It’s assumes no prior knowledge and progresses at a very managable pace. While Python doesn’t quite look or read like shader code does, it’s a fantastic way to learn about fundamental programming concepts and practices.
I would also recommend a series on Youtube called Let’s Learn C++. Also aimed at beginners, it serves as a good entry point to one of the more daunting programming languages. Once you’re familiar with the C++ syntax, shader languages such as HLSL and Cg should come naturally to you.
I’m comfortable with programming in general, now I want to get started with shaders!
I feel this is kind of the most tricky scenario, and very much the reason why I created this post in the first place. If you’re like me you’ve probably stumbled upon Unreal’s “introduction” to shader programming and left more confused than when you arrived.
Most resources I’ve found are geared towards graphics programmers, which really starts you off at the deep end of things. It gets even trickier when you’re looking to do vertex animation, screen-based effects, or anything other than than your everyday Lambertian pixel shader.
Most of the examples mentioned are specific to Unity. Which isn’t bad per se, but they do rely on a few Unity-specific functions that can be difficult to replicate elsewhere. I’m afraid the other resources I found are a bit unthematic, but I figured I’d mention them anyway:
I get the programming stuff but I don’t quite understand the math!
You’re not alone, let me tell you. I doubt I’m the only one who’ve used stuff like Sine without ever knowing what it actually does besides “make things blink”. Node-based editors tend to teach you what things are used for, but not how they work. Learning the math behind shaders really helps with this, and it cannot be overstated how much it helps your shader-building confidence and efficiency.
Khan Academy is my go-to place for this stuff, and I revisit them regularly. They explain scary subjects such as vectors and matricies in a very engaging manner. The material they have on trigonometry is a bit more challenging, but extremely useful as well. If you want to get really in-depth, their Essence of Linear Algebra course is for you.
There’s also a series on Youtube called Math for game developers, by Jorge Rodriguez. While he assumes some programming knowledge, he does a fantastic job of explaining specific mathemathical concepts that are relevant to all aspects of game development. It’s platform agnostic, and focuses on theory rather than implementation.
If you’re a visual learner, Immersive Math is a really cool “interactive math book” that allows you to play around with various examples in real-time.
I’m new to shaders and not even all that good with node-based editors, where I can learn more about those?
Thankfully there’s tons of resources on this! This subject is has gotten relatively accessible as of late. Honestly, my best advice would be to figure out what it is you want to achieve and just google it.
While different packages all have their own editors they’re still authoring the same kind of shaders, which means that knowledge is easily transferred between them. Oftentimes it’s just a matter of learning a new word for something you’re already familiar with (for example, Clamp and Saturate do basically the same thing).
The best place to start is of course the official documentation, e.g. UE4 or Shader Forge. In addition, here’s a couple of very practical examples