Class: OcclusionUtils
Defined in: src/depth/occlusion/OcclusionUtils.ts:4
Constructors
Constructor
new OcclusionUtils():
OcclusionUtils
Returns
OcclusionUtils
Methods
addOcclusionToMaterial()
staticaddOcclusionToMaterial(material,onShaderReady?):void
Defined in: src/depth/occlusion/OcclusionUtils.ts:35
Configures a material for depth occlusion across both WebGLRenderer and
WebGPURenderer, invoking onShaderReady with the uniform handle to
register in Depth.occludableShaders.
Parameters
material
onShaderReady?
(shader) => void
Returns
void
addOcclusionToShader()
staticaddOcclusionToShader(shader):void
Defined in: src/depth/occlusion/OcclusionUtils.ts:71
Modifies a material's shader in-place to incorporate distance-based
alpha occlusion. This is designed to be used with a material's
onBeforeCompile property. This only works with built-in three.js
materials.
Parameters
shader
The shader object provided by onBeforeCompile.
Returns
void
createOcclusionMapOverrideMaterial()
staticcreateOcclusionMapOverrideMaterial():MeshBasicMaterial
Defined in: src/depth/occlusion/OcclusionUtils.ts:60
Creates a simple material used for rendering objects into the occlusion
map. This material is intended to be used with renderer.overrideMaterial.
Returns
A new instance of THREE.MeshBasicMaterial.
setWebGPUMaterialHandler()
staticsetWebGPUMaterialHandler(handler):void
Defined in: src/depth/occlusion/OcclusionUtils.ts:15
Registers or clears the WebGPU TSL material occlusion handler.
Called internally by Depth.init() when WebGPURenderer is active.
Parameters
handler
(material) => Shader | undefined
Returns
void