This commit is contained in:
2024-07-29 15:59:04 +03:00
parent 83b935c968
commit ba6e615159

View File

@ -26,10 +26,10 @@ float noise(vec2 p, float scale )
vec2 i = floor( p ),
f = fract( p ),
u = f*f*(3.-2.*f);
return -scale+scale*mix( mix( hash( i + vec2(0.0,0.0) ),
return -scale+scale*mix( mix( hash( i + vec2(0.) ),
hash( i + vec2(1.0,0.0) ), u.x),
mix( hash( i + vec2(0.0,1.0) ),
hash( i + vec2(1.0,1.0) ), u.x), u.y);
hash( i + vec2(1.) ), u.x), u.y);
}
float hash2( vec2 p ) {
@ -38,10 +38,10 @@ float hash2( vec2 p ) {
}
float noise2( in vec2 p ) {
vec2 i = floor( p ), f = fract( p ), u = f*f*(3.0-2.0*f);
return -1.0+2.0*mix( mix( hash2( i + vec2(0.0,0.0) ),
return -1.0+2.0*mix( mix( hash2( i + vec2(0.) ),
hash2( i + vec2(1.0,0.0) ), u.x),
mix( hash2( i + vec2(0.0,1.0) ),
hash2( i + vec2(1.0,1.0) ), u.x), u.y);
hash2( i + vec2(1.) ), u.x), u.y);
}
/////////////////
@ -222,8 +222,8 @@ vec2 map(vec3 p, int displace)
// sand
d2 = (p.y + 4.25) + noise((vec2((p.x*.04),(p.z-40.)*.04))+100., 15.)*1.5;
d = min(d,d2);
if (d==d2) mat = 3.0;
if (d==d2) mat = 3.0;
d2 = 1e3;
float h = 0.0, d3, choppy=4., freq=0.6, amp=.2;