HammeriteBakedLight

Core: lighting. Inherits Resource

The runtime handle of one light slot a bake wrote into the lightmaps and probes.

Every atlas and probe a light reaches holds this same instance, so assigning its color or modulation relights all of them without a re-bake.

Look one up with HammeriteMap.get_baked_light_for_entity() or HammeriteMap.get_baked_light_for_group().

Properties

TypeNameDefault
VariantcolorColor(1, 1, 1, 1)
intentity_id0
StringNamegroup&""
floatmodulation1.0
Vector4placementVector4(0, 0, 0, 0)

Methods

ReturnsMethod
boolis_sky() const

Signals

color_changed

signal color_changed(color: Color)

Emitted when color changes.

modulation_changed

signal modulation_changed(v: float)

Emitted when modulation changes.

Property descriptions

color

var color: Variant = Color(1, 1, 1, 1)

The light's colour, as the bake took it from the entity: a Color, whatever is assigned - a Vector3, as maps baked before it was a colour hold, is taken as one. Assigning it relights every face and probe the light reaches. An unchanged value is not announced.

entity_id

var entity_id: int = 0

Id of the HammeriteEntity this light was baked from; the group's representative entity when group is set. Negative for the sky's own slot, which no entity holds: see is_sky().

group

var group: StringName = &""

Slot group this light belongs to, empty when ungrouped. When several light entities share a group they share one slot and therefore ONE HammeriteBakedLight - this is the handle HammeriteMap.get_baked_light_for_group() resolves, so a single modulation drives the whole effect. entity_id is then the group's representative entity, not the only one.

modulation

var modulation: float = 1.0

Light modulation.

The value is between 0.0 and 1.0, with 0 having no contribution in the scene, and 1 having full contribution. Assigning it dims or brightens the light everywhere it was baked. A flickering lamp sets it every frame and every face and probe it reaches listens, so an unchanged value is not announced: it would be thousands of calls.

placement

var placement: Vector4 = Vector4(0, 0, 0, 0)

Where this light stands, so a shader can work out which way its light arrives at any point it is drawing - caustics flow that way. For a sun, placement holds the direction TOWARD it instead, which is what a w of 0 says.

A group is several lights in one slot and has no single position: the representative entity's stands for all of them, which is as true as one slot can be.

Method descriptions

is_sky()

func is_sky() -> bool

Whether this is the sky's slot, whose entity_id names no entity in the map.

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