Class DepthReducer
Hierarchy (View Summary)
- MinMaxReducer
- DepthReducer
Constructors
constructor
-
Creates a depth reducer
Parameters
- camera: Camera
The camera used to render the depth texture
Returns DepthReducer
- camera: Camera
Accessors
activated
-
get activated(): boolean
Gets the activation status of the reducer
Returns boolean
depth Renderer
-
Gets the depth renderer used for the computation. Note that the result is null if you provide your own renderer when calling setDepthRenderer.
Returns Nullable<DepthRenderer>
on After Reduction Performed
-
Observable triggered when the computation has been performed
Returns Observable<{ max: number; min: number }>
refresh Rate
-
get refreshRate(): number
Defines the refresh rate of the computation. Use 0 to compute just once, 1 to compute on every frame, 2 to compute every two frames and so on...
Returns number
-
set refreshRate(value: number): void
Parameters
- value: number
Returns void
source Texture
-
Gets the texture used to read the values from.
Returns Nullable<RenderTargetTexture>
wait For Readback
-
get waitForReadback(): boolean
Wait for WebGPU texture readback before notifying observers (default: false). This delays the notification; it does not block the render loop.
Returns boolean
-
set waitForReadback(value: boolean): void
Parameters
- value: boolean
Returns void
Methods
activate
-
Activates the reduction computation. When activated, the observers registered in onAfterReductionPerformed are called after the computation is performed
Returns void
deactivate
-
Deactivates the reduction computation.
Returns void
dispose
-
Disposes the depth reducer
Parameters
- disposeAll: boolean = true
true to dispose all the resources. You should always call this function with true as the parameter (or without any parameter as it is the default one). This flag is meant to be used internally.
Returns void
- disposeAll: boolean = true
set Depth Renderer
-
setDepthRenderer(
depthRenderer?: Nullable<DepthRenderer>,
type?: number,
forceFullscreenViewport?: boolean,
): voidSets the depth renderer to use to generate the depth map
Parameters
- depthRenderer: Nullable<DepthRenderer> = null
The depth renderer to use. If not provided, a new one will be created automatically
- type: number = Constants.TEXTURETYPE_HALF_FLOAT
The texture type of the depth map (default: TEXTURETYPE_HALF_FLOAT)
- forceFullscreenViewport: boolean = true
Forces the post processes used for the reduction to be applied without taking into account viewport (defaults to true)
Returns void
- depthRenderer: Nullable<DepthRenderer> = null
This class is a small wrapper around the MinMaxReducer class to compute the min/max values of a depth texture