update
This commit is contained in:
12
shader.glsl
12
shader.glsl
@ -26,10 +26,10 @@ float noise(vec2 p, float scale )
|
|||||||
vec2 i = floor( p ),
|
vec2 i = floor( p ),
|
||||||
f = fract( p ),
|
f = fract( p ),
|
||||||
u = f*f*(3.-2.*f);
|
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),
|
hash( i + vec2(1.0,0.0) ), u.x),
|
||||||
mix( hash( i + vec2(0.0,1.0) ),
|
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 ) {
|
float hash2( vec2 p ) {
|
||||||
@ -38,10 +38,10 @@ float hash2( vec2 p ) {
|
|||||||
}
|
}
|
||||||
float noise2( in vec2 p ) {
|
float noise2( in vec2 p ) {
|
||||||
vec2 i = floor( p ), f = fract( p ), u = f*f*(3.0-2.0*f);
|
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),
|
hash2( i + vec2(1.0,0.0) ), u.x),
|
||||||
mix( hash2( i + vec2(0.0,1.0) ),
|
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
|
// sand
|
||||||
d2 = (p.y + 4.25) + noise((vec2((p.x*.04),(p.z-40.)*.04))+100., 15.)*1.5;
|
d2 = (p.y + 4.25) + noise((vec2((p.x*.04),(p.z-40.)*.04))+100., 15.)*1.5;
|
||||||
d = min(d,d2);
|
d = min(d,d2);
|
||||||
if (d==d2) mat = 3.0;
|
if (d==d2) mat = 3.0;
|
||||||
|
|
||||||
d2 = 1e3;
|
d2 = 1e3;
|
||||||
float h = 0.0, d3, choppy=4., freq=0.6, amp=.2;
|
float h = 0.0, d3, choppy=4., freq=0.6, amp=.2;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user