HammeriteBakeOccluders

Core: lighting. Inherits RefCounted

Process-wide registry of things that STOP light without ever being lit.

A door is the case this exists for. It is a thing in a doorway, it is solid, and light should not cross it - but it is not brushwork and it is not scenery: it swings, so it is lit by the probes like everything else that moves, and a lightmap of it would be a lightmap of a door that is not there any more. What the bake needs from it is the shadow and nothing else. Hammerite does not know what a door is, and must not. So a game registers a provider - a Callable taking a HammeriteMap and returning the shapes that stop light in it - and the bake asks every provider once, while it is collecting geometry. What a door IS, where its hinge is, whether it counts as shut: all of that stays on the game's side of the line, and what crosses it is triangles. The triangles ride the same buffer the mesh props already use, which is why this is a small seam rather than a new pipeline: mesh_triangles_first_hit in the bake shader already tests every triangle it is given. They are added with no patches, and a triangle with no patches has no luxels - so it blocks light and never receives any, which is the whole of what a door wants. Being triangles, they need not be convex. A cuboid door, an arched one, a portcullis: all the same question asked of each triangle. Registration is idempotent by id, so a game re-initialising replaces its provider rather than stacking a second copy and shadowing everything twice.

Methods

ReturnsMethod
voidregister(id: StringName, provider: Callable) static
voidunregister(id: StringName) static
boolhas(id: StringName) static
voidclear() static
HammeriteBakeOccluder[]gather(map: HammeriteMap) static
boolany() static

Method descriptions

register()

static func register(id: StringName, provider: Callable) -> void

Register provider under id, replacing anything already registered under it. provider is called as provider(map) and returns an Array of HammeriteBakeOccluder.

unregister()

static func unregister(id: StringName) -> void

Drop the provider registered under id, if any.

has()

static func has(id: StringName) -> bool

Whether a provider is registered under id.

clear()

static func clear() -> void

Drop every provider.

gather()

static func gather(map: HammeriteMap) -> HammeriteBakeOccluder[]

Everything every provider says stops light in map. A provider that throws, answers with the wrong sort of thing, or was bound to something since freed is reported and skipped: a bake is a long job to lose to one addon's mistake, and a map baked without one game's doors is a map with light under its doors rather than no map at all.

any()

static func any() -> bool

Whether anything at all is registered, for a caller that wants to skip the work of asking.

Hammerite 1.0 · built from a6dd634, 2026-10-10