Skip to main content
Shaders for Games (GLSL) Lesson 14 of 20

Noise — the organic look

Random, smoothed into noise, is how you make clouds, fire and terrain.

Everything so far has been clean and geometric. Real surfaces — clouds, smoke, fire, rock, water — are not. The tool for organic, natural-looking variation is NOISE: pseudo-random values that vary smoothly across space instead of jumping. You start with a hash (a repeatable "random" number from a coordinate), then smoothly blend between neighbouring random values to get noise.

The random() and noise() functions below are standard boilerplate — you paste them at the top of a shader and just USE noise(). Feed it a coordinate and it returns a smooth, cloudy value; scale the coordinate to make the features bigger or smaller, and add u_time to make it drift.

Your turn: fill the screen with a noise texture. The helper functions are already there — sample noise(st * 4.0) and use it as the brightness.

Your turn

Fill the screen with a noise texture.

The random() and noise() helpers are provided. Sample n = noise(st * 4.0) and put it in all three color channels.

Tip Layering noise at several scales (fBm — fractal Brownian motion) is how you get the rich, detailed look of real clouds and terrain. That is the natural next step once this clicks.
▶ Make it flow Add u_time inside noise() to make it drift, or feed noise into mix() to color it like a sky.
Wayline
Tools, assets and tutorials for game makers
Get started