Jump to content

Miyanber

Members
  • Posts

    1
  • Joined

  • Last visited

Converted

  • Location
    Japan

Miyanber's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I succeeded in rendering quads. However, they go dark when players are above them. Like these picture : https://drive.google.com/file/d/1zdbiE-pmGk3VuLy5ZSPtPDo-4UpHcKsa/view?usp=sharing https://drive.google.com/file/d/1AgJv2ncXjqRGh_oTURNCtVdMfDWws8s2/view?usp=sharing Is there something wrong with my codes? public class RenderTester implements BlockEntityRenderer<BlockEntityTester> { private static final ResourceLocation GRAVEL_TEXTURE = new ResourceLocation("textures/block/gravel.png"); public RenderTester (BlockEntityRendererProvider.Context context) {} @Override public void render(@NotNull BlockEntityTester pBlockEntity, float pPartialTick, @NotNull PoseStack pPoseStack, @NotNull MultiBufferSource pBuffer, int pPackedLight, int pPackedOverlay) { VertexConsumer builder = pBuffer.getBuffer(RenderType.entityCutoutNoCull(GRAVEL_TEXTURE)); BufferUtil.drawQuad(builder, pPoseStack, 0.0F, 1.0F, 0.0F, 1.0F, 1.0F, 1.0F, 0.0F, 0.0F, 1.0F, 1.0F, pPackedLight, pPackedOverlay, 0xFFFFFFFF); } } public class BufferUtil { public static void drawVertex(VertexConsumer builder, PoseStack poseStack, float x, float y, float z, float u, float v, int packedLight, int pPackedOverlay, int color) { builder.vertex(poseStack.last().pose(), x, y, z) .color(color) .uv(u, v) .overlayCoords(pPackedOverlay) .uv2(packedLight) .normal(0, 1, 0) .endVertex(); } public static void drawQuad(VertexConsumer builder, PoseStack poseStack, float x0, float y0, float z0, float x1, float y1, float z1, float u0, float v0, float u1, float v1, int packedLight, int pPackedOverlay, int color) { drawVertex(builder, poseStack, x0, y0, z0, u0, v0, packedLight, pPackedOverlay, color); drawVertex(builder, poseStack, x0, y1, z1, u0, v1, packedLight, pPackedOverlay, color); drawVertex(builder, poseStack, x1, y1, z1, u1, v1, packedLight, pPackedOverlay, color); drawVertex(builder, poseStack, x1, y0, z0, u1, v0, packedLight, pPackedOverlay, color); } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.