Class MinMaxReducer
Hierarchy
- MinMaxReducer
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
Creates a min/max reducer
Parameters
-
camera: Camera
The camera to use for the post processes
Returns MinMaxReducer
-
Properties
on After Reduction PerformedSearch playground for onAfterReductionPerformed
Observable triggered when the computation has been performed
Accessors
activated
-
Gets the activation status of the reducer
Returns boolean
refresh Rate
-
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
-
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...
Parameters
-
value: number
Returns any
-
source Texture
-
Gets the texture used to read the values from.
Returns Nullable<RenderTargetTexture>
Methods
activateSearch playground for activate
-
Activates the reduction computation. When activated, the observers registered in onAfterReductionPerformed are called after the compuation is performed
Returns void
deactivateSearch playground for deactivate
-
Deactivates the reduction computation.
Returns void
disposeSearch playground for dispose
-
Disposes the min/max reducer
Parameters
-
Optional disposeAll: boolean
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
-
set Source TextureSearch playground for setSourceTexture
-
Sets the source texture to read the values from. One must indicate if the texture is a depth texture or not through the depthRedux parameter because in such textures '1' value must not be taken into account to compute the maximum as this value is used to clear the texture. Note that the computation is not activated by calling this function, you must call activate() for that!
Parameters
-
sourceTexture: RenderTargetTexture
The texture to read the values from. The values should be in the red channel.
-
depthRedux: boolean
Indicates if the texture is a depth texture or not
-
Optional type: number
The type of the textures created for the reduction (defaults to TEXTURETYPE_HALF_FLOAT)
-
Optional forceFullscreenViewport: boolean
Forces the post processes used for the reduction to be applied without taking into account viewport (defaults to true)
Returns void
-
This class computes a min/max reduction from a texture: it means it computes the minimum and maximum values from all values of the texture. It is performed on the GPU for better performances, thanks to a succession of post processes. The source values are read from the red channel of the texture.