Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Font;
//import net.minecraft.client.renderer.CoreShaders;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.rendertype.RenderType;
import net.minecraft.client.renderer.rendertype.RenderTypes;
Expand Down Expand Up @@ -634,7 +635,7 @@ private static void renderTextFacingCamera(Component text, Vec3 pos, float offse
poseStack.mulPose(mc.gameRenderer.getMainCamera().rotation());

// Calculate scale based on distance
scale *= 0.005f * (mc.player.position().distanceTo(pos) / 2.4);
scale *= 0.007f * (mc.player.position().distanceTo(pos) / 2.4);
scale = Math.clamp(scale, 0.015f, 0.15f);

// Apply scaling (negative Y to flip text right-side up)
Expand All @@ -660,7 +661,7 @@ private static void renderTextFacingCamera(Component text, Vec3 pos, float offse

// Use immediate mode rendering with proper depth handling
try (RenderBufferGuard guard = RenderBufferGuard.open(false, true, false)) {
mc.font.drawInBatch(text, x, y, colorAlphaHex, shadow, matrix, guard.bufferSource, Font.DisplayMode.NORMAL, bgColor, 15728880);
mc.font.drawInBatch(text, x, y, colorAlphaHex, shadow, matrix, guard.bufferSource, Font.DisplayMode.SEE_THROUGH, bgColor, LightTexture.FULL_BRIGHT);
}

/*var poseStack = new PoseStack();
Expand Down
Loading