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
| Type | Name | Default |
|---|---|---|
int | entity_id | 0 |
StringName | group | &"" |
Variant | color | Color(1, 1, 1, 1) |
float | modulation | 1.0 |
Vector4 | placement | Vector4(0, 0, 0, 0) |
Methods
| Returns | Method |
|---|---|
bool | is_sky() |
void | set_color(v) |
void | set_modulation(v: float) |
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
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.
color
var color: Variant = Color(1, 1, 1, 1)
Undocumented.
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.
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.
set_color()
func set_color(v) -> void
The setter of color. A flickering lamp sets its modulation every frame and every face and probe it reaches listens, so an unchanged value is not announced: it would be thousands of calls.
set_modulation()
func set_modulation(v: float) -> void
The setter of modulation. Unchanged values are not announced, as with set_color().