]

Thorne Brandt

Mobile Menu

Tagged Shader

Book of Shaders : Pollock

GLSL Study 4

May 22nd, 2022

In the Noise chapter of the The Book of Shaders, there is an interesting challenge to recreate a Pollock, using shader code. The following image is presented as an example.

Jackson Pollock - Number 14 gray
Read More

Book of Shaders: Noisy Distance

GLSL Study 3

May 16th, 2022

I've been studying writing glsl shaders from scratch and one of the best resources available for developing intuitive understanding is The Book of Shaders, but I've noticed that the author has left it unfinished. for the better part of a decade and there doesn't seem to be much available online with actual answers to the end-of-chapter challenges, so I felt like a lot of people were permanently left in the dark wondering whether or not they actually learned anything and eventually gave up on studying shaders. I decided I would try to blog as many as I could in case people were stuck.

Shaders really start getting interesting when you start implementing randomness. The Noise section of The Book of Shaders includes some vague challenges about "using noise with distance." I assumed that this meant using some overlapping to create the illusion of a rough edges.

Here's a simple demonstration of a reusable function. You multiply the larger circle and make the solid circle slight smaller than the radius input.


float rough_circle(in vec2 _st, float radius){
    float noiseScale= 90;
    vec2 noise_st = _st * noiseScale;
    float _noise = noise(noise_st);
    float circle1 = circle(_st, radius);
    float circle2 = circle(_st, radius - (0.01));
    float color = (circle1 * _noise) + circle2;
    return color;
}

Read More

Tagged Shader