mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 12:04:06 +09:00
sky model update
This commit is contained in:
@@ -52,7 +52,7 @@ object Skybox : Disposable {
|
||||
)
|
||||
}
|
||||
else {
|
||||
val deg1 = (-elevationDeg / 75.0).pow(0.8).times(-75.0)
|
||||
val deg1 = (-elevationDeg / 75.0).pow(0.93).times(-75.0)
|
||||
val elevation1 = -deg1
|
||||
val elevation2 = -deg1 / 28.5
|
||||
val scale = (1f - (1f - 1f / 1.8.pow(elevation1)) * 0.97f).toFloat()
|
||||
@@ -68,7 +68,8 @@ object Skybox : Disposable {
|
||||
|
||||
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 turbidityStep = 5
|
||||
private val turbidities = (1_0..10_0 step turbidityStep) // (100 / turbidityStep) - 1
|
||||
private val turbiditiesD = (turbidities.first / 10.0..turbidities.last / 10.0)
|
||||
private val elevCnt = elevations.count()
|
||||
private val turbCnt = turbidities.count()
|
||||
@@ -94,7 +95,7 @@ object Skybox : Disposable {
|
||||
|
||||
val elevationDeg = (it / turbCnt).plus(elevations.first).toDouble()
|
||||
val elevationRad = Math.toRadians(elevationDeg)
|
||||
val turbidity = 1.0 + (it % turbCnt) / 10.0
|
||||
val turbidity = 1.0 + (it % turbCnt) / (10.0 / turbidityStep)
|
||||
|
||||
val state = ArHosekSkyModel.arhosek_xyz_skymodelstate_alloc_init(turbidity, albedo, elevationRad.abs())
|
||||
val pixmap = Pixmap(1, gradSize, Pixmap.Format.RGBA8888)
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package net.torvald.terrarum.modulebasegame.console
|
||||
|
||||
import net.torvald.reflection.extortField
|
||||
import net.torvald.terrarum.INGAME
|
||||
import net.torvald.terrarum.console.ConsoleCommand
|
||||
import net.torvald.terrarum.console.Echo
|
||||
import net.torvald.terrarum.gameactors.ActorWithBody
|
||||
import net.torvald.terrarum.weather.WeatherMixer
|
||||
import net.torvald.terrarum.worlddrawer.LightmapRenderer
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2023-07-25.
|
||||
@@ -17,6 +21,13 @@ internal object SetSol : ConsoleCommand {
|
||||
try {
|
||||
val solarAngle = args[1].toDouble().coerceIn(-75.0..75.0)
|
||||
WeatherMixer.forceSolarElev = solarAngle
|
||||
LightmapRenderer.recalculate(
|
||||
INGAME.extortField<ArrayList<ActorWithBody>>("visibleActorsRenderBehind")!! +
|
||||
INGAME.extortField<ArrayList<ActorWithBody>>("visibleActorsRenderMiddle")!! +
|
||||
INGAME.extortField<ArrayList<ActorWithBody>>("visibleActorsRenderMidTop")!! +
|
||||
INGAME.extortField<ArrayList<ActorWithBody>>("visibleActorsRenderFront")!! +
|
||||
INGAME.extortField<ArrayList<ActorWithBody>>("visibleActorsRenderOverlay")!!
|
||||
)
|
||||
}
|
||||
catch (e: NumberFormatException) {
|
||||
Echo("Wrong number input.")
|
||||
|
||||
Reference in New Issue
Block a user