Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Constructors

constructor

  • Creates a min/max reducer

    Parameters

    • camera: Camera

      The camera to use for the post processes

    Returns MinMaxReducer

Properties

onAfterReductionPerformedSearch playground for onAfterReductionPerformed

onAfterReductionPerformed: Observable<{ max: number; min: number }>

Observable triggered when the computation has been performed

Accessors

activated

  • get activated(): boolean
  • Gets the activation status of the reducer

    Returns boolean

refreshRate

  • 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

Methods

activateSearch playground for activate

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

    Returns void

deactivateSearch playground for deactivate

  • deactivate(): void
  • Deactivates the reduction computation.

    Returns void

disposeSearch playground for dispose

  • 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

setSourceTextureSearch playground for setSourceTexture

  • 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

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method