Fortunately, the visual nature of shaders has given rise to various “toys” you can use to quickly see what they’re doing.
The appropriately named “Shadertoy” is a good example: it’s an online tool that lets you write GLSL — OpenGL’s flavour of shader language — directly into your browser, which is then rendered using WebGL. Shadertoy also has a repository of shaders, so if you’re looking for a specific effect, you can learn how someone else has done it and build on their efforts.
In my case, I had to become familiar with Microsoft’s shader language, HLSL. My playground was Unity, a development environment and engine designed for building games. It follows the traditional material workflow you see in 3D modelling packages, where you can combine textures, variables and a shader into a “skin”, and apply that to a mesh. This made it easy for me to try things out and see the results immediately.
Bret Victor, a former Apple UI designer who came up with the initial interface concepts for the iPad, shows the benefits of this “instant” approach in the following talk:
Any programmer would grimace at the thought of the time they’ve lost waiting for something to compile and will do anything they can to speed up the process. It makes sense to apply this logic to learning and trying out new things.
If failing faster is the way to success, then make sure the tools you’re self-educating with let you do that!