Pulsar Lighting Engine
概述
Pulsar 是 Cleanroom 的光照引擎模组,基于 Starlight 和 SuperNova。 它使用源自 Starlight 的基于队列的广度优先搜索(BFS)光照传播算法,替换了 Minecraft 原版的光照引擎。 它提供了类似 Starlight 的非彩色标量(SCALAR)光照模式,以及类似 SuperNova 的全 RGB 彩色光照模式。
特性
- RGB 彩色光照:按 RGB 通道分别计算方块光和天空光,考虑光源颜色以及透过染色玻璃等方块的过滤效果。
- SCALAR 模式:使用传统的非彩色光照计算,与 Starlight 类似。
- 异步并行处理:在独立的工作线程上运行服务器端的光照传播。
- 批量光照更新:将大量方块变化引起的光照更新进行分组处理。
- 光照数据缓存:将计算出的光照数据保存在区块 NBT 中,避免在加载区块时重新计算。
- 各种未在此列出的额外错误修复和生活质量改进。
- Thaumcraft 水晶的自然光照。
已修复的 Bug
兼容性
- JSON Paintings:为该模组添加的画作应用平滑光照。
- SpongeForge:包含对异步光照的兼容支持。
- Fluidlogged API:考虑存储在方块内流体的不透明度和发光属性。
- CBMultipart:标准微型方块继承其材料的光源颜色。自定义部件除非有专门的集成处理,否则保持中性发光。
- ProjectRed:全方块灯、多部件灯具、光按钮和光微型方块材料提供 RGB 发光,保留其实际亮度和电源状态。
- Depths Update:支持扩展的世界高度范围。
- Thaumcraft:为水晶添加平滑光照。
- Celeritas:支持其渲染管线。
- Demonica Shader:已与 Complementary Reimagined 测试并确认正常工作。
- 不能保证与 Actinium、Pintonium 和 Impetus 等分支兼容。
不兼容项
Pulsar 完全替换了光照引擎,因此与其他光照引擎模组不兼容。
- Alfheim
- Phosphor
- Hesperus
- Starlight-1.12
- OptiFine:请改用 Celeritas。Demonica Shader 提供光影支持,而 Celeritas Extra 和 Celeritas Leaf Culling 应涵盖额外的视频选项。
- The Aether II:请改用 The Aether II: Phosphor Not Included。
配置
config/pulsar.cfg:选择光照模式并配置其他功能。lightingMode:RGB(默认,RGB 彩色光照)或SCALAR(传统非彩色光照)。rgbGameplayLight:RGB_MAX(默认,使用最亮的 RGB 分量作为游戏性亮度;逐通道衰减影响诸如生物生成之类的光照检测)或VANILLA(为游戏性光照检测单独计算非彩色光照)。rgbBlendMode:包含一个可选的MAXIMUM模式,通过取每个通道的最亮值来组合方块光和天空光。在彩色光源周围,正午阳光保持中性。这控制正常渲染;光影包自行处理其着色。debug.traceLightUpdates:用于光照队列、渲染请求和 Celeritas 重建的可选诊断工具。每 200 个客户端刻记录一次有界摘要;调用者和位置样本覆盖 1/64 的请求。
config/pulsar-colors.cfg:定义光源颜色。config/pulsar-filters.cfg:定义每个 RGB 通道的衰减。
API
Pulsar 为其他模组提供了定义光源颜色和光线传输属性的 API。
ColoredLightSource/PositionalColoredLightSource:基于方块状态或位置定义 RGB 发光。ColoredTranslucency/PositionalColoredTranslucency:定义逐通道的 RGB 透射率。FaceLightOcclusion:定义单个方块面的光照不透明度。BlockLightColors/BlockLightFilters:注册方块或方块状态的光源颜色和最小逐通道吸收值。RegisterLightPropertiesEvent:用于注册光源颜色和过滤器的 Forge 事件。PackedLightColor:打包和解压0xRGB值(组件范围为 0 到 15),并在 SuperNova 格式之间进行转换。LightColors:提供基本颜色常量。ExtendedChunk/ExtendedWorld:查询区块光照就绪状态和待处理的全球光照更新。
基准测试
于 2026-10-30 在 Minecraft 1.12.2 / Cleanroom 0.6.13-alpha 环境下测量,对比原版光照、Alfheim 1.6 以及 Pulsar 0.6.0 的 SCALAR 和 RGB (RGB_MAX) 模式。
图表测量的是从方块变化到光照完成(包括完成适配器)的专用服务器延迟。每个值是四次全新 JVM 运行均值的中间值;须线显示最小值和最大值。CPU 为 Ryzen AI MAX+ 395,Java 版本为 25,固定堆内存为 4 GiB。数值越低越好;坐标轴采用对数刻度。


