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

Index

Constructors

constructor

Find examples in Playground
  • Creates a min/max reducer

    Parameters

    • camera: Camera

      The camera to use for the post processes

    Returns MinMaxReducer

Properties

onAfterReductionPerformed

Find examples in Playground
onAfterReductionPerformed: Observable<object>

Observable triggered when the computation has been performed

Accessors

activated

Find examples in Playground
  • get activated(): boolean
  • Gets the activation status of the reducer

    Returns boolean

refreshRate

Find examples in Playground
  • get refreshRate(): number
  • set refreshRate(value: number): any
  • 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

sourceTexture

Find examples in Playground

Methods

activate

Find examples in Playground
  • activate(): void
  • Activates the reduction computation. When activated, the observers registered in onAfterReductionPerformed are called after the compuation is performed

    Returns void

deactivate

Find examples in Playground
  • deactivate(): void
  • Deactivates the reduction computation.

    Returns void

dispose

Find examples in Playground
  • dispose(disposeAll?: boolean): void
  • 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

setSourceTexture

Find examples in Playground
  • setSourceTexture(sourceTexture: RenderTargetTexture, depthRedux: boolean, type?: number, forceFullscreenViewport?: boolean): 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

    • 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

Generated using TypeDoc