mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Avoid discarding the bottom 4 bits of the lightmap coords. It turns out vanilla relies on those bits. Fixes some blocks being darker than they should be in certain circumstances.
This commit is contained in:
1 parent
c3e4d303e9
commit
6551ccc247
1 file changed
+5
-5
@@ -109,14 +109,14 @@ public interface IForgeVertexBuilder
|
||||
}
|
||||
|
||||
default int applyBakedLighting(int lightmapCoord, ByteBuffer data) {
|
||||
int bl = LightTexture.getLightBlock(lightmapCoord);
|
||||
int sl = LightTexture.getLightSky(lightmapCoord);
|
||||
int bl = lightmapCoord&0xFFFF;
|
||||
int sl = (lightmapCoord>>16)&0xFFFF;
|
||||
int offset = LightUtil.getLightOffset(0) * 4; // int offset for vertex 0 * 4 bytes per int
|
||||
int blBaked = Short.toUnsignedInt(data.getShort(offset)) >> 4;
|
||||
int slBaked = Short.toUnsignedInt(data.getShort(offset + 2)) >> 4;
|
||||
int blBaked = Short.toUnsignedInt(data.getShort(offset));
|
||||
int slBaked = Short.toUnsignedInt(data.getShort(offset + 2));
|
||||
bl = Math.max(bl, blBaked);
|
||||
sl = Math.max(sl, slBaked);
|
||||
return LightTexture.packLight(bl, sl);
|
||||
return bl | (sl<<16);
|
||||
}
|
||||
|
||||
default void applyBakedNormals(Vector3f generated, ByteBuffer data, Matrix3f normalTransform) {
|
||||
|
||||
Reference in new issue
Block a user