API

Class MinMaxReducer

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.

Hierarchy (View Summary)

Index
  • Disposes the min/max 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

  • 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

    • type: number = Constants.TEXTURETYPE_HALF_FLOAT

      The type of the textures created for the reduction (defaults to 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