Fix incorrect 16bit lightmaps

This commit is contained in:
Jarrod Doyle 2024-08-10 10:22:57 +01:00
parent 64dde9509d
commit 1539d1910d
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 1 additions and 1 deletions

View File

@ -132,7 +132,7 @@ public class WorldRep : IChunk
return new Vector4(raw1, raw1, raw1, 255) / 255.0f; return new Vector4(raw1, raw1, raw1, 255) / 255.0f;
case 2: case 2:
var raw2 = Pixels[layer, y, x, 0] + (Pixels[layer, y, x, 1] << 8); var raw2 = Pixels[layer, y, x, 0] + (Pixels[layer, y, x, 1] << 8);
return new Vector4(raw2 & 31, (raw2 >> 5) & 31, (raw2 >> 10) & 31, 32) / 32.0f; return new Vector4(raw2 & 31, (raw2 >> 5) & 31, (raw2 >> 10) & 31, 31) / 31.0f;
case 4: case 4:
return new Vector4(Pixels[layer, y, x, 0], Pixels[layer, y, x, 1], Pixels[layer, y, x, 2], Pixels[layer, y, x, 3]) / 255.0f; return new Vector4(Pixels[layer, y, x, 0], Pixels[layer, y, x, 1], Pixels[layer, y, x, 2], Pixels[layer, y, x, 3]) / 255.0f;
default: default: