mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
skybox
Former-commit-id: 839fda074d5cf6a3fe1a0a16e10da67908bc4f03 Former-commit-id: 4ed8324110eafc434fd00f09fe48f3858ad5fd3a
This commit is contained in:
@@ -2,9 +2,7 @@ package net.torvald.terrarum.weather
|
||||
|
||||
import com.jme3.math.FastMath
|
||||
import net.torvald.JsonFetcher
|
||||
import net.torvald.colourutil.CIELChabUtil
|
||||
import net.torvald.colourutil.CIEXYZUtil
|
||||
import net.torvald.colourutil.ColourUtil
|
||||
import net.torvald.colourutil.*
|
||||
import net.torvald.random.HQRNG
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.blendMul
|
||||
@@ -96,9 +94,9 @@ object WeatherMixer {
|
||||
// draw skybox to provided (should be main) graphics instance
|
||||
val skyColourFill = GradientFill(
|
||||
0f, 0f,
|
||||
getGradientColour(skyboxColourMap, 0, timeNow) * gradCol, // mul with globallight
|
||||
getGradientColour(skyboxColourMap, 0, timeNow),
|
||||
0f, Terrarum.HEIGHT.toFloat(),// / Terrarum.ingame.screenZoom,
|
||||
getGradientColour(skyboxColourMap, 1, timeNow) * gradCol // mul with globallight
|
||||
getGradientColour(skyboxColourMap, 1, timeNow)
|
||||
)
|
||||
|
||||
blendNormal()
|
||||
@@ -109,6 +107,8 @@ object WeatherMixer {
|
||||
), skyColourFill)
|
||||
}
|
||||
|
||||
fun Float.clampOne() = if (this > 1) 1f else this
|
||||
|
||||
operator fun Color.times(other: Color) = Color(this.r * other.r, this.g * other.g, this.b * other.b, 1f)
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user