mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
clouds are now spawned mid-frame
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
"skyboxGradColourMap": "generic_skybox.tga",
|
||||
"daylightClut": "clut_daylight.tga",
|
||||
"classification": "generic",
|
||||
"cloudChance": 125,
|
||||
"cloudChance": 60,
|
||||
"cloudGamma": [0.9, 2.4],
|
||||
"cloudGammaVariance": [0.111, 0.0],
|
||||
"windSpeed": 0.35,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"skyboxGradColourMap": "generic_skybox.tga",
|
||||
"daylightClut": "clut_daylight.tga",
|
||||
"classification": "generic2",
|
||||
"cloudChance": 800,
|
||||
"cloudChance": 150,
|
||||
"cloudGamma": [0.9, 2.4],
|
||||
"cloudGammaVariance": [0.111, 0.0],
|
||||
"windSpeed": 0.35,
|
||||
|
||||
@@ -356,9 +356,25 @@ internal object WeatherMixer : RNGConsumer {
|
||||
)
|
||||
|
||||
/**
|
||||
* Returns random point for clouds to spawn from, in the opposite side of the current wind vector
|
||||
* Spawn anywhere on the visible field
|
||||
*/
|
||||
private fun getCloudSpawningPosition(cloud: CloudProps, halfCloudSize: Float, windVector: Vector3): Vector3 {
|
||||
val Z_POW_BASE = ALPHA_ROLLOFF_Z / 4f
|
||||
|
||||
val y = takeUniformRand(-cloud.altHigh..-cloud.altLow) * scrHscaler
|
||||
val z = takeUniformRand(1f..Z_POW_BASE).pow(1.5f) // clouds are more likely to spawn with low Z-value
|
||||
val xlow = WeatherObjectCloud.screenXtoWorldX(-halfCloudSize, z)
|
||||
val xhi = WeatherObjectCloud.screenXtoWorldX(App.scr.width + halfCloudSize, z)
|
||||
val x = takeUniformRand(xlow..xhi)
|
||||
|
||||
return Vector3(x, y, z)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns random point for clouds to spawn from, in the opposite side of the current wind vector
|
||||
*/
|
||||
private fun getCloudSpawningPositionOLD(cloud: CloudProps, halfCloudSize: Float, windVector: Vector3): Vector3 {
|
||||
val Z_LIM = ALPHA_ROLLOFF_Z
|
||||
val Z_POW_BASE = ALPHA_ROLLOFF_Z / 4f
|
||||
val y = takeUniformRand(-cloud.altHigh..-cloud.altLow) * scrHscaler
|
||||
@@ -416,6 +432,8 @@ internal object WeatherMixer : RNGConsumer {
|
||||
else -> throw InternalError()
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun tryToSpawnCloud(
|
||||
|
||||
Reference in New Issue
Block a user