HammeriteBakeOccluder

Core: lighting. Inherits RefCounted

One lump of matter that stops light in a bake and is never lit by it. See HammeriteBakeOccluders.

Made from a mesh and where that mesh stands - which for a door is its leaf and the transform it has when SHUT. A bake is a photograph of the world in one arrangement, and the arrangement worth photographing is the one the level is authored in; a door baked ajar leaves a stripe of light across a floor that has no door in it.

Properties

TypeNameDefault
HammeriteEntityentitynull
PackedVector3ArrayverticesPackedVector3Array()

Methods

ReturnsMethod
boolis_usable()
inttriangle_count()
HammeriteBakeOccluderfrom_mesh(owner_entity: HammeriteEntity, mesh: Mesh, where: Transform3D = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)) static
HammeriteBakeOccluderfrom_hull(owner_entity: HammeriteEntity, points: PackedVector3Array) static

Property descriptions

entity

var entity: HammeriteEntity = null

Whose it is. Its id groups the triangles in the GPU buffer, which is what lets the bake skip a thing's own geometry when it lights it - so an occluder that is also lit (it is not, today) would not shadow itself.

vertices

var vertices: PackedVector3Array = PackedVector3Array()

World-space triangles, three vertices at a time.

Method descriptions

is_usable()

func is_usable() -> bool

Everything it takes to be worth adding: somebody to belong to, and whole triangles to be made of.

triangle_count()

func triangle_count() -> int

How many triangles it is.

from_mesh()

static func from_mesh(owner_entity: HammeriteEntity, mesh: Mesh, where: Transform3D = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)) -> HammeriteBakeOccluder

The shadow a mesh standing at where casts. Every surface of it, triangulated the way the GPU wants: a mesh whose surfaces are indexed is read through its index array, and one that is not is read straight through. An ArrayMesh surface that is not triangles is skipped - a mesh of lines casts no shadow, and neither does a point cloud.

from_hull()

static func from_hull(owner_entity: HammeriteEntity, points: PackedVector3Array) -> HammeriteBakeOccluder

The shadow the convex hull of points casts, for something whose shape is easier to say as the corners it occupies than as a mesh.

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