mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
yet another sky model changes
This commit is contained in:
@@ -185,7 +185,8 @@ class Application(val WIDTH: Int, val HEIGHT: Int) : Game() {
|
||||
val theta = sqrt(xf*xf + yf*yf) * HALF_PI*/
|
||||
|
||||
// AM-PM mapping (use with WIDTH=1)
|
||||
val yf = (y * 2.0 / oneScreen.height) % 1.0
|
||||
var yf = (y * 2.0 / oneScreen.height) % 1.0
|
||||
if (elevation < 0) yf -= (elevation / HALF_PI)
|
||||
val gamma = if (y < halfHeight) HALF_PI else 3 * HALF_PI
|
||||
val theta = yf.mapCircle() * HALF_PI
|
||||
|
||||
|
||||
@@ -103,7 +103,9 @@ object Skybox : Disposable {
|
||||
// printdbg(this, "elev $elevationDeg turb $turbidity")
|
||||
|
||||
for (y in 0 until gradSize) {
|
||||
val theta = (y.toDouble() / gradSize * 1.0).coerceIn(0.0, 1.0).mapCircle() * HALF_PI
|
||||
var yf = (y.toDouble() / gradSize * 1.0).coerceIn(0.0, 1.0)
|
||||
if (elevationDeg < 0) yf += (elevationDeg / 90.0)
|
||||
val theta = yf.mapCircle() * HALF_PI
|
||||
// vertical angle, where 0 is zenith, ±90 is ground (which is odd)
|
||||
|
||||
val xyz = CIEXYZ(
|
||||
|
||||
Reference in New Issue
Block a user