skybox: slightly darker to match 0.3.2 skybox

This commit is contained in:
minjaesong
2023-09-23 01:50:14 +09:00
parent d87dc8fffc
commit e3b510bf7e
3 changed files with 13 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,6 @@
package net.torvald.terrarum.clut
import com.badlogic.gdx.graphics.Color
import net.torvald.colourutil.CIEXYZ
import net.torvald.colourutil.HUSLColorConverter
import net.torvald.colourutil.toColor
@@ -61,7 +62,7 @@ class GenerateSkyboxTextureAtlas {
ArHosekSkyModel.arhosek_tristim_skymodel_radiance(state, theta, gamma, 2).toFloat()
)
val xyz2 = xyz.scaleToFit(elevationDeg)
val rgb = xyz2.toRGB().toColor()
val rgb = xyz2.toRGB().toColor().gamma(1.2f)
val colour = rgb.toIntBits().toLittle()
for (i in 0..3) {
@@ -70,6 +71,13 @@ class GenerateSkyboxTextureAtlas {
}
}
private fun Color.gamma(gam: Float): Color {
this.r = this.r.pow(gam)
this.g = this.g.pow(gam)
this.b = this.b.pow(gam)
return this
}
// y: increasing turbidity (1.0 .. 10.0, in steps of 0.333)
// x: elevations (-75 .. 75 in steps of 1, then albedo of [0.1, 0.3, 0.5, 0.7, 0.9])
val TGA_HEADER_SIZE = 18