Options
All
  • Public
  • Public/Protected
  • All
Menu

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

  • Creates a min/max reducer

    Parameters

    • camera: Camera

      The camera to use for the post processes

    Returns MinMaxReducer

Properties

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

Observable triggered when the computation has been performed

Accessors

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

    Returns boolean

  • get refreshRate(): number
  • set refreshRate(value: number): void
  • 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 void

Methods

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

    Returns void

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

    Returns void

  • 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(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 constructor
  • Static method

Settings

Theme