I want to render shapes through blocks. I found this code in minecraft source
public static void renderShape(PoseStack poseStack, VertexConsumer vertexConsumer, VoxelShape shape, double minX, double minY, double minZ, float red, float green, float blue, float alpha) {
PoseStack.Pose pose = poseStack.last();
shape.forAllEdges((x1, y1, z1, x2, y2, z2) -> {
float dx = (float)(x2 - x1);
float dy = (float)(y2 - y1);
float dz = (float)(z2 - z1);
float length = Mth.sqrt(dx * dx + dy * dy + dz * dz);
dx /= length;
dy /= length;
dz /= length;
vertexConsumer.vertex(pose.pose(), (float)(x1 + minX), (float)(y1 + minY), (float)(z1 + minZ)).color(red, green, blue, alpha).normal(pose.normal(), dx, dy, dz).endVertex();
vertexConsumer.vertex(pose.pose(), (float)(x2 + minX), (float)(y2 + minY), (float)(z2 + minZ)).color(red, green, blue, alpha).normal(pose.normal(), dx, dy, dz).endVertex();
});
}
that draws a rectangle around the block, but it is not visible through other blocks. Could someone point me in the right direction on how one renders things through blocks?
Thanks in advance ๐