cloud stage has more depth

This commit is contained in:
minjaesong
2023-09-06 18:01:33 +09:00
parent 7259ca616c
commit 6c97a9d5ab
13 changed files with 93 additions and 48 deletions

View File

@@ -29,18 +29,26 @@ data class BaseModularWeather(
val cloudGamma: Vector2,
val cloudGammaVariance: Vector2,
var clouds: List<CloudProps>, // sorted by CloudProps.probability
val shaderVibrancy: FloatArray,
val mixFrom: String? = null,
val mixPercentage: Double? = null,
) {
/**
* @param rnd random number between -1 and +1
*/
fun getRandomWindSpeed(old: Float, rnd: Float): Float {
val v = 1f + rnd.absoluteValue * windSpeedVariance
val r = if (rnd < 0) windSpeed / v else windSpeed * v
return FastMath.interpolateLinear(windSpeedDamping, old, r)
return FastMath.interpolateLinear(1f - windSpeedDamping, old, r)
}
fun getRandomWindSpeed(rnd: Float): Float {
val v = 1f + rnd.absoluteValue * windSpeedVariance
val r = if (rnd < 0) windSpeed / v else windSpeed * v
return r
}
fun getRandomCloudGamma(rnd1: Float, rnd2: Float): Vector2 {