-
Notifications
You must be signed in to change notification settings - Fork 5
Documentation: 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 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.
An rgb color.
Pulls variables from defines.colors in ph_lights.json
A color uses a string and supports 2 formats:
- Hex color (E.g.
#FFFFFF); must be a length of 7. - Rgb color, where each component is a float from 0 to 1 (E.g.
rgb(1.0, 1.0, 1.0))
Sets how bright the light is, where 100 is the normal brightness.
Pulls variables from defines.intensities in ph_lights.json
Uses a number
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
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
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:
- A basic string (E.g
minecraft:#stoneis all stone blocks,minecraft:furnace[lit=true]is a lit furnace, and*<id>references blocks fromblocks.properties). - A json object
{ "value": "<basic string>", "priority": <priority> }, or{ "value": "*<id>", "priority": <priority> }
Blocks defined by shaders have their priority increased by 1000.
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.
{
"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>
...
}
}
}- Home
- Documentation
- How to adapt your Shaderpack