Skip to content

Documentation: ph_lights.json

Essentuan edited this page May 28, 2026 · 1 revision

/ph_lights.json

Allows shaders to customize the color of block lights. Created under /shaders/ph_lights.json, it supports the use of the preprocessor.

For the sake of parsing, Photonics ignores everything in the file before the opening json bracket. This means you are free to use #include/#define before at the top of the file!

A version of ph_lights.json that contains the default light values can be found here. The default priority for lights is: user config → shader ph_lights.json.

Variables

Variables allow you to reference previously defined types.

They are used like so "key": "*<variable_name>". The source they pull from will be listed under the type.

Variables may also reference other variables.

Color

An rgb color.

Pulls variables from defines.colors in ph_lights.json

A color uses a string and supports 2 formats:

  1. Hex color (E.g. #FFFFFF); must be a length of 7.
  2. Rgb color, where each component is a float from 0 to 1 (E.g. rgb(1.0, 1.0, 1.0))

Intensity

Sets how bright the light is, where 100 is the normal brightness.

Pulls variables from defines.intensities in ph_lights.json Uses a number

Radius

The radius of a light. This is not in any specific unit, play around and see what works for you.

Pulls variables from defines.radii in ph_lights.json Uses a number

Falloff

How fast the light falls off over distances, where 1 is the default falloff (E.g. a falloff of 0.5 will falloff at half the rate of 1).

Pulls variables from defines.falloffs in ph_lights.json Uses a number

Block states

Represents block state(s). Each block state uses the same syntax as /execute if block.

Block states are unique in that (in shaders) it pulls variables from blocks.properties (E.g. *1000 will use the block states at id 1000). It also supports 2 types:

  1. A basic string (E.g minecraft:#stone is all stone blocks, minecraft:furnace[lit=true] is a lit furnace, and *<id> references blocks from blocks.properties).
  2. A json object { "value": "<basic string>", "priority": <priority> }, or { "value": "*<id>", "priority": <priority> }

Blocks defined by shaders have their priority increased by 1000.

Light Groups

A light group is a tree structure with the following fields:

{
  "intensity": <intensity>,
  "radius": <radius>,
  "falloff": <falloff>,
  "color": <color>,
  "is_traced": <true | false>,
  "blocks": [
      "<block>",
      { "value": "<block>", "priority": "200" },
      ...
  ],
  "overrides": {
    "<group name>": <light group>
     ...
  }
}

You are allowed to omit some of these fields (such as intensity, radius, falloff, ect.). If a field is omitted it inherits its value from its parents.

However every block must be able to resolve all the required fields.

Structure

{
  "defines": {
    "colors": {
      "example_color": "#ffffff",
      "example_color2": "rgb(1.0, 1.0, 1.0)"
    },
    "intensities": {
      "default": 1
    },
    "radii": {
      "default": 1
    },
    "falloffs": {
      "default": 1
    }
  },
  "lights": {
      "<group name>": <light group>
      ...
    }
  }
}

Clone this wiki locally