mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-17 00:56:07 +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 com.jme3.math.FastMath
|
||||||
import net.torvald.JsonFetcher
|
import net.torvald.JsonFetcher
|
||||||
import net.torvald.colourutil.CIELChabUtil
|
import net.torvald.colourutil.*
|
||||||
import net.torvald.colourutil.CIEXYZUtil
|
|
||||||
import net.torvald.colourutil.ColourUtil
|
|
||||||
import net.torvald.random.HQRNG
|
import net.torvald.random.HQRNG
|
||||||
import net.torvald.terrarum.Terrarum
|
import net.torvald.terrarum.Terrarum
|
||||||
import net.torvald.terrarum.blendMul
|
import net.torvald.terrarum.blendMul
|
||||||
@@ -96,9 +94,9 @@ object WeatherMixer {
|
|||||||
// draw skybox to provided (should be main) graphics instance
|
// draw skybox to provided (should be main) graphics instance
|
||||||
val skyColourFill = GradientFill(
|
val skyColourFill = GradientFill(
|
||||||
0f, 0f,
|
0f, 0f,
|
||||||
getGradientColour(skyboxColourMap, 0, timeNow) * gradCol, // mul with globallight
|
getGradientColour(skyboxColourMap, 0, timeNow),
|
||||||
0f, Terrarum.HEIGHT.toFloat(),// / Terrarum.ingame.screenZoom,
|
0f, Terrarum.HEIGHT.toFloat(),// / Terrarum.ingame.screenZoom,
|
||||||
getGradientColour(skyboxColourMap, 1, timeNow) * gradCol // mul with globallight
|
getGradientColour(skyboxColourMap, 1, timeNow)
|
||||||
)
|
)
|
||||||
|
|
||||||
blendNormal()
|
blendNormal()
|
||||||
@@ -109,6 +107,8 @@ object WeatherMixer {
|
|||||||
), skyColourFill)
|
), 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)
|
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