From e89108e15f75b5721050cd0faa230cd85da5a686 Mon Sep 17 00:00:00 2001 From: WilyFoxM Date: Wed, 4 Nov 2026 01:20:00 +0300 Subject: [PATCH] Skip Item Displays outside the view Parts already on the GPU whose bounds lie outside this frame's view are skipped before extraction, while their ticks and animation keep running. A new setting controls it, ON by default, and the add-on gains a live_culling benchmark target. --- README.md | 2 + .../drawless/diagnostics/BenchmarkSeries.java | 5 +- .../drawless/config/DrawLessConfig.java | 1 + .../wilyfox/drawless/gui/SettingsCatalog.java | 6 ++ .../mixin/ExtremeDisplayVisibilityMixin.java | 7 +- .../drawless/performance/ItemMeshes.java | 22 ++++- .../performance/LiveDisplayGeometry.java | 98 ++++++++++++++++++- .../resources/assets/drawless/lang/en_us.json | 2 + .../resources/assets/drawless/lang/ru_ru.json | 2 + 9 files changed, 135 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 90b85bf..a8e44e1 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ rendering, and every optimization has its own switch. - Live geometry: supported Item Display models, including ModelEngine models built from them, keep their meshes on the GPU and draw together; each frame sends only poses, lighting and tint. +- Parts of these models outside the camera view are skipped for the frame; their + ticks and animation keep running. - A model cache reuses prepared model layers and refreshes them within a CPU budget. **Players** diff --git a/src/dev/java/ru/wilyfox/drawless/diagnostics/BenchmarkSeries.java b/src/dev/java/ru/wilyfox/drawless/diagnostics/BenchmarkSeries.java index d74801b..cdae240 100644 --- a/src/dev/java/ru/wilyfox/drawless/diagnostics/BenchmarkSeries.java +++ b/src/dev/java/ru/wilyfox/drawless/diagnostics/BenchmarkSeries.java @@ -31,6 +31,7 @@ public enum Target { PLAYER_ARMOR, PLAYER_ITEMS, PLAYER_BODY, + LIVE_CULLING, BATCHING; String id() { @@ -52,6 +53,7 @@ void apply(boolean on) { case PLAYER_ARMOR -> c.playerArmorGeometry = on; case PLAYER_ITEMS -> c.playerItemGeometry = on; case PLAYER_BODY -> c.playerBodyGeometry = on; + case LIVE_CULLING -> c.liveViewCulling = on; case BATCHING -> c.featureBatching = on; } } @@ -61,7 +63,8 @@ boolean unavailable() { || (this == BATCHING || this == PLAYER_ARMOR || this == PLAYER_ITEMS - || this == PLAYER_BODY) + || this == PLAYER_BODY + || this == LIVE_CULLING) && ru.wilyfox.drawless.compat.IrisShaders.packInUse() || this == PLAYER_BODY && RenderModSupport.PLAYER_MODEL_MODS || (this == PARTICLES || this == PARTICLE_LIGHT || this == PARTICLE_COLLISION) diff --git a/src/main/java/ru/wilyfox/drawless/config/DrawLessConfig.java b/src/main/java/ru/wilyfox/drawless/config/DrawLessConfig.java index 874ece3..edca81c 100644 --- a/src/main/java/ru/wilyfox/drawless/config/DrawLessConfig.java +++ b/src/main/java/ru/wilyfox/drawless/config/DrawLessConfig.java @@ -26,6 +26,7 @@ public final class DrawLessConfig { public boolean adaptiveDisplayModelBudget = true; public ExtremeDisplayMode extremeDisplayMode = ExtremeDisplayMode.LIVE_CACHE; public boolean extremeAllItemDisplays = true; + public boolean liveViewCulling = true; public boolean modelEngineNpcBudget = false; public int npcGroupsPerFrame = 2; public boolean adaptiveNpcBudget = true; diff --git a/src/main/java/ru/wilyfox/drawless/gui/SettingsCatalog.java b/src/main/java/ru/wilyfox/drawless/gui/SettingsCatalog.java index 9020eab..ac57498 100644 --- a/src/main/java/ru/wilyfox/drawless/gui/SettingsCatalog.java +++ b/src/main/java/ru/wilyfox/drawless/gui/SettingsCatalog.java @@ -133,6 +133,12 @@ static List