CaffeineMC / sodium

A Minecraft mod designed to improve frame rates and reduce micro-stutter
Other
4.79k stars 811 forks source link

Rotated block models have the wrong quad facing, breaking block light rendering #461

Open jellysquid3 opened 3 years ago

jellysquid3 commented 3 years ago

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 to BakedModel.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:

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

LaylBongers commented 3 years ago

Thinking over this issue, I personally do not see any situation where a rotation set to 0 giving a different result from no rotation specified at all is an intended feature rather than a bug. Maybe fix it in BakedQuad initialization with a conditional option for compatibility just in case?

MeeniMc commented 2 months ago

Issue is resolved in 0.6b1 and can be closed