improve multi layer clouds

This commit is contained in:
Bixilon 2022-11-11 09:20:45 +01:00
parent 61e382f693
commit 0096711844
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ class CloudArray(
continue
}
val start = (this.offset * ARRAY_SIZE + Vec2i(x, z) + layer.index) * CLOUD_SIZE
val start = (this.offset * ARRAY_SIZE + Vec2i(x, z) + (layer.index * ARRAY_SIZE)) * CLOUD_SIZE
val cull = booleanArrayOf(
matrix[matrixX + 0, matrixZ - 1], // NORTH

View File

@ -115,7 +115,7 @@ class CloudsLayer(
val day = sky.time.day
if (day != this.day) {
this.day = day
randomSpeed = Random(index.toLong().murmur64() * sky.time.age.murmur64()).nextFloat(0.0f, 0.1f)
randomSpeed = Random(index.toLong().murmur64() * (sky.time.age + 1000L).murmur64()).nextFloat(0.0f, 0.1f)
}
}
@ -125,7 +125,7 @@ class CloudsLayer(
}
private fun getCloudSpeed(): Float {
return randomSpeed + 0.1f
return randomSpeed + 0.05f
}
private fun updateOffset() {