Layering Detail at a Low Weight
One large shape leads; fine detail goes on top at a low weight, so it adds texture without hiding the shape.
How it works¶
Two layers of the same noise at different zooms, 0.008 (large, slow shapes) and 0.08 (ten times finer), added with weights that sum to 1. At equal weights the fine layer is as loud as the large one and the large shapes are lost in it. At 0.85 and 0.15 the large shapes stay clear and the fine layer reads as texture.
This is the same idea as noise's own octaves, each finer layer weaker than the last, and as a painter blocking in big shapes before detail.
v × 1.5 spreads the noise (which mostly sits between 0.3 and 0.7) over more of the palette. The + 100 moves the fine layer to an unrelated part of the noise.
The C is for the raylib pixels starter.
Large shapes only¶
static RGB shade(float x, float y, float t)
{
float v = noise2(x * 0.008f, y * 0.008f);
return rainbow(v * 1.5f);
}
function shade(x, y, t) {
let v = noise2(x * 0.008, y * 0.008);
return rainbow(v * 1.5);
}
Large 0.5, fine 0.5: the shapes are lost¶
static RGB shade(float x, float y, float t)
{
float v = 0.5f * noise2(x * 0.008f, y * 0.008f) + 0.5f * noise2(x * 0.08f + 100, y * 0.08f);
return rainbow(v * 1.5f);
}
function shade(x, y, t) {
let v = 0.5 * noise2(x * 0.008, y * 0.008) + 0.5 * noise2(x * 0.08 + 100, y * 0.08);
return rainbow(v * 1.5);
}
Large 0.85, fine 0.15: shape and texture¶
static RGB shade(float x, float y, float t)
{
float v = 0.85f * noise2(x * 0.008f, y * 0.008f) + 0.15f * noise2(x * 0.08f + 100, y * 0.08f);
return rainbow(v * 1.5f);
}
function shade(x, y, t) {
let v = 0.85 * noise2(x * 0.008, y * 0.008) + 0.15 * noise2(x * 0.08 + 100, y * 0.08);
return rainbow(v * 1.5);
}
Related¶
- Combining Two Patterns: the other reasons combinations turn to mush.
- Random and Perlin Noise: zoom, and octaves.