improve entity brightness

(cherry picked from commit 11f8b49fbabb4374cb578cd94fb1519564f86164)
This commit is contained in:
LabyStudio
2022-04-15 06:10:25 +02:00
parent 45961bbfbb
commit 1bc76dd94d
3 changed files with 5 additions and 12 deletions
+1 -8
View File
@@ -26,13 +26,6 @@ export default class World {
this.time = 0;
// Generate light brightness table
this.lightBrightnessTable = [];
for (let i = 0; i <= 15; i++) {
let brightness = 1.0 - i / 15;
this.lightBrightnessTable[i] = ((1.0 - brightness) / (brightness * 3 + 1.0)) * (1.0 - 0.05) + 0.05;
}
// Load world
this.generator = new WorldGenerator(this, Date.now() % 100000);
@@ -500,7 +493,7 @@ export default class World {
getLightBrightness(x, y, z) {
let level = this.getTotalLightAt(x, y, z);
return this.lightBrightnessTable[level];
return Math.max(level / 15, 0.1);
}
getSkyColorByTemp(temperature) {