Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/20/21 in all areas

  1. You're welcome! 🙂 I think that may also be fixable with a custom RenderType. They can specify layering, blending, masking, etc.
    1 point
  2. I've finally got a solution to the positional problem. It turns out DrawHighlightEvent is fired before all the relevant batches are drawn, while RenderWorldLastEvent is fired after all the buffers have been drawn. (I would consider this a bug.) That means that while your buffer's waiting patiently to be drawn, other parts of the code can change the global projection matrix. Notably, GameRenderer#renderItemInHand starts mucking about with the projection matrix naught but 4 lines later. The result is all this unpredictable failure. The solution is to draw your buffer at the end of writing to it, with Impl#endBatch(RenderType). Here is a working (and more thoroughly tested) example: @EventBusSubscriber(Dist.CLIENT) public class SpellRenderEventSubscriber { @SubscribeEvent public static void worldRender(RenderWorldLastEvent event) { Impl buffer = Minecraft.getInstance().renderBuffers().bufferSource(); IVertexBuilder builder = buffer.getBuffer(SpellRender.QUADS); //SpellRender.QUADS is a personal RenderType, of VertexFormat POSITION_COLOR. MatrixStack stack = event.getMatrixStack(); stack.pushPose(); Vector3d cam = Minecraft.getInstance().gameRenderer.getMainCamera().getPosition(); stack.translate(-cam.x, -cam.y, -cam.z); Matrix4f mat = stack.last().pose(); builder.vertex(mat, 0, 57, 0).color(0, 255, 255, 150).endVertex(); builder.vertex(mat, 1, 57, 0).color(0, 255, 255, 150).endVertex(); builder.vertex(mat, 1, 58, 0).color(0, 255, 255, 150).endVertex(); builder.vertex(mat, 0, 58, 0).color(0, 255, 255, 150).endVertex(); stack.popPose(); buffer.endBatch(SpellRender.QUADS); } } And the result, which stays where it's told despite all manner of character-scooching/FOV-changing:
    1 point
  3. We don't have anyone on the dev team who uses an M1 Mac... in theory we could update pre-1.17 versions to the fixed versions of LWJGL, but we'd need someone who knows what they're doing to help make sure such a change would A) Work and B) Not screw anything else up
    1 point
×
×
  • Create New...

Important Information

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