HammeriteDecal3D
Core: entities. Inherits HammeritePointEntityNode3D < Node3D
A picture stuck on a wall: a scorch mark, a poster, a bloodstain.
What is stored is the PROJECTOR - where it is, which way the surface faced, how big, and which decal - never the triangles. Geometry derived from the world and then saved goes stale the moment the world recompiles, which in this toolkit is the recurring way lighting and lineage get orphaned. Deriving it here means a wall can move and its decal follows. The mesh is the receiving wall's own polygon, cut to the decal's footprint - see _clip_to_surfaces(). A quad is the fallback for a decal with no wall under it. Where it sits and what falls under it is HammeriteDecalProjection, which the bake asks the same questions of. Being the wall cut to shape is also what lights it: each piece is drawn with the brush shader pointed at the lightmap of the wall it came from, so a decal in a dark corner is dark without anything of its own being baked - see _piece_material().
Methods
| Returns | Method |
|---|---|
void | set_map_3d(map_3d: HammeriteMap3D) |
void | set_editor_active(_active: bool) |
bool | draws_editor_gizmos_only_when_picked() |
void | draw_editor_gizmos(gizmos: HammeriteGizmoBuffer) |
void | apply_entity_property(prop_name: StringName, value) |
Constants
DECAL_RENDER_PRIORITY
const DECAL_RENDER_PRIORITY = 2
Drawn after the walls (opaque -1, transparent 1), because it is drawn ON one of them.
DECAL_MATERIAL
const DECAL_MATERIAL = <Object>
The brush shader with a decal's two differences: its picture's alpha blends it onto the surface, and it is lit as though it had none. See _piece_material(). Shared: each decal draws with a copy, and a parameter set on this one reaches every decal made afterwards.
Method descriptions
set_map_3d()
func set_map_3d(map_3d: HammeriteMap3D) -> void
Taken from the HammeriteMap3D that builds it. Without a map there is nothing to clip against, and the decal falls back to a plain quad.
set_editor_active()
func set_editor_active(_active: bool) -> void
Overrides
HammeritePointEntityNode3D.set_editor_active()
draws_editor_gizmos_only_when_picked()
func draws_editor_gizmos_only_when_picked() -> bool
The decal itself is part of the world and shows to a player. Only the marker saying where its projector sits is the author's, and only while a decal is selected - a level's worth of boxes over every scorch mark is not a view of anything.
draw_editor_gizmos()
func draw_editor_gizmos(gizmos: HammeriteGizmoBuffer) -> void
Overrides
HammeritePointEntityNode3D.draw_editor_gizmos()
apply_entity_property()
func apply_entity_property(prop_name: StringName, value) -> void
Overrides
.