1
0
Fork 0

improve lighting

This commit is contained in:
Sen 2025-08-29 12:32:24 +02:00
parent 0bad586045
commit 937fd4bfb7
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
3 changed files with 12 additions and 12 deletions

View file

@ -2004,8 +2004,8 @@ public class Client implements IThreadListener {
"Licht: " + chunk.getLightSub(pos, 0) + " (" + (this.world.dimension.hasSkyLight() ? + World.getSkyLightFor(pos.getY()) + " Himmel, " : "")
+ chunk.getLight(pos) + " Blöcke, " + String.format(
"%.1f", this.renderer.getSunBrightness(1.0f) * 15.0f) + " Welt), A: "
+ String.format("%.1f ° (%.1f, %.1f)", this.world.getCelestialAngle(1.0f), !this.world.dimension.hasRotation() ? 0.0f : ExtMath.cos((-90.0f + this.world.getCelestialAngle(1.0f)) / 180.0f * (float)Math.PI),
!this.world.dimension.hasRotation() ? -1.0f : ExtMath.sin((-90.0f + this.world.getCelestialAngle(1.0f)) / 180.0f * (float)Math.PI)) + "\n" +
+ String.format("%.1f ° (%.1f, %.1f)", this.world.getCelestialAngle(1.0f), !this.world.dimension.hasDaylight() ? 0.0f : ExtMath.cos((-90.0f + this.world.getCelestialAngle(1.0f)) / 180.0f * (float)Math.PI),
!this.world.dimension.hasDaylight() ? -1.0f : ExtMath.sin((-90.0f + this.world.getCelestialAngle(1.0f)) / 180.0f * (float)Math.PI)) + "\n" +
String.format("Zeit: %s" + (this.world.dimension.hasRotation() ? ", R %d / %d T" : "") + (this.world.dimension.hasOrbit() ? ", U %d / %d T" : ""),
this.world.formatEpochSimple(),
this.world.getRotation(),

View file

@ -1135,12 +1135,12 @@ public class Renderer {
int g = (int)(green * 255.0F);
int b = (int)(blue * 255.0F);
if(n == 240) {
this.sunColorRed = red * (world.dimension.hasSkyLight() ? sun : 1.0f);
this.sunColorGreen = green * (world.dimension.hasSkyLight() ? sun : 1.0f);
this.sunColorBlue = blue * (world.dimension.hasSkyLight() ? sun : 1.0f);
this.moonColorRed = red * (world.dimension.hasSkyLight() ? 1.0f - sun : 0.0f);
this.moonColorGreen = green * (world.dimension.hasSkyLight() ? 1.0f - sun : 0.0f);
this.moonColorBlue = blue * (world.dimension.hasSkyLight() ? 1.0f - sun : 0.0f);
this.sunColorRed = red * (world.dimension.hasDaylight() ? sun : 1.0f);
this.sunColorGreen = green * (world.dimension.hasDaylight() ? sun : 1.0f);
this.sunColorBlue = blue * (world.dimension.hasDaylight() ? sun : 1.0f);
this.moonColorRed = red * (world.dimension.hasDaylight() ? 1.0f - sun : 0.0f);
this.moonColorGreen = green * (world.dimension.hasDaylight() ? 1.0f - sun : 0.0f);
this.moonColorBlue = blue * (world.dimension.hasDaylight() ? 1.0f - sun : 0.0f);
}
else if(n == 15) {
this.blockColorRed = red;

View file

@ -32,12 +32,12 @@ public enum Shader {
float angle = -90.0f + Client.CLIENT.world.getCelestialAngle(Client.CLIENT.getTickFraction());
float sunX = !Client.CLIENT.world.dimension.hasRotation() ? 0.0f : ExtMath.cos(angle / 180.0f * (float)Math.PI);
float sunY = !Client.CLIENT.world.dimension.hasRotation() ? -1.0f : ExtMath.sin(angle / 180.0f * (float)Math.PI);
float sunX = !Client.CLIENT.world.dimension.hasDaylight() ? 0.0f : ExtMath.cos(angle / 180.0f * (float)Math.PI);
float sunY = !Client.CLIENT.world.dimension.hasDaylight() ? -1.0f : ExtMath.sin(angle / 180.0f * (float)Math.PI);
context.vec("sun_direction", sunX, sunY, 0.0f);
float moonX = !Client.CLIENT.world.dimension.hasRotation() ? 0.0f : ExtMath.cos((180.0f + angle) / 180.0f * (float)Math.PI);
float moonY = !Client.CLIENT.world.dimension.hasRotation() ? -1.0f : ExtMath.sin((180.0f + angle) / 180.0f * (float)Math.PI);
float moonX = !Client.CLIENT.world.dimension.hasDaylight() ? 0.0f : ExtMath.cos((180.0f + angle) / 180.0f * (float)Math.PI);
float moonY = !Client.CLIENT.world.dimension.hasDaylight() ? -1.0f : ExtMath.sin((180.0f + angle) / 180.0f * (float)Math.PI);
context.vec("moon_direction", moonX, moonY, 0.0f);
float sunRed = Client.CLIENT.renderer.getSunColorRed();