Fix bad flat lighting on inset quads (#253) (#254)

This commit is contained in:
grondag 2019-06-06 10:44:54 -07:00 committed by Adrian Siekierka
parent c00bc2e112
commit 0ddb3a4838
2 changed files with 3 additions and 2 deletions

View file

@ -27,6 +27,7 @@ import net.fabricmc.indigo.renderer.aocalc.AoCalculator;
import net.fabricmc.indigo.renderer.helper.ColorHelper;
import net.fabricmc.indigo.renderer.mesh.EncodingFormat;
import net.fabricmc.indigo.renderer.mesh.MutableQuadViewImpl;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
@ -140,7 +141,7 @@ public abstract class AbstractQuadRenderer {
*/
int flatBrightness(MutableQuadViewImpl quad, BlockState blockState, BlockPos pos) {
mpos.set(pos);
if((quad.geometryFlags() & LIGHT_FACE_FLAG) != 0) {
if((quad.geometryFlags() & LIGHT_FACE_FLAG) != 0 || Block.isShapeFullCube(blockState.getCollisionShape(blockInfo.blockView, pos))) {
mpos.setOffset(quad.lightFace());
}
return brightnessFunc.applyAsInt(blockState, mpos);

View file

@ -132,7 +132,7 @@ public class TerrainFallbackConsumer extends AbstractQuadRenderer implements Con
// vanilla compatibility hack
// For flat lighting, cull face drives everything and light face is ignored.
if(cullFace == null) {
editorQuad.geometryFlags(0);
editorQuad.invalidateShape();
} else {
editorQuad.geometryFlags(GeometryHelper.LIGHT_FACE_FLAG);
editorQuad.lightFace(cullFace);