跳到正文

Solix

作者:SolarBiscuit

Starlight + ScalableLux fork with upstream fixes and several other performance optimizations.

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

Solix

A slightly faster light engine for Forge 1.20.1. Built as a fork of Starlight with ScalableLux’s multi-threading, and a number of optimizations of its own.

Why make yet another Starlight fork?

Starlight was always an excellent lighting mod & unfortunately ScalableLux is not currently available on 1.20.1 Forge. Solix adds the performance benefits of both of these mods, but adds a few more fixes as well.

     Starlight             ScalableLux            Solix     
Multi-threaded light updates   ❌   ✅ ✅
Queued light work ordered by distance to players¹   ❌   ✅ ✅
Brightest-first light spreading   ❌   ❌ ✅
Skips re-sending unchanged light to players   ❌   ❌ ✅
Working opacity cache (Forge)   ❌     — ✅
Forge 1.20.1 Availability   ✅   ❌ ✅

¹ Server setup with parallel lighting enabled. Vanilla already hands off chunks to the light engine roughly closest-first.


Performance gains

Updated Darkness logic:

When you place a block in a lit room, Starlight darkens the entire area behind it and then re-lights it from scratch, even though almost all of those blocks are still lit from another direction. Solix checks first and only darkens the blocks that actually lost light. As a result, fewer writes are necessary overall.

Light is spread from the brightest level down, so every block is lit once, at its final level, instead of being lit by a dim source and then overwritten by a brighter one.

In preliminary testing, placing and breaking single blocks in a lit room took ~14–20% less light time with ~47% fewer light writes overall (noting this is on-par with Starlight).

Reduced overhead & fewer client re-renders:

If a section’s light ends up exactly the same after an update, Solix doesn’t send it to players again. Every light packet a client receives makes it re-render that area and its neighbors, so skipping them should help client FPS while others place blocks nearby.

In my initial benchmarks, roughly 10–30% of updated sections were unchanged and are no longer sent.

Forge fixes

  • Working opacity cache. Starlight would originally discard it’s cached light-opacity value after it was built, but this maintains it with the same fallback for the blocks that need it (dynamic shapes, modded blocks whose light depends on block positioning).
  • Faster light-source scanning. New chunks skip sections that cannot contain a light source. Starlight would just scan these regardless.
  • Cheaper chunk loading. Deciding which light sections must exist around a chunk now uses bit masks instead of up to 27 checks per section. It runs for every chunk lit on the server and every chunk a client receives.

Backported Starlight fixes

Additionally a number of fixes that were not all backported in original Starlight to 1.20.1 in later versions have been pushed to this release. Commits 6585522, 2084f46, 2b3204b, 4d59d86, and c4d051c specifically.

Configuration Options

config/solix.toml:

parallel = true          # multithreaded server lighting
parallelism = 0          # worker threads, 0 = automatic (CPU threads / 4)
throttle_ms = 10         # prevents C2ME's light thread from busy-waiting
propagation = targeted   # targeted | ordered | classic (Starlight's original)

For diagnostic/benchmarking use: -Dsolix.debug.lightStats=true logs light engine statistics every 10 seconds.

Options allow for multi-threading to be disabled if needed. More for troubleshooting use in the odd chance of compatibility issue as opposed to actual performance benefit.

Mod Compatibility

  • Tested with over (500+ mods), including C2ME, ModernFix, Radium, Embeddium/Xenon, Oculus, NeoVoxy, Flywheel/Create, Mekanism and AE2.
  • Can be installed on client, server, or both. Vanilla clients can join a Solix server and the other way round.
  • Do not install alongside other lighting mods such as Starlight, ScalableLux or Lucis. Solix replaces them, and Forge may tell you if multiple are installed.
  • Should be quite safe to install on existing worlds without issue.

Q&A

Will this improve my framerate?

Not a significant amount–it’s more at scale that many of these benefits are seen, however as seen in usage with mods like C2ME, lighting bottlenecks can easily become a more prevalent issue. Server & high core count environments will benefit far more: lighting work is lighter and spread across thread.

Will other versions be supported?

I may port to neighboring versions, but am currently I am more focused on polishing up the 1.20.1 version. This was really made to fill a niche for 1.20.1 LexForge than anything else.

Acknowledgements

This would not be possible without the excellent work in the last 5 years by the following devs:

  • Starlight by Spottedleaf: the light engine Solix is built on.
  • ScalableLux by RelativityMC: multithreaded scheduling
  • FlowSched by IshlandMC

Solix is licensed under LGPL-3.0.

常见问题

Solix 支持哪些 Minecraft 版本?

Solix 支持 Minecraft Java 版 1.20.1,可用的加载器:Forge。下载时注意选择和你游戏版本一致的文件。

Solix 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Forge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分