Skip to content

Commit 1b8b0af

Browse files
committed
mod DistanceFunction
1 parent d011bbb commit 1b8b0af

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Assets/Demoscene/Projects/2018-07-12-Lava/Lava.shader

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ float _Power;
5454
inline float DistanceFunction(float3 pos)
5555
{
5656
float2 c = cellular(float2(pos.xz));
57-
float h = c.y - c.x;
58-
h = pow(h, _Power);
57+
float h = pow(c.y - c.x, _Power);
5958

6059
float2 c2 = cellular(float2(3.0 * pos.xz));
6160
h += 0.5 * pow((c2.y - c2.x), _Power);
6261

62+
float2 c3 = cellular(float2(20.0 * pos.xz));
63+
h += 0.05 * pow((c3.y - c3.x), _Power);
64+
6365
h += 0.001 * snoise(50.0 * pos.xz);
6466
return pos.y - h;
6567
}

0 commit comments

Comments
 (0)