mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 10:34:06 +09:00
more clouds
This commit is contained in:
@@ -2,10 +2,15 @@
|
|||||||
"skyboxGradColourMap": "generic_skybox.tga",
|
"skyboxGradColourMap": "generic_skybox.tga",
|
||||||
"daylightClut": "clut_daylight.tga",
|
"daylightClut": "clut_daylight.tga",
|
||||||
"classification": "generic",
|
"classification": "generic",
|
||||||
|
"cloudGamma": [0.44, 2.0],
|
||||||
"clouds": {
|
"clouds": {
|
||||||
"normal": {
|
"normal": {
|
||||||
"filename": "cloud_normal.png",
|
"filename": "cloud_normal.png",
|
||||||
"tw": 1024, "th": 512
|
"tw": 1024, "th": 512
|
||||||
|
},
|
||||||
|
"large": {
|
||||||
|
"filename": "cloud_large.png",
|
||||||
|
"tw": 2048, "th": 1024
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BIN
assets/mods/basegame/weathers/cloud_large.kra
LFS
Normal file
BIN
assets/mods/basegame/weathers/cloud_large.kra
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/weathers/cloud_large.png
LFS
Normal file
BIN
assets/mods/basegame/weathers/cloud_large.png
LFS
Normal file
Binary file not shown.
Binary file not shown.
@@ -67,7 +67,7 @@ basegame
|
|||||||
// Commit counts up to the Release 0.3.1: 2278
|
// Commit counts up to the Release 0.3.1: 2278
|
||||||
// Commit counts up to the Release 0.3.2: 2732
|
// Commit counts up to the Release 0.3.2: 2732
|
||||||
|
|
||||||
const val VERSION_TAG: String = "test001"
|
const val VERSION_TAG: String = "test002"
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////
|
||||||
// CONFIGURATION FOR TILE MAKER //
|
// CONFIGURATION FOR TILE MAKER //
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ data class BaseModularWeather(
|
|||||||
var skyboxGradColourMap: GdxColorMap, // row 0: skybox grad top, row 1: skybox grad bottom, row 2: sunlight (RGBA)
|
var skyboxGradColourMap: GdxColorMap, // row 0: skybox grad top, row 1: skybox grad bottom, row 2: sunlight (RGBA)
|
||||||
val daylightClut: GdxColorMap,
|
val daylightClut: GdxColorMap,
|
||||||
val classification: String,
|
val classification: String,
|
||||||
|
val cloudGamma: FloatArray,
|
||||||
var clouds: HashMap<String, TextureRegionPack>,
|
var clouds: HashMap<String, TextureRegionPack>,
|
||||||
val mixFrom: String? = null,
|
val mixFrom: String? = null,
|
||||||
val mixPercentage: Double? = null
|
val mixPercentage: Double? = null
|
||||||
|
|||||||
@@ -76,6 +76,9 @@ internal object WeatherMixer : RNGConsumer {
|
|||||||
private var astrumOffX = 0f
|
private var astrumOffX = 0f
|
||||||
private var astrumOffY = 0f
|
private var astrumOffY = 0f
|
||||||
|
|
||||||
|
private var cloudGamma1 = 0.5f
|
||||||
|
private var cloudGamma2 = 2f
|
||||||
|
|
||||||
private val moonlightMax = Cvec(0.23f, 0.24f, 0.25f, 0.21f) // actual moonlight is around ~4100K but our mesopic vision makes it appear blueish (wikipedia: Purkinje effect)
|
private val moonlightMax = Cvec(0.23f, 0.24f, 0.25f, 0.21f) // actual moonlight is around ~4100K but our mesopic vision makes it appear blueish (wikipedia: Purkinje effect)
|
||||||
|
|
||||||
override fun loadFromSave(s0: Long, s1: Long) {
|
override fun loadFromSave(s0: Long, s1: Long) {
|
||||||
@@ -134,6 +137,7 @@ internal object WeatherMixer : RNGConsumer {
|
|||||||
GdxColorMap(1, 3, Color(0x55aaffff), Color(0xaaffffff.toInt()), Color.WHITE),
|
GdxColorMap(1, 3, Color(0x55aaffff), Color(0xaaffffff.toInt()), Color.WHITE),
|
||||||
GdxColorMap(2, 2, Color.WHITE, Color.WHITE, Color.WHITE, Color.WHITE),
|
GdxColorMap(2, 2, Color.WHITE, Color.WHITE, Color.WHITE, Color.WHITE),
|
||||||
"default",
|
"default",
|
||||||
|
floatArrayOf(1f, 1f),
|
||||||
HashMap()
|
HashMap()
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -150,6 +154,10 @@ internal object WeatherMixer : RNGConsumer {
|
|||||||
|
|
||||||
// currentWeather = weatherList[WEATHER_GENERIC]!![0] // force set weather
|
// currentWeather = weatherList[WEATHER_GENERIC]!![0] // force set weather
|
||||||
|
|
||||||
|
// update clouds
|
||||||
|
cloudGamma1 = currentWeather.cloudGamma[0]
|
||||||
|
cloudGamma2 = currentWeather.cloudGamma[1]
|
||||||
|
|
||||||
|
|
||||||
if (!globalLightOverridden) {
|
if (!globalLightOverridden) {
|
||||||
world.globalLight = WeatherMixer.globalLightNow
|
world.globalLight = WeatherMixer.globalLightNow
|
||||||
@@ -178,9 +186,10 @@ internal object WeatherMixer : RNGConsumer {
|
|||||||
} // TODO add cloud-only colour strip on the CLUT
|
} // TODO add cloud-only colour strip on the CLUT
|
||||||
batch.shader = shaderClouds
|
batch.shader = shaderClouds
|
||||||
batch.inUse {
|
batch.inUse {
|
||||||
currentWeather.clouds["normal"]?.get(0, 0)?.let {
|
batch.shader.setUniformf("inverseGamma", cloudGamma1, cloudGamma2)
|
||||||
batch.draw(it, 0f, -150f)
|
currentWeather.clouds["large"]?.get(0, 0)?.let { batch.draw(it, -400f - INGAME.WORLD_UPDATE_TIMER * 0.06f, -600f) }
|
||||||
}
|
currentWeather.clouds["normal"]?.get(0, 1)?.let { batch.draw(it, 600f - INGAME.WORLD_UPDATE_TIMER * 0.09f, -300f) }
|
||||||
|
currentWeather.clouds["normal"]?.get(0, 0)?.let { batch.draw(it, 200f - INGAME.WORLD_UPDATE_TIMER * 0.13f, -150f) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -393,6 +402,8 @@ internal object WeatherMixer : RNGConsumer {
|
|||||||
|
|
||||||
val classification = JSON.getString("classification")
|
val classification = JSON.getString("classification")
|
||||||
|
|
||||||
|
val cloudGamma = JSON["cloudGamma"].asFloatArray()
|
||||||
|
|
||||||
val cloudsMap = HashMap<String, TextureRegionPack>()
|
val cloudsMap = HashMap<String, TextureRegionPack>()
|
||||||
val clouds = JSON["clouds"]
|
val clouds = JSON["clouds"]
|
||||||
clouds.forEachSiblings { name, json ->
|
clouds.forEachSiblings { name, json ->
|
||||||
@@ -415,7 +426,8 @@ internal object WeatherMixer : RNGConsumer {
|
|||||||
skyboxGradColourMap = skybox,
|
skyboxGradColourMap = skybox,
|
||||||
daylightClut = daylight,
|
daylightClut = daylight,
|
||||||
classification = classification,
|
classification = classification,
|
||||||
clouds = cloudsMap
|
cloudGamma = cloudGamma,
|
||||||
|
clouds = cloudsMap,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ out vec4 fragColor;
|
|||||||
|
|
||||||
const vec2 boolean = vec2(0.0, 1.0);
|
const vec2 boolean = vec2(0.0, 1.0);
|
||||||
|
|
||||||
uniform vec2 inverseGamma = vec2(0.5, 2.0); // vec2(inverse gamma RGB, inverse gamma RGA)
|
uniform vec2 inverseGamma = vec2(10, 2.0); // vec2(inverse gamma RGB, inverse gamma RGA)
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec4 inCol = v_color * texture(u_texture, v_texCoords);
|
vec4 inCol = v_color * texture(u_texture, v_texCoords);
|
||||||
|
|||||||
Reference in New Issue
Block a user