Skip to content

OccluderMaskMaterial

Masked occluder material

Occluders are elements of a scene that are not rendered by themselves but still participate in occlusion queries. Usually, occluder is a base mesh (average approximation) of a body representing its real counterpart in a scene. Occluders are used to mask visible virtual objects behind them (like geometries of a 3D scene behind user’s body). Masked occluder material is a more advanced version of the OccluderMaterial that takes into account a body segmentation mask provided by the PoseProcessor. It writes depth value only for pixels covered by a mask providing more realistic occlusion aligned with a body, additionally reducing effect of unnatural cuts in VTO. This material is created by OccluderMaskPlugin, please do not construct instance of OccluderMaskMaterial directly, plugin owns and updates texture of the mask.

Extends

  • ShaderMaterial

Constructors

new OccluderMaskMaterial()

new OccluderMaskMaterial(name, scene, texture?): OccluderMaskMaterial

Constructor

Parameters

name: string

Name of the material in the scene

scene: Scene

Scene the material belongs to

texture?: BaseTexture

Texture storing segmentation mask

Returns

OccluderMaskMaterial

Overrides

ShaderMaterial.constructor

Methods

dispose()

dispose(forceDisposeEffect?, forceDisposeTextures?, notBoundToMesh?): void

Dispose the material

Overridden to keep the external mask texture owned by the plugin.

Parameters

forceDisposeEffect?: boolean

Effects should be forcefully disposed

forceDisposeTextures?: boolean

Textures should be forcefully disposed

notBoundToMesh?: boolean

Material is known to be not bound to any mesh

Returns

void

Overrides

ShaderMaterial.dispose