diff --git a/gradle.properties b/gradle.properties index 6444d17..e730cbf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ yarn_mappings=1.20.1+build.10 loader_version=0.15.9 # Mod Properties -mod_version=0.5.1 +mod_version=0.5.4 maven_group=rogo.renderingculling archives_base_name=BruteForceRenderingCulling-fabric-1.20.1 diff --git a/src/main/java/rogo/renderingculling/api/Config.java b/src/main/java/rogo/renderingculling/api/Config.java index a66061e..b572a9b 100644 --- a/src/main/java/rogo/renderingculling/api/Config.java +++ b/src/main/java/rogo/renderingculling/api/Config.java @@ -75,6 +75,12 @@ public static boolean getAsyncChunkRebuild() { if(!shouldCullChunk()) return false; + if(CullingHandler.hasNvidium()) + return false; + + if(!CullingHandler.hasSodium()) + return false; + return ASYNC.getValue(); } @@ -82,6 +88,12 @@ public static void setAsyncChunkRebuild(boolean value) { if(!shouldCullChunk()) return; + if(CullingHandler.hasNvidium()) + return; + + if(!CullingHandler.hasSodium()) + return; + ASYNC.setValue(value); save(); } diff --git a/src/main/java/rogo/renderingculling/api/CullingHandler.java b/src/main/java/rogo/renderingculling/api/CullingHandler.java index 584ee13..c007751 100644 --- a/src/main/java/rogo/renderingculling/api/CullingHandler.java +++ b/src/main/java/rogo/renderingculling/api/CullingHandler.java @@ -316,9 +316,7 @@ public static boolean shouldSkipEntity(Entity entity) { public static void onProfilerPopPush(String s) { switch (s) { case "beforeRunTick" -> { - if (((AccessorLevelRender) Minecraft.getInstance().levelRenderer).getNeedsFullRenderChunkUpdate() && Minecraft.getInstance().level != null) { - fullChunkUpdateCooldown = 20; - + if (Minecraft.getInstance().level != null) { LEVEL_SECTION_RANGE = Minecraft.getInstance().level.getMaxSection() - Minecraft.getInstance().level.getMinSection(); LEVEL_MIN_SECTION_ABS = Math.abs(Minecraft.getInstance().level.getMinSection()); LEVEL_MIN_POS = Minecraft.getInstance().level.getMinBuildHeight(); @@ -710,9 +708,12 @@ public static boolean hasIris() { return FabricLoader.getInstance().getAllMods().stream().anyMatch(modInfo -> modInfo.getMetadata().getId().equals("iris") || modInfo.getMetadata().getId().equals("oculus")); } + public static boolean hasNvidium() { + return FabricLoader.getInstance().getAllMods().stream().anyMatch(modInfo -> modInfo.getMetadata().getId().equals("nvidium")); + } + public static boolean needPauseRebuild() { - //fullChunkUpdateCooldown > 0 - return false; + return fullChunkUpdateCooldown > 0; } public static int mapChunkY(double posY) { diff --git a/src/main/java/rogo/renderingculling/api/ModLoader.java b/src/main/java/rogo/renderingculling/api/ModLoader.java index d4c2948..8cd06d0 100644 --- a/src/main/java/rogo/renderingculling/api/ModLoader.java +++ b/src/main/java/rogo/renderingculling/api/ModLoader.java @@ -85,7 +85,7 @@ private void onStartClientTick(Minecraft client) { if (Minecraft.getInstance().player != null && Minecraft.getInstance().level != null) { Config.loadConfig(); clientTickCount++; - if (Minecraft.getInstance().player.tickCount > 200 && clientTickCount > 200 && CHUNK_CULLING_MAP != null && !CHUNK_CULLING_MAP.isDone()) { + if (Minecraft.getInstance().player.tickCount > 60 && clientTickCount > 60 && CHUNK_CULLING_MAP != null && !CHUNK_CULLING_MAP.isDone()) { CHUNK_CULLING_MAP.setDone(); LEVEL_SECTION_RANGE = Minecraft.getInstance().level.getMaxSection() - Minecraft.getInstance().level.getMinSection(); LEVEL_MIN_SECTION_ABS = Math.abs(Minecraft.getInstance().level.getMinSection()); @@ -122,6 +122,6 @@ public static int getB() { } public static Vector4f[] getFrustumPlanes(FrustumIntersection frustum) { - return ((AccessorFrustum.AccessorFrustumIntersection) ((AccessorFrustum) frustum).frustumIntersection()).planes(); + return ((AccessorFrustum.AccessorFrustumIntersection) frustum).planes(); } } diff --git a/src/main/java/rogo/renderingculling/api/impl/IRenderChunkInfo.java b/src/main/java/rogo/renderingculling/api/impl/IRenderChunkInfo.java index ad98756..355e6d2 100644 --- a/src/main/java/rogo/renderingculling/api/impl/IRenderChunkInfo.java +++ b/src/main/java/rogo/renderingculling/api/impl/IRenderChunkInfo.java @@ -4,4 +4,6 @@ public interface IRenderChunkInfo { ChunkRenderDispatcher.RenderChunk getRenderChunk(); + + int getStep(); } diff --git a/src/main/java/rogo/renderingculling/gui/ConfigScreen.java b/src/main/java/rogo/renderingculling/gui/ConfigScreen.java index ee3dfcb..cbbb531 100644 --- a/src/main/java/rogo/renderingculling/gui/ConfigScreen.java +++ b/src/main/java/rogo/renderingculling/gui/ConfigScreen.java @@ -3,6 +3,7 @@ import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.*; +import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.AbstractWidget; @@ -127,11 +128,11 @@ protected void init() { } //if (player.getName().getString().equals("Dev")) { - addConfigButton(() -> CullingHandler.checkCulling, (b) -> CullingHandler.checkCulling = b, () -> Component.literal("Debug")) - .setDetailMessage(() -> Component.translatable("brute_force_rendering_culling.detail.debug")); + addConfigButton(() -> CullingHandler.checkCulling, (b) -> CullingHandler.checkCulling = b, () -> Component.literal("Debug")) + .setDetailMessage(() -> Component.translatable("brute_force_rendering_culling.detail.debug")); - addConfigButton(() -> CullingHandler.checkTexture, (b) -> CullingHandler.checkTexture = b, () -> Component.literal("Check Texture")) - .setDetailMessage(() -> Component.translatable("brute_force_rendering_culling.detail.check_texture")); + addConfigButton(() -> CullingHandler.checkTexture, (b) -> CullingHandler.checkTexture = b, () -> Component.literal("Check Texture")) + .setDetailMessage(() -> Component.translatable("brute_force_rendering_culling.detail.check_texture")); //} addConfigButton(Config::getSampling, (value) -> { @@ -156,8 +157,15 @@ protected void init() { }, () -> Component.translatable("brute_force_rendering_culling.culling_map_update_delay")) .setDetailMessage(() -> Component.translatable("brute_force_rendering_culling.detail.culling_map_update_delay")); - addConfigButton(Config::getCullChunk, Config::getAsyncChunkRebuild, Config::setAsyncChunkRebuild, () -> Component.translatable("brute_force_rendering_culling.async")) - .setDetailMessage(() -> Component.translatable("brute_force_rendering_culling.detail.async")); + addConfigButton(() -> Config.getCullChunk() && CullingHandler.hasSodium() && !CullingHandler.hasNvidium(), Config::getAsyncChunkRebuild, Config::setAsyncChunkRebuild, () -> Component.translatable("brute_force_rendering_culling.async")) + .setDetailMessage(() -> { + if (CullingHandler.hasNvidium()) { + return Component.translatable("brute_force_rendering_culling.detail.nvidium"); + } else if (!CullingHandler.hasSodium()) { + return Component.translatable("brute_force_rendering_culling.detail.sodium"); + } else + return Component.translatable("brute_force_rendering_culling.detail.async"); + }); addConfigButton(Config::getCullChunk, Config::setCullChunk, () -> Component.translatable("brute_force_rendering_culling.cull_chunk")) .setDetailMessage(() -> Component.translatable("brute_force_rendering_culling.detail.cull_chunk")); addConfigButton(Config::getCullEntity, Config::setCullEntity, () -> Component.translatable("brute_force_rendering_culling.cull_entity")) diff --git a/src/main/java/rogo/renderingculling/gui/NeatButton.java b/src/main/java/rogo/renderingculling/gui/NeatButton.java index ab3deab..30851c6 100644 --- a/src/main/java/rogo/renderingculling/gui/NeatButton.java +++ b/src/main/java/rogo/renderingculling/gui/NeatButton.java @@ -3,6 +3,7 @@ import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.*; +import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Font; import net.minecraft.client.gui.GuiGraphics; @@ -91,7 +92,12 @@ public void shouDetail(GuiGraphics guiGraphics, Font font) { List components = new ArrayList<>(); String[] parts = detailMessage.get().getString().split("\\n"); for (String part : parts) { - components.add(Component.literal(part)); + Component text = Component.literal(part); + if(part.contains("warn:")) { + String[] warn = part.split("warn:"); + text = Component.literal(warn[1]).withStyle(ChatFormatting.DARK_RED); + } + components.add(text); } guiGraphics.renderComponentTooltip(font, components, this.getX() + this.width / 2, this.getY() + (this.height - 8) / 2); CullingHandler.reColorToolTip = false; diff --git a/src/main/java/rogo/renderingculling/gui/NeatSliderButton.java b/src/main/java/rogo/renderingculling/gui/NeatSliderButton.java index acc9849..23dd102 100644 --- a/src/main/java/rogo/renderingculling/gui/NeatSliderButton.java +++ b/src/main/java/rogo/renderingculling/gui/NeatSliderButton.java @@ -3,6 +3,7 @@ import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.*; +import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Font; import net.minecraft.client.gui.GuiGraphics; @@ -88,7 +89,12 @@ public void shouDetail(GuiGraphics guiGraphics, Font font) { List components = new ArrayList<>(); String[] parts = detailMessage.get().getString().split("\\n"); for (String part : parts) { - components.add(Component.literal(part)); + Component text = Component.literal(part); + if(part.contains("warn:")) { + String[] warn = part.split("warn:"); + text = Component.literal(warn[1]).withStyle(ChatFormatting.DARK_RED); + } + components.add(text); } guiGraphics.renderComponentTooltip(font, components, this.getX() + this.width / 2, this.getY() + (this.height - 8) / 2); CullingHandler.reColorToolTip = false; diff --git a/src/main/java/rogo/renderingculling/mixin/MixinLevelRender.java b/src/main/java/rogo/renderingculling/mixin/MixinLevelRender.java index dd0fb8c..528cde2 100644 --- a/src/main/java/rogo/renderingculling/mixin/MixinLevelRender.java +++ b/src/main/java/rogo/renderingculling/mixin/MixinLevelRender.java @@ -13,8 +13,8 @@ import org.joml.Matrix4f; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Mutable; import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.gen.Accessor; import org.spongepowered.asm.mixin.gen.Invoker; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -28,26 +28,32 @@ import javax.annotation.Nullable; import java.lang.reflect.Field; -import java.util.LinkedHashSet; -import java.util.Queue; import java.util.concurrent.atomic.AtomicReference; @Mixin(LevelRenderer.class) public abstract class MixinLevelRender implements IEntitiesForRender { + @Mutable @Final @Shadow - private ObjectArrayList renderChunksInFrustum; + private ObjectArrayList renderChunksInFrustum; - @Shadow @Nullable protected abstract ChunkRenderDispatcher.RenderChunk getRelativeFrom(BlockPos p_109729_, ChunkRenderDispatcher.RenderChunk p_109730_, Direction p_109731_); + @Shadow + @Nullable + protected abstract ChunkRenderDispatcher.RenderChunk getRelativeFrom(BlockPos p_109729_, ChunkRenderDispatcher.RenderChunk p_109730_, Direction p_109731_); - @Shadow @Nullable private ViewArea viewArea; + @Shadow + @Nullable + private ViewArea viewArea; - @Shadow @Final private AtomicReference renderChunkStorage; + @Shadow + @Final + private AtomicReference renderChunkStorage; + private LevelRenderer.RenderChunkStorage renderChunkStorageTemp; @Inject(method = "applyFrustum", at = @At(value = "RETURN")) public void onApplyFrustum(Frustum p_194355_, CallbackInfo ci) { - if (Config.shouldCullChunk() && !Config.getAsyncChunkRebuild()) { + if (Config.shouldCullChunk() && !VanillaAsyncUtil.shouldReplaceStorage()) { if (CullingHandler.OptiFine != null) { try { Field field = LevelRenderer.class.getDeclaredField("renderInfosTerrain"); @@ -71,31 +77,25 @@ public void onApplyFrustum(Frustum p_194355_, CallbackInfo ci) { } } - @Inject(method = "updateRenderChunks", at = @At(value = "INVOKE", target = "Ljava/util/Queue;isEmpty()Z"), cancellable = true) - public void onUpdateRenderChunks(LinkedHashSet p_194363_, LevelRenderer.RenderInfoMap p_194364_, Vec3 p_194365_, Queue p_194366_, boolean p_194367_, CallbackInfo ci) { - if (Config.getAsyncChunkRebuild()) { - ci.cancel(); - } - } - @Inject(method = "setupRender", at = @At(value = "HEAD")) public void onSetupRenderHead(Camera p_194339_, Frustum p_194340_, boolean p_194341_, boolean p_194342_, CallbackInfo ci) { - if(this.viewArea != null) { - VanillaAsyncUtil.update((LevelRenderer) (Object)this, this.viewArea.chunks.length); + if (this.viewArea != null) { + VanillaAsyncUtil.update((LevelRenderer) (Object) this, this.viewArea.chunks.length); } } - @Inject(method = "setupRender", at = @At(value = "RETURN")) - public void onSetupRenderEnd(Camera p_194339_, Frustum p_194340_, boolean p_194341_, boolean p_194342_, CallbackInfo ci) { - if (Config.getAsyncChunkRebuild() && VanillaAsyncUtil.getChunkStorage() != null) { + @Inject(method = "applyFrustum", at = @At(value = "HEAD")) + public void onApplyFrustumHead(Frustum p_194355_, CallbackInfo ci) { + if (VanillaAsyncUtil.shouldReplaceStorage()) { + renderChunkStorageTemp = this.renderChunkStorage.get(); this.renderChunkStorage.set(VanillaAsyncUtil.getChunkStorage()); } } - @Inject(method = "initializeQueueForFullUpdate", at = @At(value = "HEAD"), cancellable = true) - public void onInitializeQueueForFullUpdate(Camera p_194344_, Queue p_194345_, CallbackInfo ci) { - if (Config.getAsyncChunkRebuild()) { - ci.cancel(); + @Inject(method = "applyFrustum", at = @At(value = "RETURN")) + public void onApplyFrustumReturn(Frustum p_194355_, CallbackInfo ci) { + if (VanillaAsyncUtil.shouldReplaceStorage()) { + this.renderChunkStorage.set(renderChunkStorageTemp); } } @@ -116,17 +116,7 @@ public ChunkRenderDispatcher.RenderChunk invokeGetRelativeFrom(BlockPos pos, Chu @Override public ChunkRenderDispatcher.RenderChunk invokeGetRenderChunkAt(BlockPos pos) { - return ((AccessorViewArea)this.viewArea).invokeGetRenderChunkAt(pos); - } - - @Mixin(LevelRenderer.RenderChunkInfo.class) - public interface AccessorRenderChunkInfo { - - @Accessor("directions") - byte getDirections(); - - @Accessor("step") - int getStep(); + return ((AccessorViewArea) this.viewArea).invokeGetRenderChunkAt(pos); } @Mixin(ViewArea.class) diff --git a/src/main/java/rogo/renderingculling/mixin/MixinRenderChunkInfo.java b/src/main/java/rogo/renderingculling/mixin/MixinRenderChunkInfo.java index 0dcfc16..0a49082 100644 --- a/src/main/java/rogo/renderingculling/mixin/MixinRenderChunkInfo.java +++ b/src/main/java/rogo/renderingculling/mixin/MixinRenderChunkInfo.java @@ -18,4 +18,13 @@ public class MixinRenderChunkInfo implements IRenderChunkInfo { public ChunkRenderDispatcher.RenderChunk getRenderChunk() { return chunk; } + + @Shadow + @Final + int step; + + @Override + public int getStep() { + return this.step; + } } diff --git a/src/main/java/rogo/renderingculling/mixin/sodium/MixinOcclusionCuller.java b/src/main/java/rogo/renderingculling/mixin/sodium/MixinOcclusionCuller.java index fc440e3..023456a 100644 --- a/src/main/java/rogo/renderingculling/mixin/sodium/MixinOcclusionCuller.java +++ b/src/main/java/rogo/renderingculling/mixin/sodium/MixinOcclusionCuller.java @@ -1,5 +1,6 @@ package rogo.renderingculling.mixin.sodium; +import com.mojang.blaze3d.systems.RenderSystem; import me.jellysquid.mods.sodium.client.render.chunk.RenderSection; import me.jellysquid.mods.sodium.client.render.chunk.occlusion.OcclusionCuller; import me.jellysquid.mods.sodium.client.render.viewport.Viewport; @@ -25,8 +26,7 @@ private static void onIsSectionVisible(RenderSection section, Viewport viewport, @Inject(method = "findVisible", at = @At(value = "HEAD"), remap = false, cancellable = true) private void onFindVisible(OcclusionCuller.Visitor visitor, Viewport viewport, float searchDistance, boolean useOcclusionCulling, int frame, CallbackInfo ci) { - if (SodiumSectionAsyncUtil.asyncSearching && Thread.currentThread() != OcclusionCullerThread.INSTANCE) { - SodiumSectionAsyncUtil.asyncSearching = false; + if (Config.getAsyncChunkRebuild() && RenderSystem.isOnRenderThread()) { ci.cancel(); } } diff --git a/src/main/java/rogo/renderingculling/mixin/sodium/MixinRenderSectionManager.java b/src/main/java/rogo/renderingculling/mixin/sodium/MixinRenderSectionManager.java index e43ef6b..eff2b5e 100644 --- a/src/main/java/rogo/renderingculling/mixin/sodium/MixinRenderSectionManager.java +++ b/src/main/java/rogo/renderingculling/mixin/sodium/MixinRenderSectionManager.java @@ -41,7 +41,6 @@ private void onIsSectionVisible(int x, int y, int z, CallbackInfoReturnable sections, Level world) { SodiumSectionAsyncUtil.occlusionCuller = new OcclusionCuller(sections, world); diff --git a/src/main/java/rogo/renderingculling/util/VanillaAsyncUtil.java b/src/main/java/rogo/renderingculling/util/VanillaAsyncUtil.java index c90a54a..2827aca 100644 --- a/src/main/java/rogo/renderingculling/util/VanillaAsyncUtil.java +++ b/src/main/java/rogo/renderingculling/util/VanillaAsyncUtil.java @@ -5,15 +5,16 @@ import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; -import net.minecraft.world.phys.Vec3; +import net.minecraft.core.SectionPos; import org.jetbrains.annotations.NotNull; +import rogo.renderingculling.api.Config; import rogo.renderingculling.api.CullingHandler; import rogo.renderingculling.api.impl.IEntitiesForRender; import rogo.renderingculling.api.impl.IRenderChunkInfo; import rogo.renderingculling.api.impl.IRenderSectionVisibility; -import rogo.renderingculling.mixin.MixinLevelRender; import java.util.ArrayDeque; +import java.util.HashSet; import java.util.Queue; import static net.minecraft.client.renderer.LevelRenderer.DIRECTIONS; @@ -24,26 +25,35 @@ public class VanillaAsyncUtil { private static LevelRenderer levelRenderer; public static void asyncSearchRebuildSection() { - if(levelRenderer == null) return; + if (levelRenderer == null) return; LevelRenderer.RenderChunkStorage renderChunkStorage = new LevelRenderer.RenderChunkStorage(chunkLength); Queue queue = new ArrayDeque<>(); + HashSet posHashSet = new HashSet<>(); BlockPos origin = getOriginPos(); LevelRenderer.RenderChunkInfo originChunk = new LevelRenderer.RenderChunkInfo(((IEntitiesForRender) levelRenderer).invokeGetRenderChunkAt(origin), null, 0); queue.add(originChunk); - double range = Minecraft.getInstance().options.getEffectiveRenderDistance() * 16; + while (!queue.isEmpty()) { LevelRenderer.RenderChunkInfo last = queue.poll(); ChunkRenderDispatcher.RenderChunk lastRenderChunk = ((IRenderChunkInfo) last).getRenderChunk(); - if(originChunk != last && !lastRenderChunk.getOrigin().closerThan(origin, range) && (!CullingHandler.FRUSTUM.isVisible(lastRenderChunk.getBoundingBox()) || !CullingHandler.shouldRenderChunk((IRenderSectionVisibility)lastRenderChunk, false))) continue; - renderChunkStorage.renderChunks.add(last); + if (originChunk != last && (!CullingHandler.FRUSTUM.isVisible(lastRenderChunk.getBoundingBox()) || !CullingHandler.shouldRenderChunk((IRenderSectionVisibility) lastRenderChunk, false))) { + continue; + } + + ChunkRenderDispatcher.CompiledChunk compiledChunk = lastRenderChunk.getCompiledChunk(); + boolean build = lastRenderChunk.isDirty() && Minecraft.getInstance().level.getLightEngine().lightOnInSection(SectionPos.of(lastRenderChunk.getOrigin())); + boolean render = !compiledChunk.getRenderableBlockEntities().isEmpty() || !compiledChunk.hasNoRenderableLayers(); + + if (build || render) { + renderChunkStorage.renderChunks.add(last); + } for (Direction direction : DIRECTIONS) { ChunkRenderDispatcher.RenderChunk sideRenderChunk = ((IEntitiesForRender) levelRenderer).invokeGetRelativeFrom(origin, lastRenderChunk, direction); - if (sideRenderChunk != null && (!last.hasDirection(direction.getOpposite()))) { - LevelRenderer.RenderChunkInfo newRenderChunk = new LevelRenderer.RenderChunkInfo(sideRenderChunk, direction, ((MixinLevelRender.AccessorRenderChunkInfo) last).getStep() + 1); - newRenderChunk.setDirections(((MixinLevelRender.AccessorRenderChunkInfo) last).getDirections(), direction); + if (sideRenderChunk != null && !posHashSet.contains(sideRenderChunk.getOrigin())) { + posHashSet.add(sideRenderChunk.getOrigin()); + LevelRenderer.RenderChunkInfo newRenderChunk = new LevelRenderer.RenderChunkInfo(sideRenderChunk, direction, ((IRenderChunkInfo) last).getStep() + 1); queue.add(newRenderChunk); - renderChunkStorage.renderInfoMap.put(sideRenderChunk, newRenderChunk); } } } @@ -59,6 +69,10 @@ public static LevelRenderer.RenderChunkStorage getChunkStorage() { return storage; } + public static boolean shouldReplaceStorage() { + return Config.getAsyncChunkRebuild() && getChunkStorage() != null; + } + @NotNull private static BlockPos getOriginPos() { BlockPos origin = Minecraft.getInstance().gameRenderer.getMainCamera().getBlockPosition(); diff --git a/src/main/resources/assets/brute_force_rendering_culling/lang/en_us.json b/src/main/resources/assets/brute_force_rendering_culling/lang/en_us.json index 30d62e6..0001164 100644 --- a/src/main/resources/assets/brute_force_rendering_culling/lang/en_us.json +++ b/src/main/resources/assets/brute_force_rendering_culling/lang/en_us.json @@ -23,9 +23,14 @@ "brute_force_rendering_culling.disable": "Disable", "brute_force_rendering_culling.detail.cull_entity": "Cull entities visually invisible", "brute_force_rendering_culling.detail.cull_chunk": "Cull chunks visually invisible", - "brute_force_rendering_culling.detail.async": "Requires Sodium support, asynchronously updates visible chunks in a separate thread and synchronizes with the main rendering thread. \n\nYou can increase the number of threads for loading blocks in the game settings to assist with this functionality.\n\nThis can accelerate chunk loading speed during movement and improve frame rates.\n\nIn the testing phase, if the game crashes during chunk loading, please try turning off this setting.", + "brute_force_rendering_culling.detail.async": "Asynchronously updates visible chunks in a separate thread and synchronizes with the main rendering thread. This can accelerate chunk loading speed during movement and improve frame rates.\n\nYou can increase the number of threads for loading blocks in the game settings to assist with this functionality. In the testing phase, if the game crashes during chunk loading, please try turning off this setting.", "brute_force_rendering_culling.detail.sampler": "Scaling ratio of the depth texture used for culling. Higher ratios result in more precise culling and better effects. \n\nDevices with better graphics card performance or lower game resolutions can increase this value. Not recommended to be below 20%.", "brute_force_rendering_culling.detail.culling_map_update_delay": "Frames delayed before culling texture updates to the CPU, preventing main thread stutter caused by incomplete data transmission. \n\nDebug by observing culling map update times.\n\nEnabling shaders will slow down data transmission, resulting in at least 1 frame delay.", "brute_force_rendering_culling.detail.check_texture": "For testing purposes, enables checking of depth and culling texture functionality when the data monitoring panel is open.", - "brute_force_rendering_culling.detail.debug": "For testing purposes, effective only in vanilla Minecraft, used to view culled chunks." + "brute_force_rendering_culling.detail.debug": "For testing purposes, effective only in vanilla Minecraft, used to view culled chunks.", + "brute_force_rendering_culling.detail.nvidium": "warn:Incompatible with Nvidium", + "brute_force_rendering_culling.detail.sodium": "warn:This feature requires of Sodium(Embeddium, Rubidium).", + + "brute_force_rendering_culling.skip_culling_entities": "Entities Excluded from Culling", + "brute_force_rendering_culling.skip_culling_block_entities": "Block Entities Excluded from Culling" } \ No newline at end of file diff --git a/src/main/resources/assets/brute_force_rendering_culling/lang/zh_cn.json b/src/main/resources/assets/brute_force_rendering_culling/lang/zh_cn.json index 6cea091..fe6b5d5 100644 --- a/src/main/resources/assets/brute_force_rendering_culling/lang/zh_cn.json +++ b/src/main/resources/assets/brute_force_rendering_culling/lang/zh_cn.json @@ -23,9 +23,14 @@ "brute_force_rendering_culling.disable": "关闭", "brute_force_rendering_culling.detail.cull_entity": "剔除视觉上不可见的实体", "brute_force_rendering_culling.detail.cull_chunk": "剔除视觉上不可见的区块", - "brute_force_rendering_culling.detail.async": "需要Sodium支持,使用独立线程异步更新可见区块,并同步到主渲染线程。\n\n可以适当提高游戏设置的多线程加载区块数量辅助此功能。\n\n可以加速移动时的区块构建速度,提升帧数。\n\n处于测试阶段,如在加载区块时崩溃请尝试关掉此设置。", + "brute_force_rendering_culling.detail.async": "使用独立线程异步更新可见区块,并同步到主渲染线程。可以加速移动时的区块构建速度,提升帧数。\n\n可以适当提高游戏设置的多线程加载区块数量辅助此功能。处于测试阶段,如在加载区块时崩溃请尝试关掉此设置。", "brute_force_rendering_culling.detail.sampler": "剔除所用深度纹理的缩放比例,比例越高剔除越精准、效果越好。\n\n显卡性能较好的设备、游戏分辨率较低的设备可以拉高此数值。不建议低于20%。", "brute_force_rendering_culling.detail.culling_map_update_delay": "剔除纹理更新到CPU之前所推迟的帧数,防止数据未完全传输造成主线程卡顿。\n\n可观察剔除图更新耗时进行调试。\n\n开启光影会使数据传输变慢,至少会有1帧延迟。", "brute_force_rendering_culling.detail.check_texture": "测试用,开启数据监控面板时可以查看深度纹理与剔除纹理工作是否正常。", - "brute_force_rendering_culling.detail.debug": "测试用,仅在原版生效,用于查看被剔除区块。" + "brute_force_rendering_culling.detail.debug": "测试用,仅在原版生效,用于查看被剔除区块。", + "brute_force_rendering_culling.detail.nvidium": "warn:无法与Nvidium共用", + "brute_force_rendering_culling.detail.sodium": "warn:此功能需要Sodium(Embeddium, Rubidium)", + + "brute_force_rendering_culling.skip_culling_entities": "不被剔除的实体", + "brute_force_rendering_culling.skip_culling_block_entities": "不被剔除的方块实体" } \ No newline at end of file diff --git a/src/main/resources/brute_force_rendering_culling.accesswidener b/src/main/resources/brute_force_rendering_culling.accesswidener index 506d5b0..98b2f02 100644 --- a/src/main/resources/brute_force_rendering_culling.accesswidener +++ b/src/main/resources/brute_force_rendering_culling.accesswidener @@ -2,5 +2,4 @@ accessWidener v1 named accessible class net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo accessible method net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo (Lnet/minecraft/client/renderer/chunk/ChunkRenderDispatcher$RenderChunk;Lnet/minecraft/core/Direction;I)V accessible class net/minecraft/client/renderer/LevelRenderer$RenderChunkStorage -accessible class net/minecraft/client/renderer/LevelRenderer$RenderInfoMap diff --git a/src/main/resources/mixins.bfrc.json b/src/main/resources/mixins.bfrc.json index 27fadf3..7e718cb 100644 --- a/src/main/resources/mixins.bfrc.json +++ b/src/main/resources/mixins.bfrc.json @@ -17,7 +17,6 @@ "MixinGameRenderer", "MixinInactiveProfiler", "MixinLevelRender", - "MixinLevelRender$AccessorRenderChunkInfo", "MixinLevelRender$AccessorViewArea", "MixinMinecraft", "MixinRenderChunk",