Posted July 16, 20205 yr I am making an "echolocation" helmet that shows wireframes around specific nearby blocks when you wear it (mostly ores). I have the helmet detection code, but when I render wireframes they are obscured by the intervening blocks (I want them visible through those blocks). I tried using both `RenderSystem` and `GlStateManager`'s methods `disableDepthTest` and `disableCull`, in all combinations, but none of them produce this effect. How can I make my changes visible on top of everything else? Code: @SubscribeEvent public void onRenderWorldLast(RenderWorldLastEvent event) { // only run if wearing helmet // if (!echolocation_active) return; ActiveRenderInfo renderInfo = Minecraft.getInstance().gameRenderer.getActiveRenderInfo(); Vector3d pv = renderInfo.getProjectedView(); double x = pv.getX(), y = pv.getY(), z = pv.getZ(); IRenderTypeBuffer.Impl buffer = Minecraft.getInstance().getRenderTypeBuffers().getBufferSource(); IVertexBuilder builder = buffer.getBuffer(RenderType.LINES); MatrixStack matrixStack = event.getMatrixStack(); matrixStack.push(); matrixStack.translate(-x, -y, -z); // disable depth here, somehow // for debugging: put wireframe around 0,0,0 WorldRenderer.drawBoundingBox(matrixStack, builder, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1); buffer.finish(RenderType.LINES); matrixStack.pop(); } Edited July 16, 20205 yr by Ravenwolf397 clarity
July 16, 20205 yr Author It appears that this requires both `RenderSystem.disableDepthTest()` and `RenderSystem.depthMask(false)`.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.