Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / components / OccluderComponent

Class: OccluderComponent ​

Defined in: components/Occluder.ts:19

Marks a solid, roughly box-shaped object (a wall, a building, a rock face) as something that hides what's behind it. Each frame the engine draws every occluder's bounding box, shrunk by inset, into a small depth buffer and skips drawing objects that are completely behind them.

Only for things you can't see through: a tree or a fence as an occluder would hide what shows through its gaps. Big and simple is best. Occlusion culling runs in Preview and the published game, not the editor, and not in a headset by default (world.occlusion.xr).

Extends ​

Constructors ​

Constructor ​

ts
new OccluderComponent(options?): OccluderComponent;

Defined in: components/Occluder.ts:24

Parameters ​

ParameterType
optionsOccluderOptions

Returns ​

OccluderComponent

Overrides ​

Component.constructor

Properties ​

PropertyTypeDefault valueDescriptionDefined in
enabledbooleantrue-components/Occluder.ts:20
insetnumber0.05Shrink the box by this share of each side (0.1 = 10%), so it never hides more than the object does.components/Occluder.ts:22