-
Notifications
You must be signed in to change notification settings - Fork 0
/
stucco.sl
29 lines (25 loc) · 614 Bytes
/
stucco.sl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
* stucco.sl -- displacement shader for stucco
*
* DESCRIPTION:
* Displacees a surface to make it look like stucco.
*
* PARAMETERS:
* Km the amplitude of the stucco pimples
* power controls the shape of the pimples
* frequency the frequency of the pimples
*
*
* AUTHOR: written by Larry Gritz ([email protected])
*
*/
displacement
stucco ( float Km = 0.05, power = 5, frequency = 10; )
{
float magnitude;
point PP;
PP = transform ("shader", P);
magnitude = Km * pow (noise (PP*frequency), power);
P += magnitude * normalize (N);
N = calculatenormal (P);
}