Make IVertexConsumers such as the lighting pipeline, be aware of which format they are dealing with. (#8692)

Also fix Lighting pipeline ignoring the overlay coords from the block renderer.
This commit is contained in:
gigaherz authored and GitHub committed 2022-06-09 21:39:16 +02:00
1 parent e6a73ef36c
commit d7bc564512
13 files changed
+123 -52

No files matched your search

@@ -5,13 +5,14 @@
package net.minecraftforge.client.extensions;
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.blaze3d.vertex.VertexFormat;
import net.minecraft.client.renderer.block.model.BakedQuad;
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import net.minecraftforge.client.model.pipeline.LightUtil;
import org.jetbrains.annotations.Nullable;
import org.lwjgl.system.MemoryStack;
import java.nio.Buffer;
@@ -34,6 +35,8 @@ public interface IForgeVertexConsumer
return (VertexConsumer) this;
}
VertexFormat getVertexFormat();
// Copy of putBulkData, but enables tinting and per-vertex alpha
default void putBulkData(PoseStack.Pose poseStack, BakedQuad bakedQuad, float red, float green, float blue, int packedLight, int packedOverlay, boolean readExistingColor) {
putBulkData(poseStack, bakedQuad, red, green, blue, 1.0f, packedLight, packedOverlay, readExistingColor);