介绍
OpalLight —— Colored Light API
Overview
OpalLight provides a universal colored light API for Minecraft. Unlike common full-screen shader approaches, OpalLight uses per-block, voxel-level RGB light propagation——colors travel through blocks via BFS, attenuate with distance, mix across RGB channels, and take the strongest value within each channel. This means colored lighting renders correctly around corners and through complex geometry, rather than being a screen-space post-effect.
The key advantage: automatically compatible with the vast majority of Iris Shaders with zero user configuration.
Core Features
Powerful Colored Light API
- Data-driven + event-driven: Register colored light sources via JSON data files, or programmatically through the
ModificationEvent. - StatePropertiesPredicate support: Different block states of the same block can emit different colors.
- Zero-invasion integration: Any block from any mod can emit colored light——just register data or listen to the event.
True Color Propagation
- Voxel-level BFS light propagation, with linear attenuation over Manhattan distance.
- Per-channel multi-source merging: different channels mix naturally while equal channels use the strongest value, so removing a source remains exact.
- Correct lighting regardless of terrain complexity——corners, crevices, and caves all light accurately.
Broad Compatibility
- Iris Shaders: Automatically compatible with the vast majority of shader packs. No manual compatibility selection needed.
- Custom shaders use Core Profile GLSL 150, standards-compliant to avoid rendering conflicts.
Example: Colored Lanterns
Seven colored lanterns are included as API usage demonstrations:
| Lantern | Recipe |
|---|---|
| Red / Orange / Yellow / Green / Cyan / Blue / Purple Lantern | Vanilla lantern + matching dye (shapeless) |
Each lantern is registered through OpalLight’s API, showing how blocks are associated with RGB colors.
Showcase
Vanilla

Complementary

BSL

Photon

Mellow

For Developers
// Listen to ModificationEvent to register colored light for any block
@SubscribeEvent
public static void onLightModification(LightDataLoader.ModificationEvent event) {
event.getDataByBlock().put(
MyBlocks.GLOWING_CRYSTAL,
List.of(new LightDataLoader.OpalData(new OpalColor(0.2f, 0.8f, 1.0f), Optional.empty()))
);
}
Or drop a JSON file under assets/<modid>/opal_data/ for zero-code integration.
Compatibility
| Project | Status |
|---|---|
| Iris Shaders | Auto-compatible with most shader packs |
| NeoForge 1.21.1 | Native platform |
| Other mods’ light-emitting blocks | Compatible via API registration |
常见问题
Opal Light 支持哪些 Minecraft 版本?
Opal Light 支持 Minecraft Java 版 1.20.1–1.21.1,共 2 个版本,可用的加载器:Forge / NeoForge。下载时注意选择和你游戏版本一致的文件。
Opal Light 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Forge / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。
westernat233 的其他作品
查看全部 →GeckoJS
使用 KubeJS 和 GeckoLib 创建可动画的方块、物品和盔甲
Terra Entity
一个模组,收录了大量《泰拉瑞亚》中的怪物和 Boss,是大型模组 Confluence 整合的子模组之一。
Confluence: Otherworld
一个将泰拉瑞亚内容融入 Minecraft 的模组,旨在打造两款游戏浑然一体又乐趣十足的组合体验。
Advancement JS
用 KubeJS 配置的不只是进度
评论
登录后评论和评分