Skip to content

applyPlacementShading

applyPlacementShading(object, tint, opacity): void

Defined in: packages/declarative-hex-worlds/src/three/three.ts:671

Apply optional per-placement shading (tint / opacity) to every material in a loaded GLTF model, mirroring the tileset-cell path so 3D units/props can be fog-shrouded / team-tinted the same way tiles are. Both are opt-in: when neither is set the materials are untouched (the model renders byte-identically). A tint multiplies each material’s color; an opacity < 1 makes it translucent. The cloned model owns its materials (SkeletonUtils clone), so mutating them here does not leak into the shared cached scene’s materials — except that three’s GLTF loader may SHARE a material instance across meshes/clones, so we clone each material before mutating to keep the shading strictly per-placement.

Object3D

{ b: number; g: number; r: number; } | undefined

number | undefined

void