skybox model changes on negative deg

This commit is contained in:
minjaesong
2023-07-25 03:47:59 +09:00
parent 4c1f16fe91
commit a73c536941
7 changed files with 104 additions and 13 deletions

View File

@@ -52,8 +52,9 @@ object Skybox : Disposable {
)
}
else {
val elevation1 = -elevationDeg
val elevation2 = -elevationDeg / 28.5
val deg1 = (-elevationDeg / 75.0).pow(0.8).times(-75.0)
val elevation1 = -deg1
val elevation2 = -deg1 / 28.5
val scale = (1f - (1f - 1f / 1.8.pow(elevation1)) * 0.97f).toFloat()
val scale2 = (1.0 - (elevation2.pow(E) / E.pow(elevation2))*0.8).toFloat()
CIEXYZ(
@@ -65,7 +66,7 @@ object Skybox : Disposable {
}
}
private val elevations = (-75..75) // 151
private val elevations = (-75..75) //zw 151
private val elevationsD = (elevations.first.toDouble() .. elevations.last.toDouble())
private val turbidities = (1_0..10_0 step 1) // 99
private val turbiditiesD = (turbidities.first / 10.0..turbidities.last / 10.0)

View File

@@ -0,0 +1,37 @@
package net.torvald.terrarum.modulebasegame.console
import net.torvald.terrarum.console.ConsoleCommand
import net.torvald.terrarum.console.Echo
import net.torvald.terrarum.weather.WeatherMixer
/**
* Created by minjaesong on 2023-07-25.
*/
internal object SetSol : ConsoleCommand {
override fun execute(args: Array<String>) {
if (args.size == 2) {
if (args[1].trim().lowercase() == "none") {
WeatherMixer.forceSolarElev = null
}
else {
try {
val solarAngle = args[1].toDouble().coerceIn(-75.0..75.0)
WeatherMixer.forceSolarElev = solarAngle
}
catch (e: NumberFormatException) {
Echo("Wrong number input.")
}
catch (e1: IllegalArgumentException) {
Echo("Range: -75.0-75.0")
}
}
}
else {
printUsage()
}
}
override fun printUsage() {
Echo("usage: setsol <-75.0..75.0 or 'none'>")
}
}

View File

@@ -0,0 +1,37 @@
package net.torvald.terrarum.modulebasegame.console
import net.torvald.terrarum.console.ConsoleCommand
import net.torvald.terrarum.console.Echo
import net.torvald.terrarum.weather.WeatherMixer
/**
* Created by minjaesong on 2023-07-25.
*/
object SetTurb : ConsoleCommand {
override fun execute(args: Array<String>) {
if (args.size == 2) {
if (args[1].trim().lowercase() == "none") {
WeatherMixer.forceTurbidity = null
}
else {
try {
val turbidity = args[1].toDouble().coerceIn(1.0..10.0)
WeatherMixer.forceTurbidity = turbidity
}
catch (e: NumberFormatException) {
Echo("Wrong number input.")
}
catch (e1: IllegalArgumentException) {
Echo("Range: 1.0-10.0")
}
}
}
else {
printUsage()
}
}
override fun printUsage() {
Echo("usage: setturb <1.0..10.0 or 'none'>")
}
}