mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-15 10:25:06 -04:00
rendering: fix sun invisible bug when time == 6000t
This commit is contained in:
parent
49fdad2ca2
commit
832fab27e4
@ -85,7 +85,6 @@ See [Credits](Credits.md).
|
||||
## Releases and beta
|
||||
|
||||
No clue, but still waiting for !21. Also, some features need to be implemented, so not soo soon (but we are getting closer). If you want to get notified about cool new changes, feel free to subscribe to our dev news telegram channel [@MinosoftDevNews]((https://t.me/MinosoftDevNews))
|
||||
|
||||
## Compiling and running
|
||||
|
||||
1. Install Maven and java 15 (On Ubuntu based distributions: `sudo apt install maven openjdk-15-jdk`).
|
||||
|
@ -77,7 +77,12 @@ class SkyRenderer(
|
||||
|
||||
private fun setSunMatrix(projectionViewMatrix: Mat4) {
|
||||
val timeAngle = (getSkyAngle(connection.world.time).toFloat() * 360.0f)
|
||||
skySunShader.use().setMat4("skyViewProjectionMatrix", projectionViewMatrix.rotate(timeAngle, Vec3(0.0f, 0.0f, 1.0f))) // ToDo: 180° is top, not correct yet
|
||||
val rotatedMatrix = if (timeAngle == 0.0f) {
|
||||
projectionViewMatrix
|
||||
} else {
|
||||
projectionViewMatrix.rotate(timeAngle, Vec3(0.0f, 0.0f, 1.0f))
|
||||
}
|
||||
skySunShader.use().setMat4("skyViewProjectionMatrix", rotatedMatrix) // ToDo: 180° is top, not correct yet
|
||||
}
|
||||
|
||||
override fun postInit() {
|
||||
@ -103,7 +108,7 @@ class SkyRenderer(
|
||||
start = Vec3(-0.15f, 1.0f, -0.15f),
|
||||
end = Vec3(+0.15f, 1.0f, +0.15f),
|
||||
texture = sunTexture,
|
||||
tintColor = RGBColor(255, 255, 255),
|
||||
tintColor = RGBColor(255, 255, 255), // ToDo: Depends on time
|
||||
)
|
||||
skySunMesh.load()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user