mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 19:44:05 +09:00
cloud stage has more depth
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user