Laminar Engine
为 Minecraft AI、声学与视线检测提供的异步核显协处理方案。
Laminar 是一套优化工具集,旨在通过明确的 OpenCL 1.2/1.1 管道将 CPU 与内置集成显卡(Intel HD/UHD Graphics、AMD Radeon Graphics)进行交互。
通过将计算密集型 CPU 任务卸载到 GPU,Laminar 有助于在渲染和主逻辑线程上降低 CPU 利用率的同时维持服务器刻率 (TPS)。
⚠️ 注意: Laminar 不会增加你能达到的最高 FPS。它只是通过使用核显并行处理来提高稳定性,并增强同时处理多个实体和声音的能力,而不会出现卡顿或显著的 FPS 下降。
重要提示:专用服务器的问题已在版本 1.3.1+ 中得到修复,无需将其分为两个版本(标准版和服务器版)。
核心引擎架构
1. Project "Hive"(异步流场 AI 寻路)
高密度怪物农场或大规模围攻事件通常因沉重且单线程的 CPU 寻路循环而使服务器崩溃。Project Hive 通过将全局路由卸载到 GPU 协处理器来完全绕过这一限制。
- 集成流场协处理: iGPU 不再生成数百个单独且耗 CPU 的路径,而是计算一个统一的 3D 矢量场,覆盖玩家周围超过 110,000 个体素。随后,数百个敌对实体可以以恒定的 O(1) 时间从该单一网格中同时读取其移动方向,从而节省大量的 CPU 周期。
- 智能混合导航: 全局宏观路径在 GPU 上动态计算,而微观层面的物理效果(如跳跃、游泳和方块碰撞规避)则交还给原生 Minecraft 引擎,以保持真实的移动和动画行为。
- 流体无关路由: 体素级过滤会自动忽略非阻碍性海洋方块(如水、海带和海草),防止实体在水下生物群系中导航时出现服务器卡顿和寻路错误。
- 动态群体智能: 实体表现得像一个协调一致的狼群。当一个敌对实体发现你时,它会在物理听觉半径内动态通知附近的狼群成员,使它们能够通过 GPU 流场立即协调群体攻击。
2. Project "Echo"(环境声学 & 3D 声音遮蔽)
以前所未有的方式体验 Minecraft 的音频。Project Echo 彻底改变了声音在世界中的传播方式,由你的集成显卡提供动力,带来丰富、逼真且高度沉浸的声学效果。
- 真正的物理遮蔽: 声波现在会根据将你声源隔开的方块材质动态反应。无论是厚石墙后的僵尸呻吟、深洞中活塞的发射,还是头顶流动的水,音频都会使用硬件加速的低通滤波器进行逼真的闷音和衰减。
- 动态洞穴混响: 深邃的洞穴、狭窄的隧道和巨大的空洞洞穴现在感觉物理上栩栩如生。使用 16 射线斐波那契球体,iGPU 持续测量周围环境的大小,自动应用电影般的回声和混响,并在你从狭窄的石通道过渡到宽阔的地下大厅时无缝适应。
- 智能开放天空保护: 声学引擎足够智能,能够区分封闭空间和开阔天空。逃逸到开放大气中的声波会自然消散,确保天空下没有任何人工回声,同时在洞穴和建筑物内保留丰富的大气声学效果。
- 无缝模组 & 媒体兼容性: 开箱即用地支持自定义音乐唱片、乐器和其他模组的复杂音频添加。通过根据游戏内声音属性动态缩放范围计算,整合包中的每个自定义音频事件都会以真实的物理特性传播和衰减。
- 解耦性能引擎: 所有沉重的光线步进计算都被隔离到专用的后台协处理线程。通过利用本地 RAM 缓存系统,客户端的渲染线程与音频计算开销完全隔离,即使在混乱、嘈杂的战斗期间也能保持流畅、无卡顿的帧率。
3. Project "Aura"(并行光线步进视线检测)
敌对实体不断在 CPU 上运行昂贵的视线检查,以确定它们是否能锁定你。Project Aura 将这个繁重的工作量完全转移到集成 GPU 上。
- 并行 GPU 光线步进: 在 iGPU 上同时执行从多达 1,024 个活跃实体的眼睛水平到玩家的并行光线步进检查,完全在密集遭遇期间释放服务器线程免受昂贵的可见性检查。
- 对称信任验证: 引擎完全信任 GPU 的高度精确的可见性计算。如果 GPU 确定实体能看到你,或者被墙壁完全阻挡,它会立即绕过 CPU 昂贵的光线投射,在大规模追逐中将 CPU 的视线工作量减少高达 90%。
- 即时阴影缓存: 将可见性状态存储在闪电般快速的本地 CPU 侧内存注册表中。主服务器线程可以以恒定的 O(1) 时间查询实体是否能看到玩家,消除所有刻率尖峰。
4. 自适应实体 AI 节流(细节级别 AI)(自版本 1.2.9 起已移除)
- 动态四区 LOD 引擎:
- 区域 1a(主动追击): 拥有活跃目标的生物以 20 TPS 运行。
- 区域 1b(近距离战斗): 在玩家 10 格半径内的生物以 20 TPS 运行,防止在玩家靠近时出现仇恨延迟或 AI 行为停滞。
- 区域 2(近处闲置): 在 24 格半径内的生物以 5 TPS 运行(延迟 = 4)。
- 区域 3(远处闲置): 超出 24 格的生物以 1.6 TPS 运行(延迟 = 12)。
- 事件驱动的目标注册表: 生物通过钩子函数向事件驱动的注册表进行注册。这减少了对世界进行每刻扫描的需求,从而最小化服务器 CPU 开销。
- UUID 交错 ticking: 利用生物 UUID 的正按位取模运算,将 tick 执行分散到各个帧中,以平滑 CPU 使用率的峰值。
- 动量与动画重置: 当失去目标时(例如切换到创造模式),将进行 48 格范围的扫描以重置物理速度、终止活跃的路径导航,并重置攻击状态动画。
性能基准测试
测试环境:Intel Core i7-4770K (Haswell @ 4.3 GHz OC, AVX2), Intel HD 4600 核显 (OpenCL 1.2), NVIDIA GTX 1050。场景:500 个活跃僵尸,加载了 32 个区块。客户端优化包包含 Sodium、FerriteCore 和 Lithium。
| 性能指标 |
原版 Minecraft |
Laminar v1.2.7 + 优化包 |
净提升幅度 |
| 服务器 Tick 速率 |
19.35 TPS |
20.00 TPS |
+0.65 TPS (锁定 20) |
| 中位数 MSPT |
31.1 ms |
7.68 ms |
-75.3% (快 4 倍) |
| 95% 分位 MSPT |
50.5 ms |
27.8 ms |
-44.9% (更流畅) |
| CPU 进程占用率 |
36.12% |
21.78% |
-39.7% (降低 CPU 开销) |
| 内存占用 |
1.4 GB |
1.0 GB |
-28.5% (减少 RAM 分配) |
| GC Young 频率 |
2.2s |
4.0s |
+81.8% (GC 更少) |
| GC Young 平均暂停时间 |
19.3 ms |
17.1 ms |
-11.4% (GC 暂停更短) |
| GC Young 总运行次数 |
200 次 (在 113s 内) |
71 次 (在 120s 内) |
GC 事件减少 64.5% |
关于增加可处理的最大声音和实体数量
通过将最大同时音频遮挡容量从 64 通道增加到 256 通道,并将同时视线光线投射容量从 256 个活跃实体增加到 1,024 个,密集人群追逐期间的渲染帧率有所提高。
密集人群追逐期间的客户端渲染帧率:
- Laminar v1.2.5: 64 - 71 FPS
- Laminar v1.2.6b (当前版本): 76 - 84 FPS
结果: 在高实体压力负载下获得显著的 +10 至 +20 FPS 增益,确保在被大量敌群主动追击时摄像机移动更流畅且帧时间更稳定。
注意
关于 ImmediatelyFast 的测试说明:
ImmediatelyFast 未包含在我们的标准化基准测试环境中。虽然它是一款出色的模组,能成功提升客户端 FPS 并降低整体 CPU 利用率,但我们的测试表明,其激进的光照渲染缓冲区优化在与 Laminar 的异步 OpenCL 主机映射配合使用时(特别是在旧架构上),可能会引入轻微的内存带宽争用(导致中位数 MSPT 和 GC 频率略有增加)。
如果您优先考虑最高的视觉帧率而非严格的服务器 tick 一致性,它与 Laminar 完全兼容且可以安全使用。
兼容性与要求
- Fabric 加载器: v0.19.2+ (Minecraft 26.1.2+)
- 硬件: 双 GPU 配置(CPU + 集成显卡)或 APU。
- OpenCL: 集成显卡必须支持 OpenCL 1.1 或更高版本。
- Java: Java 25 (推荐使用 GraalVM 以获得向量化优化)。
兼容的模组
Laminar 旨在与其他渲染和系统优化模组协同工作。
- 兼容 Sodium、Lithium、FerriteCore 和 ImmediatelyFast。
- VulkanMod 兼容: 通过绕过 GPU 内存冲突并使用主机内存映射缓冲区,与 Vulkan 渲染协同工作。
不兼容
- 基于 CPU 的声音物理模组 (
Sound Physics Remastered, Acoustic Overhaul)。Project Echo 可作为这些模组的硬件加速替代方案。
常见问题解答 (FAQ)
Q: 它在专用服务器上能用吗?
A: 大多数企业级服务器 CPU(Xeon/EPYC)不包含集成显卡。Laminar 会检测到这种情况并自行禁用而不会崩溃。Laminar 专为在消费级桌面/笔记本电脑处理器(Intel Core / AMD Ryzen)上运行的单人游戏、局域网或自建服务器设计。
Q: 它会改变任何原版行为吗?
A: 大部分情况下不会。生物仍然像原版一样行走、跳跃并表现出相同的行为。
唯一的游戏玩法变更是:
- 当你位于墙壁后方时,声音会真实地变得沉闷。
- 附近的生物会互相提醒加入追逐(类似于猪灵在愤怒时的表现)。
如果你想要 100% 原版的 Gameplay,可以在配置文件 (laminar.json) 中轻松禁用这两个功能。
Q: 我需要配置任何东西吗?
A: Laminar 开箱即用,采用默认配置即可运行。
问:如果我只使用集成显卡(iGPU),没有独立显卡怎么办?
答:效果取决于当前 iGPU 的占用率以及你使用的渲染后端:
- 有剩余性能的 iGPU(占用率 < 85%): Laminar 将利用剩余的 GPU 核心来卸载 CPU 计算,从而降低刻延迟(tick latency)。
- iGPU 已满载(占用率约 100%,例如由于运行了光影): 引入 OpenCL 计算任务可能会导致 GPU 硅片上的资源争用,进而导致视觉帧率下降。
- 仅使用 iGPU 配置下的 Vulkan 后端(Minecraft 26.2+): 由于 Vulkan 渲染引擎的高度优化特性,它会将集成 GPU 的执行单元自然饱和至绝对峰值极限。在仅配备 iGPU 的配置中,这种最大利用率几乎为零的剩余空间无法为 Laminar 的 OpenCL 计算队列提供缓冲,这可能导致帧时间波动和上下文停滞。
注意:如果在仅配备 iGPU 的环境下运行,建议搭配 Sodium 等性能优化模组,并使用优化的图形设置。此外,如果你在使用仅配备 iGPU 配置下的实验性 Vulkan 后端,强烈建议限制游戏内帧率(例如锁定在 60 或 90 FPS),以人为创造出 Laminar 异步协同处理循环所需的必要 GPU 剩余性能。
Laminar Engine
Asynchronous iGPU Co-Processing for Minecraft AI, Acoustics, and Line-of-Sight.
Laminar is an optimization suite designed to interface the CPU with the built-in integrated graphics processor (Intel HD/UHD Graphics, AMD Radeon Graphics) using explicit OpenCL 1.2/1.1 pipelines.
By offloading computationally intensive CPU tasks, Laminar assists in maintaining server tick rates (TPS) while reducing CPU utilization on the rendering and main logic threads.
⚠️ Note: Laminar doesn't increase the maximum FPS you can achieve. It simply improves stability and the ability to handle multiple mobs and sounds simultaneously without lag or significant FPS drops using parallel processing on the iGPU.
Important: The issue with the dedicated server has been fixed without having to separate it into 2 editions(Standart and Server Edition) in version 1.3.1+
Core Engine Architecture
1. Project "Hive" (Asynchronous Flow-Field AI Pathfinding)
High-density mob farms or massive siege events normally bring servers to their knees due to heavy, single-threaded CPU pathfinding loops. Project Hive completely bypasses this limitation by offloading global routing to the GPU co-processor.
- Integrated Flow-Field Co-Processing: Instead of generating hundreds of individual, CPU-heavy paths, the iGPU calculates a single, unified 3D vector field spanning over 110,000 voxels around the player. Hundreds of hostile entities can then simultaneously read their movement directions from this single grid in constant O(1) time, saving massive amounts of CPU cycles.
- Intelligent Hybrid Navigation: Global macro-pathing is calculated dynamically on the GPU, while micro-level physics (such as jumping, swimming, and block collision avoidance) are handed back to the native Minecraft engine, maintaining authentic movement and animation behaviors.
- Fluid-Agnostic Routing: Voxel-level filtering automatically ignores non-obstructive ocean blocks (like water, kelp, and seagrass), preventing server lag and pathfinding errors when mobs navigate underwater biomes.
- Dynamic Swarm Intelligence: Mobs behave like a coordinated pack. When one hostile entity spots you, it dynamically alerts nearby pack members within a physical auditory radius, allowing them to instantly coordinate a swarm attack via the GPU flow-field.
2. Project "Echo" (Environmental Acoustics & 3D Sound Occlusion)
Experience Minecraft's audio like never before. Project Echo completely transforms how sound propagates through the world, delivering rich, physical, and highly immersive acoustics powered by your integrated GPU.
- True Physical Occlusion: Sound waves now dynamically react to the block materials separating you from the source. Whether it is a zombie groaning behind a thick stone wall, a piston firing in a deep cavern, or water flowing overhead, the audio is realistically muffled and dampened using hardware-accelerated low-pass filtering.
- Dynamic Cave Reverb: Deep caves, narrow tunnels, and massive hollow caverns now feel physically alive. Using a 16-ray Fibonacci sphere, the iGPU continuously measures the size of your surroundings, automatically applying cinematic echoes and reverberation that adapt seamlessly as you transition from tight stone passages to wide underground chambers.
- Intelligent Open-Sky Guard: The acoustic engine is smart enough to differentiate enclosed spaces from the open sky. Sound waves escaping into the open atmosphere dissipate naturally, ensuring zero artificial echoes under the sky while preserving rich, atmospheric acoustics inside caves and buildings.
- Seamless Mod & Media Compatibility: Built to support custom music discs, instruments, and complex audio additions from other mods out of the box. By dynamically scaling range calculations with in-game sound properties, every custom audio event in your modpack propagates and dampens with authentic physical properties.
- Decoupled Performance Engine: All heavy raymarching calculations are quarantined to a dedicated background co-processor thread. By utilizing a local RAM caching system, the client's rendering thread is completely isolated from audio compute overhead, maintaining fluid, stutter-free frame rates even during chaotic, noisy encounters.
3. Project "Aura" (Parallel Raymarching Line-of-Sight)
Hostile mobs constantly run expensive line-of-sight checks on the CPU to see if they can target you. Project Aura moves this heavy workload entirely to the integrated GPU.
- Parallel GPU Raymarching: Executes parallel raymarching checks from the eye level of up to 1,024 active entities to the player simultaneously on the iGPU, entirely freeing the server thread from expensive visibility checks during dense encounters.
- Symmetric Trust Validation: The engine fully trusts the GPU's highly precise visibility calculations. If the GPU determines a mob can see you, or is completely blocked by a wall, it immediately bypasses the CPU's expensive raycast, reducing the CPU's line-of-sight workload by up to 90% during massive chases.
- Instant Shadow Cache: Stores visibility states in a lightning-fast, local CPU-side memory registry. The main server thread can query whether a mob can see the player in constant O(1) time, eliminating all tick spikes.
4. Adaptive Entity AI Throttling (Level of Detail AI)(has been removed since version 1.2.9)
- Dynamic 4-Zone LOD Engine:
- Zone 1a (Active Pursuit): Mobs with an active target run at 20 TPS.
- Zone 1b (Proximity Combat): Mobs within a 10-block radius of a player run at 20 TPS, preventing delayed aggro or inactive AI behaviors when players are close.
- Zone 2 (Close Idle): Mobs within a 24-block radius run at 5 TPS (delay = 4).
- Zone 3 (Far Idle): Mobs outside 24 blocks run at 1.6 TPS (delay = 12).
- Event-Driven Target Registry: Mobs register to an event-driven via hooks. This reduces the requirement for world scans on every tick, minimizing server CPU overhead.
- UUID-Staggered Ticking: Tick execution is staggered across frames using a positive bitwise modulo of the mob's UUID to flatten CPU usage spikes.
- Momentum & Animation Resets: On target loss (e.g., Creative mode transition), a 48-block sweep resets physical velocity, terminates active navigation paths, and resets aggressive state animations.
Performance Benchmarks
Tested on: Intel Core i7-4770K (Haswell @ 4.3 GHz OC, AVX2), Intel HD 4600 iGPU (OpenCL 1.2), NVIDIA GTX 1050. Scenario: 500 active Zombies, 32 Chunks loaded. Client optimization pack contains Sodium, FerriteCore, and Lithium.
| Performance Metric |
Vanilla Minecraft |
Laminar v1.2.7 + Pack |
Net Improvement |
| Server Tick Rate |
19.35 TPS |
20.00 TPS |
+0.65 TPS (Locked 20) |
| Median MSPT |
31.1 ms |
7.68 ms |
-75.3% (4x faster) |
| 95th% MSPT |
50.5 ms |
27.8 ms |
-44.9% (Smoother) |
| CPU Process Usage |
36.12% |
21.78% |
-39.7% (Lower CPU overhead) |
| Memory Footprint |
1.4 GB |
1.0 GB |
-28.5% (Less RAM allocation) |
| GC Young Frequency |
2.2s |
4.0s |
+81.8% (Infrequent GCs) |
| GC Young Avg Pause |
19.3 ms |
17.1 ms |
-11.4% (Shorter GC pauses) |
| GC Young Total Runs |
200 runs (in 113s) |
71 runs (in 120s) |
-64.5% fewer GC events |
About increasing the maximum sound and mobs that can be handled
By increasing the maximum simultaneous audio occlusion capacity to 256 channels (previously 64) and the simultaneous Line-of-Sight Raymarching capacity to 1,024 active entities (previously 256), the rendering frame rate during dense crowd chases has increased.
Client Rendering Framerates during Dense Crowd Chases:
- Laminar v1.2.5: 64 - 71 FPS
- Laminar v1.2.6b (Current): 76 - 84 FPS
Result: A highly responsive +10 to +20 FPS gain under heavy entity stress, ensuring smoother camera movement and consistent frametimes when actively pursued by large hordes.
Note
Testing Note regarding ImmediatelyFast:
ImmediatelyFast has been excluded from our standardized benchmark environment. While it is an exceptional mod that successfully boosts client-side FPS and lowers overall CPU utilization, our testing indicates that its aggressive rendering buffer optimizations can introduce slight memory bandwidth contention when paired with Laminar's asynchronous OpenCL host-mapping on older architectures (causing a marginal increase in median MSPT and GC frequency).
It remains 100% compatible and safe to use alongside Laminar if you prioritize maximum visual frame rates over strict server-tick consistency.
Compatibility & Requirements
- Fabric Loader: v0.19.2+ (Minecraft 26.1.2+)
- Hardware: A dual-GPU configuration (CPU + Integrated GPU) or an APU.
- OpenCL: The iGPU must support OpenCL 1.1 or higher.
- Java: Java 25 (GraalVM recommended for vectorization optimizations).
Compatible Modifications
Laminar is designed to operate alongside other render and system optimization modifications.
- Compatible with Sodium, Lithium, FerriteCore, and ImmediatelyFast.
- VulkanMod Compatible: Operates alongside Vulkan rendering by bypassing GPU memory conflicts through host memory-mapped buffers.
Incompatible
- CPU-Bound Sound Physics Modifications (
Sound Physics Remastered, Acoustic Overhaul). Project Echo serves as a hardware-accelerated alternative to these modifications.
FAQ (Frequently Asked Questions)
Q: Will this work on a Dedicated Server?
A: Most enterprise server CPUs (Xeon/EPYC) do not contain an integrated GPU. Laminar will detect this condition and disable itself without crashing. Laminar is designed for Single-Player, LAN, or Self-Hosted servers running on consumer desktop/laptop processors (Intel Core / AMD Ryzen).
Q: Does it change any vanilla behaviour?
A: For the most part, no. Mobs still walk, jump, and behave exactly like vanilla.
The only gameplay changes are:
- Sounds get muffled realistically when you are behind walls.
- Mobs nearby will alert each other to join the chase (like piglins when they are angry).
If you want 100% vanilla gameplay, you can easily disable both of these features in the config file (laminar.json).
Q: Do I need to configure anything?
A: Laminar operates with default configurations out of the box.
Q: What if I only have an Integrated GPU (iGPU) with no dedicated graphics card?
A: The effectiveness depends on current iGPU utilization and your rendering backend:
- iGPU with headroom (Usage < 85%): Laminar will utilize the remaining GPU cores to offload CPU calculations, resulting in lower tick latency.
- iGPU fully utilized (Usage ~ 100%, e.g., due to shaders): Introducing OpenCL compute tasks may cause resource contention on the GPU silicon, which could lead to a reduction in visual FPS.
- Vulkan Backend on iGPU-only setups (Minecraft 26.2+): Due to the highly optimized nature of the Vulkan rendering engine, it will naturally saturate the integrated GPU's execution units to their absolute peak limits. On an iGPU-only configuration, this maximum utilization leaves virtually zero headroom for Laminar's OpenCL compute queues, which can result in frame-time drops and context stalls.
Note: If operating on an iGPU-only configuration, it is recommended to pair Laminar with performance modifications like Sodium and use optimized graphics settings. Furthermore, if you are using the experimental Vulkan backend on an iGPU-only setup, it is highly recommended to cap your in-game framerate (e.g., to 60 or 90 FPS) to artificially create the necessary GPU headroom for Laminar's asynchronous co-processing loops.
评论 0
登录后参与评分
还没有评论,来抢沙发吧