HammeriteShaderGlobals

Core: lighting. Inherits RefCounted

The global shader uniforms Hammerite's materials read. Enabling the plugin declares any the project has not (see the core README); a material reading one that is not declared fails to compile.

Prefixed because shader globals are project-wide, like a class_name: an unprefixed exposure would be the host's own exposure as well.

A game sets two of them: ambient_light(), and exposure() unless a HammeriteEyeAdaptation3D drives it. HammeriteLightCurve publishes the light-curve ones. The rest, from show_grid() on, are the editor's view state, and a game only declares them.

Each name is a static method, in lower case, since a native class can only bind integers as constants.

Methods

ReturnsMethod
Dictionary[StringName, int]all() static
StringNameambient_light() static
PackedStringArraydeclare_missing() static
Dictionary[StringName, Variant]defaults() static
StringNameexposure() static
StringNamegrid_scale() static
StringNamelight_curve() static
StringNamelight_curve_enabled() static
StringNamelight_curve_lift() static
StringNamelight_curve_lift_tint() static
StringNamelight_curve_lit_surface_level() static
StringNameselection_xray() static
StringNameshow_grid() static
PackedStringArrayundeclared() static
StringNamevis_caustics() static
StringNamevis_lightmap() static
StringNamevis_lightmap_density() static
StringNamevis_unlit() static

Method descriptions

all()

static func all() -> Dictionary[StringName, int]

Every one of them, as name -> RenderingServer.GlobalShaderParameterType.

ambient_light()

static func ambient_light() -> StringName

Vec4 whose RGB is the floor of light every lit surface gets - brushes, props, decals, water - added before the light curve: the ambient knob. Nothing in Hammerite sets it, so until a game does, every surface has the default 0.1.

declare_missing()

static func declare_missing() -> PackedStringArray

Declare in Project Settings each of all() the project has not, with its defaults() value, and in the running renderer too so materials compile without a restart. Returns the names it declared; saving the settings is the caller's.

defaults()

static func defaults() -> Dictionary[StringName, Variant]

What declare_missing() gives each one. A project's own declaration is never overwritten.

exposure()

static func exposure() -> StringName

Float multiplier on the final lit colour. HammeriteEyeAdaptation3D drives it every frame.

grid_scale()

static func grid_scale() -> StringName

Float, the editor grid's spacing in map units. The editor sets it.

light_curve()

static func light_curve() -> StringName

Sampler2D lookup of the light curve; published by HammeriteLightCurve.publish().

light_curve_enabled()

static func light_curve_enabled() -> StringName

Bool, whether the shaders apply the light curve at all; published by HammeriteLightCurve.

light_curve_lift()

static func light_curve_lift() -> StringName

Float, how much of the shadow lift is in effect; published by HammeriteLightCurve.

light_curve_lift_tint()

static func light_curve_lift_tint() -> StringName

Vec4, HammeriteLightCurve.lift_tint as published.

light_curve_lit_surface_level()

static func light_curve_lit_surface_level() -> StringName

Float, HammeriteLightCurve.lit_surface_level as published.

selection_xray()

static func selection_xray() -> StringName

Bool, whether the editor's selection outline is drawn through occluding geometry.

show_grid()

static func show_grid() -> StringName

Bool, whether brush materials draw the editor grid over surfaces. The editor sets it.

undeclared()

static func undeclared() -> PackedStringArray

Which of all() this project has not declared.

vis_caustics()

static func vis_caustics() -> StringName

Bool, editor visualisation: the baked caustics and the water they came through.

vis_lightmap()

static func vis_lightmap() -> StringName

Bool, editor visualisation: the lightmap's light alone, with no surface colour or exposure.

vis_lightmap_density()

static func vis_lightmap_density() -> StringName

Bool, editor visualisation: a grid showing each surface's lightmap texel density. The uniform keeps the name it had as VIS_LIGHTMAP_SCALE, so a project that declared it need not again.

vis_unlit()

static func vis_unlit() -> StringName

Bool, editor visualisation: surfaces drawn with their textures and no lighting.

Hammerite 2.0 · built from 6d57ab2d, 2026-10-17