Skip to content

Documentation: Macros

Essentuan edited this page Mar 25, 2026 · 1 revision

Macros

PHOTONICS (since v0.3.0)

Defined in shader & properties files by Photonics.

Useful as a marker to indicate the presence of Photonics.

PHOTONICS_VERSION (since v0.3.0)

Defined in shader & properties files by Photonics.

The current Photonics version, encoded in a 122 format (1 major, 2 minor, 2 incremental), with leading zeros removed (E.g 0.3.1 would be 301).

See iris version.

PHOTONICS_ENABLED (PATCH ONLY; since v0.3.0)

Defined by patches.

Used in place of photonics.enabled to enable/disable Photonics. You should define it just like any regular toggle option in your settings file.

DOES NOTHING SPECIAL WITH REGULAR SHADERS.

PH_RENDER_SCALE (since v0.3.0)

Defined in shader files.

The current value for photonics.renderScale.

PH_MAX_LIGHTS (since v0.3.0)

Defined in shader files by Photonics.

The current value for photonics.maxLights.

PH_ENABLE_GI (since v0.3.0)

Defined in shader files by Photonics when photonics.enableGi is true.

PH_ENABLE_BLOCKLIGHT (since v0.3.0)

Defined in shader files by Photonics when photonics.enableBlockLight is true.

PH_ENABLE_HANDHELD_LIGHT (since v0.3.0)

Defined in shader files by Photonics when photonics.enableHandheldLight is true.

PH_ENABLE_LIGHT_BINNING (since v0.3.1)

Defined in shader files by Photonics when photonics.enableLightBinning is true.

PH_RESTIR_INITIAL_SAMPLES (since v0.3.1)

Defined in shader files by Photonics.

The current value for photonics.restirIntialSamples.

PH_RESTIR_SPATIAL_REUSE_SAMPLES (since v0.3.1)

Defined in shader files by Photonics.

The current value for photonics.restirSpatialReuseSamples.

PH_RESTIR_SPATIAL_REUSE_RADIUS (since v0.3.1)

Defined in shader files by Photonics.

The current value for photonics.restirSpatialReuseRadius.

PH_RESTIR_ACCUMULATION_FRAMAES (since v0.3.1)

Defined in shader files by Photonics.

The current value for photonics.restirAccumulationFrames.

PH_RESTIR_DENOISER_PASSES (since v0.3.1)

Defined in shader files by Photonics.

The current value for photonics.restirDenoiserPasses.

PH_RESTIR_SOFT_SHADOWS (since v0.3.1)

Defined in shader files by Photonics when photonics.restirSoftShadows is true.

PH_MAX_SAMPLES (since v0.3.0)

Defined in shader files by Photonics.

The current value for photonics.maxSamples.

OVERWORLD (since v0.3.0)

Defined in shader files under the /photonics directory when in the overworld.

As of v0.3.1 it is also the default for custom dimensions.

NETHER (since v0.3.0)

Defined in shader files under the /photonics directory when in the nether.

END (since v0.3.0)

Defined in shader files under the /photonics directory when in the end.

PH_USE_CUSTOM_ALPHA (since v0.3.0)

Used to enable the use of a custom alpha function in trace_ray.

PH_ALPHA_FUNC (since v0.3.0)

Sets the alpha function used by trace_ray.

Used like:

#define PH_USE_CUSTOM_ALPHA
#define PH_ALPHA_FUNC(color) apply_tint_impl(color)

vec3 apply_tint_impl(vec4 color) {
  // return the tint color here
}

#include "/photonics/photonics.glsl"

PH_USE_CUSTOM_AIR_ID (since v0.3.0)

Used to enable the use of a custom air return id with get_block_id.

PH_AIR_ID (since v0.3.0)

Sets the id to return for air with get_block_id

Clone this wiki locally