|
1 | 1 | package omaloon.content; |
2 | 2 |
|
3 | 3 | import arc.graphics.*; |
| 4 | +import arc.math.*; |
4 | 5 | import arc.util.noise.*; |
5 | 6 | import mindustry.content.*; |
6 | 7 | import mindustry.graphics.g3d.*; |
@@ -41,11 +42,22 @@ public static void load(){ |
41 | 42 | new HeightMesh(this, 6, 0.85f, position -> { |
42 | 43 | int seed = 3; |
43 | 44 | double octaves = 7, persistence = 0.7, scale = 0.25; |
44 | | - float mag = 2f; |
| 45 | + float mag = 2; |
| 46 | + |
| 47 | + float powMountain = Mathf.clamp(Mathf.pow(Simplex.noise3d( |
| 48 | + 7 + seed, octaves, persistence, scale, |
| 49 | + 5 + position.x, 5 + position.y, 5 + position.z |
| 50 | + ), 12f) * 300f, 0, 0.5f); |
| 51 | + |
| 52 | + return Simplex.noise3d( |
| 53 | + 7 + seed, octaves, persistence, scale, |
| 54 | + 5 + position.x, 5 + position.y, 5 + position.z |
| 55 | + ) * mag + powMountain; |
45 | 56 |
|
46 | | - return Simplex.noise3d(7 + seed, octaves, persistence, scale, 5f + position.x, 5f + position.y, 5f + position.z) * mag; |
47 | 57 | }, (position, height) -> { |
48 | | - if (height < 1) return Color.valueOf("574F51"); |
| 58 | + if (height < 1f) return Color.valueOf("574F51"); |
| 59 | + |
| 60 | + if (height > 1.5f) return Color.valueOf("D4F2FF"); |
49 | 61 | return Color.valueOf("4F3F3B"); |
50 | 62 | }) |
51 | 63 | ); |
|
0 commit comments