Rotated block models have the wrong quad facing, breaking block light rendering #461
Labels
A-vanilla-issue
Area: Vanilla issue
F-good-first-issue
Flag: Good first issue for new contributors
F-help-wanted
Flag: Help wanted
S-confirmed
Status: Confirmed
T-bug
Type: Bug
If a JSON block model specifies the
rotation
attribute, vanilla will generate baked quads with the vertices transposed correctly, but the quad's facing will be that of the quad before it was rotated. This allows a call toBakedModel.getQuads
to return BakedQuads which do not have the requested facing, and causes the lighting engine in Sodium to render incorrect results as it depends on the baked quad's facing being correct in order to avoid unnecessary computation.There are a few ways to approach this issue, each with varying amounts of invasiveness:
BakedModel.getQuads
, and if not, calculate new data with the "correct" facing. This makes the slow case a rarity, but still doesn't fix other things in the pipeline which depend on the BakedQuad having the right data in the first place.A test case was provided by
Layl#8888
on the Fabric Discord which reproduces this issue clearly.Example of broken lighting
Example of broken block model
The text was updated successfully, but these errors were encountered: