环形渲染
英文 | 中文
这是一个 Fabric 模组,它将区块的渲染方式修改为以玩家为中心的圆形(或椭圆形)。
默认情况下,它会在一个完美的圆形范围内渲染区块(半径 = 视距 × 16 格)。
你可以选择缩放左右方向的半径以创建椭圆,从而裁切更多侧面的区块,同时保持前后视野不变。这可以在不影响游戏机制的前提下降低 GPU 负载并提升 FPS。
功能
- 以玩家为中心进行圆形区块渲染(默认行为)。
- 可选的椭圆形渲染:前后方向的半径保持不变,而左右方向的半径由可配置系数(
renderRadiusScale)进行缩放。
- 当
renderRadiusScale = 1.0 时,呈现为完美圆形。
- 当
renderRadiusScale < 1.0 时,呈现为椭圆形(左右方向更窄)。
- 可选的垂直范围限制:将渲染限制在玩家上方和下方的特定区块层数内。
- 区块加载(逻辑更新)仍保持方形,因此所有区块仍会被加载和更新。
- 预设与自定义模式:快速切换预定义配置(均衡、性能、激进),或选择自定义自由调整所有参数。
- 兼容 Sodium:
- 当安装 Sodium 时,配置项出现在视频设置界面中。
- 未安装 Sodium 时,模组使用 JSON 配置文件独立运行。
- 对实体或其他对象无影响——仅影响区块渲染。
依赖
安装
- 安装 Fabric Loader。
- 从发布页面下载最新的
circular-rendering-<version>.jar。
- 将 JAR 文件放入你的
mods 文件夹。
- (可选)安装 Sodium 以便使用游戏内的配置滑块和预设。
配置
已安装 Sodium
- 进入 选项 → 视频设置。
- 向下滚动找到 Circular Rendering 部分。
预设
- Render Preset 下拉菜单:
- Balanced(均衡):
Render Radius Scale = 100%,垂直范围禁用(原版行为,但仍经过优化)。
- Performance(性能):
Render Radius Scale = 80%,启用垂直范围,10 层。
- Aggressive(激进):
Render Radius Scale = 40%,启用垂直范围,3 层。
- Custom(自定义):所有滑块解锁,允许你自由调整以下参数。
选择非自定义预设会自动应用其参数并锁定手动控制选项。
手动配置(仅在选中“Custom”预设时可用)
- Render Radius Scale(10% – 100%):
- 100% = 完美圆形(半径 = 视距 × 16)。
- 较低值会使左右半径变小,将圆形变为椭圆形,并裁切更多侧面区块。
- Enable Custom Vertical Range(开关)– 启用后,你可以设置:
- Vertical Range(1–32 层):在玩家上方和下方渲染的区块层数(每层 16 格)。
未安装 Sodium
模组会在 config/circular-rendering.json 处创建一个 JSON 配置文件。
示例内容:
{
"renderRadiusScale": 1.0,
"enableVerticalRange": false,
"verticalRange": 16,
"preset": "BALANCED"
}
renderRadiusScale – 介于 0.1 到 1.0 之间的浮点数。
1.0 = 完美圆形。
< 1.0 = 椭圆形(左右方向更窄)。
enableVerticalRange – 布尔值,为 true 时启用垂直范围限制。
verticalRange – 整数(1–32),在玩家上方和下方渲染的区块层数(每层 16 格)。
preset – 可选值为 "BALANCED"、"PERFORMANCE"、"AGGRESSIVE" 或 "CUSTOM"。
- 如果预设不是
"CUSTOM",则忽略三个手动参数并使用预设的值。
- 如果预设是
"CUSTOM",则严格按照设置使用手动参数。
更改在游戏重启或重新加载区块后生效。
工作原理
-
Vanilla 模式(无 Sodium): 模组注入 LevelRenderer.cullTerrain 方法,并使用以下形状定义的公式过滤区块列表:
(forward² / a²) + (right² / b²) ≤ 1
其中 a = view distance × 16(固定的前后半径),b = a × renderRadiusScale(左右半径)。
当 b = a 时,形状为圆形。如果启用了垂直范围,还会检查区块的 Y 轴层数。
-
Sodium 模式: 注入点取决于 Minecraft 版本:
- MC 26.1.2 及以上: 模组重定向
OcclusionCuller.visitNode 内部的 testDistance 调用。这直接在基于图的遮挡剔除遍历中,用椭圆形公式替换了 Sodium 默认的圆柱形距离检查,保留了完整的剔除结构。
- MC 26.1.1 及以下: 模组注入
OcclusionCuller.isWithinRenderDistance 方法,对于椭圆外(或超出垂直范围)的区块返回 false,从而有效地将它们从 Sodium 的可见集合中过滤掉。
两种方法都只影响区块渲染;区块加载仍保持方形,因此游戏机制(红石、实体 AI 等)在所有地方都能正常工作。
兼容性
| Versions |
Support Status |
| 26.2 |
✅ |
| 26.1.2 |
✅ |
| 26.1.1 |
✅ |
| 26.1 |
✅ |
| 1.21.11 |
✅ |
| Lower versions |
Will not support |
- 完全兼容 Sodium 0.8.6+(两个模组可以一起使用)。
- 应与大多数不大量修改区块渲染的其他模组兼容。如果你遇到问题,请报告。
从源码构建
克隆仓库并运行:
./gradlew build
构建好的 JAR 文件将位于 build/libs/ 中。
许可证
本项目采用 MIT 许可证授权。详见 LICENSE 文件以获取详细信息。
Circular Rendering
English | 中文
This is a Fabric mod that modifies chunk rendering to a circular (or elliptical) shape around the player.
By default, it renders chunks within a perfect circle (radius = view distance × 16 blocks).
You can optionally scale the left/right radius to create an ellipse, culling more chunks to the sides while keeping forward/backward visibility unchanged. This reduces GPU load and improves FPS without affecting gameplay mechanics.
Features
- Renders chunks in a circle centered on the player (default behavior).
- Optional elliptical rendering: the forward/backward radius remains fixed, while the left/right radius is scaled by a configurable factor (
renderRadiusScale).
- When
renderRadiusScale = 1.0, it's a perfect circle.
- When
renderRadiusScale < 1.0, it becomes an ellipse (narrower left/right).
- Optional vertical range limitation: limit rendering to a certain number of chunk layers above and below the player.
- Chunk loading (logic updates) remains square, so all chunks are still loaded and updated.
- Presets & Custom Mode: Quickly switch between predefined configurations (Balanced, Performance, Aggressive) or choose Custom to freely adjust all parameters.
- Compatible with Sodium:
- When Sodium is present, configuration appears in the Video Settings screen.
- Without Sodium, the mod works standalone using a JSON config file.
- No effect on entities or other objects – only chunk rendering is affected.
Dependencies
Installation
- Install Fabric Loader.
- Download the latest
circular-rendering-<version>.jar from the Releases page.
- Put the JAR into your
mods folder.
- (Optional) Install Sodium if you want the in-game configuration sliders and presets.
Configuration
With Sodium installed
- Go to Options → Video Settings.
- Scroll down to find the Circular Rendering section.
Presets
- Render Preset dropdown:
- Balanced:
Render Radius Scale = 100%, vertical range disabled (vanilla behavior, but still optimized).
- Performance:
Render Radius Scale = 80%, vertical range enabled, 10 layers.
- Aggressive:
Render Radius Scale = 40%, vertical range enabled, 3 layers.
- Custom: All sliders become unlocked, allowing you to freely adjust the parameters below.
Selecting a non‑Custom preset automatically applies its parameters and locks the manual controls.
Manual Configurations (available only when “Custom” preset is selected)
- Render Radius Scale (10% – 100%):
- 100% = perfect circle (radius = view distance × 16).
- Lower values make the left/right radius smaller, turning the circle into an ellipse and culling more chunks to the sides.
- Enable Custom Vertical Range (toggle) – when enabled, you can set:
- Vertical Range (1–32 layers): Number of chunk layers (16 blocks each) to render above and below the player.
Without Sodium
The mod creates a JSON config file at config/circular-rendering.json.
Example content:
{
"renderRadiusScale": 1.0,
"enableVerticalRange": false,
"verticalRange": 16,
"preset": "BALANCED"
}
renderRadiusScale – a double between 0.1 and 1.0.
1.0 = perfect circle.
< 1.0 = ellipse (narrower left/right).
enableVerticalRange – a boolean, enables vertical range limiting when true.
verticalRange – an integer (1–32), number of chunk layers to render above and below the player (each layer = 16 blocks).
preset – one of "BALANCED", "PERFORMANCE", "AGGRESSIVE", or "CUSTOM".
- If the preset is not
"CUSTOM", the three manual parameters are ignored and the preset's values are used.
- If the preset is
"CUSTOM", the manual parameters are used exactly as set.
Changes take effect after restarting the game or reloading chunks.
How It Works
-
Vanilla mode (no Sodium): The mod injects into LevelRenderer.cullTerrain and filters the chunk list using the shape defined by:
(forward² / a²) + (right² / b²) ≤ 1
where a = view distance × 16 (fixed forward/backward radius) and b = a × renderRadiusScale (left/right radius).
When b = a, the shape is a circle. If vertical range is enabled, it also checks chunk Y layers.
-
Sodium mode: The injection point depends on the Minecraft version:
- MC 26.1.2 and above: The mod redirects the
testDistance call inside OcclusionCuller.visitNode. This replaces Sodium's default cylindrical distance check with the elliptical formula directly within the graph‑based occlusion culling traversal, preserving the full culling structure.
- MC 26.1.1 and below: The mod injects into
OcclusionCuller.isWithinRenderDistance and returns false for chunks outside the ellipse (or vertical range), effectively filtering them from Sodium's visible set.
Both approaches only affect chunk rendering; chunk loading remains square, so game mechanics (redstone, entity AI, etc.) work normally everywhere.
Compatibility
- Support status of Minecraft versions:
| Versions |
Support Status |
| 26.2 |
✅ |
| 26.1.2 |
✅ |
| 26.1.1 |
✅ |
| 26.1 |
✅ |
| 1.21.11 |
✅ |
| Lower versions |
Will not support |
- Fully compatible with Sodium 0.8.6+ (both mods can be used together).
- Should be compatible with most other mods that don't heavily modify chunk rendering. If you encounter issues, please report them.
Building from Source
Clone the repository and run:
./gradlew build
The built JAR will be in build/libs/.
License
This project is licensed under the MIT License. See the LICENSE file for details.
评论 0
登录后参与评分
还没有评论,来抢沙发吧