Skip to content

Documentation: Light Modifier

Essentuan edited this page Mar 28, 2026 · 1 revision

Light Modifier (since v0.3.1)

/photonics/modifiers/light_modifier.glsl

Intercepts Lights as they're loaded by Photonics. Disabled using PH_LIGHT_MODIFIER_DISABLED.

Some things to be aware of:

  • light.color is premultiplied by light.intensity, if you change it you should make sure to multiply it again by light.intensity.
  • light.index will be -1 for the light in the main hand, and -2 for the light in the offhand
  • light.blockId will be -1 for enchanted items
  • light.falloff is <PH_LIGHTS_INTENSITY> / 100
  • light.attenuation is vec2(0.9, 1 / <PH_LIGHTS_RADIUS>)

Usage:

void modify_light(inout Light light, vec3 world_pos);

Clone this wiki locally