add noise

This commit is contained in:
2024-07-31 21:03:25 +03:00
parent 485df6c245
commit 96f49bfdff
4 changed files with 19 additions and 18 deletions

View File

@ -170,7 +170,7 @@ vec3 map(vec3 p, int displace)
vec3 p2 = ringAnim(p), q2=p2;
an = PI/16.;
q2.xy = rot2D(floor((atan(p2.y,p2.x)/an) + .5)*an)*q2.xy;
d2 = sdBox2( q2.xyz - vec3(1.75,0.,0.), vec3(.04, .14, .05) ) - .02;
d2 = sdBox2( q2.xyz - vec3(1.75,0.,0.), vec3(.04, .14, .05) ) - .02 + noise(p.xy*100.,1e-3,0);
d = min(d, d2);
if (d==d2) mat = 6.;