体积光幕

体积光幕

Veil附加库,用于支持彩色介质

面纱体积光

一个面向面纱点光源、聚光灯和矩形区域光的客户端渲染库,支持连续透明介质体积。

公共 API 位于 com.cappleapple.veilvolumelights.api.client 下。使用 VeilVolumeLights.create(...) 创建一个持久化的 VolumeLightHandle,当光源变化时更新它,并在光源消失时释放它。

VolumeLightHandle point = VeilVolumeLights.create(new VolumeLight.Point(
        position, color, 1.0F, 16.0F, true, 0.6F
));

VolumeLightHandle spot = VeilVolumeLights.create(new VolumeLight.Spot( position, forward, up, color, 1.0F, 40.0F, 24.0F, 10.0F, true, 0.8F ));

VolumeLightHandle area = VeilVolumeLights.create(new VolumeLight.Area( position, forward, up, color, 1.0F, 24.0F, 4.0F, 2.0F, 70.0F, true, 0.7F ));

定义使用完整的锥形/扩散角度(以度为单位)和完整的区域宽度/高度(以方块为单位)。调用是客户端侧的,应在渲染线程上进行。

对于视觉测试,使用“功能方块”创造模式标签页或以下命令:

/give @s veilvolumelights:test_point_light
/give @s veilvolumelights:test_spot_light
/give @s veilvolumelights:test_area_light

开发

需要 Java 21。

./gradlew.bat test build
./gradlew.bat runClient

Veil Volume Lights 以 MIT 许可证发布。

参考集成是 TaCZ 的 Veil Lights。