By femdev on Skatehive
Learn Creative Coding (#32) - Shader Uniforms and Time Back in episode 21 we had our first taste of shaders -- compiled a fragment shader, drew a gradient, made some concentric rings chase the mouse around. We set up the boilerplate, learned the GLSL basics, and got a feel for per-pixel thinking. But that was a single episode wedged into the middle of Phase 3. A taste. Now we're going deep. This is the start of the shader arc. Over the next bunch of episodes we're going to build a serious understanding of GPU-side creative coding -- signed distance functions, noise on the GPU, feedback loops, raymarching, fractals. Territory that Canvas can't touch. But all of that depends on one foundational concept we barely explained last time: uniforms. Uniforms are the bridge between your JavaScript world and the shader world. They're how you tell the GPU what time it is, how big the canvas is, where the mouse is, what color you want things to be -- any value that stays constant for all pixels in