Vanilla 通过了开放天空区块光照测试,但在屋顶灯具的初始存储天空光照验证中失败,因此不计入 Vanilla 的天空更新耗时。RGB 计算额外的彩色光照信息。这些重复且逐个等待更新的步骤并不用于衡量 FPS、区块生成或并发更新吞吐量。
兼容性探测及可选空段实验请参阅 光照验证说明。
致谢
- Starlight: 光照引擎架构与核心算法的基础。
- SuperNova: 移植的光照引擎、按世界任务管理以及压缩 RGB 传播代码的来源。
- Alfheim: 多种光照修复方案的参考。
- CleanroomModTemplate: Cleanroom 优秀的模组开发模板。
- CleanroomVersioning: 用于版本管理的构建插件。
- TokenEnvoy: 在构建时嵌入元数据的构建插件。
LLM 使用
LLM 被用于辅助编写 Pulsar 的部分代码与文档。
许可证
Pulsar 采用 LGPL-3.0 许可证授权。
Pulsar Lighting Engine
Overview
Pulsar is a lighting engine mod for Cleanroom, based on Starlight and SuperNova. It replaces Minecraft's vanilla lighting engine with queue-based breadth-first search (BFS) light propagation derived from Starlight. It offers a non-colored SCALAR lighting mode like Starlight and a full RGB colored lighting mode like SuperNova.
Features
- RGB colored lighting: Calculates block light and sky light per RGB channel, accounting for light source colors and filtering through blocks such as stained glass.
- SCALAR mode: Uses conventional, non-colored lighting calculations, like Starlight.
- Asynchronous and parallel processing: Runs server-side light propagation on separate worker threads.
- Batched lighting updates: Groups lighting updates caused by large numbers of block changes.
- Light data caching: Saves calculated light data in chunk NBT to avoid recalculation when chunks are loaded.
- Various additional bug fixes and quality-of-life improvements not listed here.
- Natural lighting for Thaumcraft crystals.
Fixed Bugs
Compatibility
- JSON Paintings: Applies smooth lighting to paintings added by the mod.
- SpongeForge: Includes compatibility support for asynchronous lighting.
- Fluidlogged API: Accounts for the opacity and light emission of fluids stored inside blocks.
- CBMultipart: Standard microblocks inherit their materials' light source colors. Custom parts retain neutral emission unless handled by a dedicated integration.
- ProjectRed: RGB emission for full-block lamps, multipart fixtures, light buttons, and light microblock materials, preserving their actual brightness and power state.
- Depths Update: Supports extended world height ranges.
- Thaumcraft: Adds smooth lighting to crystals.
- Celeritas: Supports its rendering pipeline.
- Demonica Shader: Tested and confirmed working with Complementary Reimagined.
- Compatibility with forks such as Actinium, Pintonium, and Impetus is not guaranteed.
Incompatibilities
Pulsar completely replaces the lighting engine and is incompatible with other lighting engine mods.
- Alfheim
- Phosphor
- Hesperus
- Starlight-1.12
- OptiFine: Use Celeritas instead. Demonica Shader provides shader support, while Celeritas Extra and Celeritas Leaf Culling should cover the additional video options.
- The Aether II: Use The Aether II: Phosphor Not Included instead.
Configuration
config/pulsar.cfg: Selects the lighting mode and configures additional features.lightingMode:RGB(default, RGB colored lighting) orSCALAR(conventional, non-colored lighting).rgbGameplayLight:RGB_MAX(default, uses the brightest RGB component as gameplay brightness; per-channel attenuation affects light checks such as mob spawning) orVANILLA(calculates non-colored lighting separately for gameplay light checks).rgbBlendMode: Includes an optionalMAXIMUMmode that combines block and sky light by taking the brightest value per channel. Full daylight stays neutral around colored sources. This controls normal rendering; shader packs handle their own shading.debug.traceLightUpdates: Opt-in diagnostics for lighting queues, render requests, and Celeritas rebuilds. Logs a bounded summary every 200 client ticks; caller and position samples cover 1 in 64 requests.
config/pulsar-colors.cfg: Defines light source colors.config/pulsar-filters.cfg: Defines attenuation for each RGB channel.
API
Pulsar provides APIs for other mods to define light source colors and light transmission properties.
ColoredLightSource/PositionalColoredLightSource: Define RGB emission based on block state or position.ColoredTranslucency/PositionalColoredTranslucency: Define per-channel RGB transmittance.FaceLightOcclusion: Define light opacity for individual block faces.BlockLightColors/BlockLightFilters: Register light source colors and minimum per-channel absorption for blocks or block states.RegisterLightPropertiesEvent: Forge event for registering light source colors and filters.PackedLightColor: Pack and unpack0xRGBvalues with components from 0 to 15, and convert to and from SuperNova's format.LightColors: Provides basic color constants.ExtendedChunk/ExtendedWorld: Query chunk lighting readiness and pending world lighting updates.
See the API documentation and integration example for details.
Benchmarks
Measured on 2026-10-30 with Minecraft 1.12.2 / Cleanroom 0.6.13-alpha, comparing vanilla lighting, Alfheim 1.6, and Pulsar 0.6.0 in SCALAR and RGB (RGB_MAX) modes.
The charts measure dedicated-server latency from a block change through completed lighting, including the completion adapter. Each value is the median of four fresh-JVM run means; whiskers show the minimum and maximum. The CPU is a Ryzen AI MAX+ 395, with Java 25 and a fixed 4 GiB heap. Lower is better; axes use a logarithmic scale.


