Fixes #2532: Work around bug in Forge lighting pipeline and UnpackedBakedQuad.
This commit is contained in:
@@ -88,8 +88,23 @@ public class AutoRotatingModel implements IBakedModel
|
|||||||
builder.setQuadOrientation( null );
|
builder.setQuadOrientation( null );
|
||||||
|
|
||||||
}
|
}
|
||||||
BakedQuad q = builder.build();
|
BakedQuad unpackedQuad = builder.build();
|
||||||
rotated.add( q );
|
|
||||||
|
// Make a copy of it to resolve the vertex data and throw away the unpacked stuff
|
||||||
|
// This also fixes a bug in Forge's UnpackedBakedQuad, which unpacks a byte-based normal like 0,0,-1
|
||||||
|
// to 0,0,-0.99607843. We replace these normals with the proper 0,0,-1 when rotation, which
|
||||||
|
// causes a bug in the AO lighter, if an unpacked quad pipes this value back to it.
|
||||||
|
// Packing it back to the vanilla vertex format will fix this inconsistency because it converts
|
||||||
|
// the normal back to a byte-based format, which then re-applies Forge's own bug when piping it
|
||||||
|
// to the AO lighter, thus fixing our problem.
|
||||||
|
BakedQuad packedQuad = new BakedQuad( unpackedQuad.getVertexData(),
|
||||||
|
quad.getTintIndex(),
|
||||||
|
unpackedQuad.getFace(),
|
||||||
|
quad.getSprite(),
|
||||||
|
quad.shouldApplyDiffuseLighting(),
|
||||||
|
quad.getFormat()
|
||||||
|
);
|
||||||
|
rotated.add( packedQuad );
|
||||||
}
|
}
|
||||||
return rotated;
|
return rotated;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user