Vanilla passes the open-sky block-light test, but fails the roof fixture's initial stored sky-light validation, so no vanilla sky-update time is scored. RGB computes additional colored-light information. These repeated, individually awaited updates do not measure FPS, chunk generation, or concurrent update throughput.
See the measured values and run ranges and raw measurement results for the full comparison.
See lighting validation notes for compatibility probes and the opt-in empty-section experiment.
Credits
- Starlight: The foundation for the lighting engine's architecture and core algorithms.
- SuperNova: The source of the ported lighting engine, per-world task management, and packed RGB propagation code.
- Alfheim: A reference for various lighting bug fixes.
- CleanroomModTemplate: An excellent mod development template for Cleanroom.
- CleanroomVersioning: Build plugin for version management.
- TokenEnvoy: Build plugin for embedding metadata at build time.
LLM Usage
LLMs are used to help write some of Pulsar's code and documentation.
License
Pulsar is licensed under LGPL-3.0.
下载 Pulsar Lighting Engine
下载 Pulsar Lighting Engine
下载 Pulsar Lighting Engine
下载 Pulsar Lighting Engine
下载 Pulsar Lighting Engine
下载 Pulsar Lighting Engine
下载 Pulsar Lighting Engine
下载 Pulsar Lighting Engine
下载 Pulsar Lighting Engine
下载 Pulsar Lighting Engine
新增
- 为 Mekanism 的发光塑料、精炼方块、充能熔炉、过热元件以及热/气/生物发电机添加工业 RGB 预设。
- 在世界线程中采样 Mekanism Glow Panel 染料颜色与 GTCEu 电缆温度,包括无需更改方块状态即可实现的颜色变化。
- 添加全部 32 种 GTCEu 普通/无边框灯预设,保留亮度、反转、泛光及发光设置。
- 为 Ender IO 的电灯、光源节点、冷火、彩绘萤石、Liquid Sunshine 以及特定染色的透光玻璃/石英添加预设。
- 为 Actually Additions 的彩色灯、微型火把和双熔炉添加预设。所有预设均保留原生亮度及现有的 API/用户覆盖设置。
已更改
- 将 CleanroomDevEnv 更新至
6b24e5c,采用 Kotlin DSL 构建脚本及并行配置缓存。原生兼容性测试现在支持配置缓存;独立 API 发布和生产 JAR 检查功能仍然保留。 - 对所有编译后的类应用版本令牌,并检查类常量池中是否存在未解析的令牌,以避免在二进制数据中产生误匹配。
- 在解析嵌入式依赖项时选择 JVM 运行时变体。
- 将 Spotless 配置文件移至
gradle/spotless,并扩展 Renovate 的依赖覆盖范围。 - 验证发行说明提取功能,并保留对恢复中断上传的支持。GitHub Releases 继续禁用预发布标志。
- 添加 LGPL-3.0-only 源代码头文件,同时保留上游版权声明和 CleanroomDevEnv 的 MIT 声明。API 发布声明其使用 LGPL 许可证。
已移除
- 移除 Actinium 特定的渲染器集成。Actinium 面向 Cleanroom 0.6.x;Pulsar 需要在 0.7.x 系列中使用 Cleanroom 0.7.14-alpha 或更高版本。
- 移除 Felt 构建工具及其头部管理配置。
已修复
- 在进行 SCALAR 和 RGB 光照重新计算时,尊重封闭的外部方块面,避免在 slab 和其他侧面方块附近的区块边界处出现误匹配和不必要的光照重算。
- 当光照队列排空时,从过期的优先级索引中释放已完成的任务及其区块引用。
- 在设置失败后清除部分初始化的引擎缓存,以便复用的引擎不会保留过期的区块数据。
- 在加载时拒绝无效保存的光照 nibble 状态,允许损坏的缓存在后续保存导致错误之前进行重新光照处理。
已更改
- 将 Gradle 更新至 9.9.0,并将 actions/setup-java 更新至 v6.2.0。
- 在 CurseForge 和 Modrinth 上将带有 beta 标签的构建发布为 beta 文件,同时保持 GitHub Release 中的预发布标志处于禁用状态。
- 在所有分发站点上,使用匹配的 CHANGELOG 条目作为版本说明。
已修复
- 修复了 SCALAR 和 RGB 光照中光线穿过相邻上层与下层不透明半砖之间密封的水平边界的问题(问题 #29)。
- 通过在覆盖顶点处采样可见的空腔而非不透明墙壁的内部,避免了半砖旁边暴露出的墙面出现暗带(问题 #29)。
- 重新生成旧版保存的光照数据至缓存版本 15,以消除泄漏的半砖光照。
[0.6.2]
新增
- 为 Fancier Block Particles 和 Fanciest Block Particles 添加 RGB 灯光效果, 包括其自定义批量粒子渲染器。
[0.5.2]
修复
- 防止在使用 Fluidlogged API 时初始区块数据包无限期等待。 跳过原版冗余的随机玩家光照修复请求,否则会在每次发送尝试前创建新的待处理样本。方块/流体更新以及 Thaumcraft 水晶使用的上下文光照门控功能保持正常运行。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
评论 0
登录后参与评分
还没有评论,来抢沙发吧