Class: ParallelReducer

SKPR. ParallelReducer

new ParallelReducer(renderer, res, stopRes)

Parallel reduction class
Parameters:
Name Type Description
renderer THREE.WebGLRenderer Renderer
res number Power-of-2 resolution of textures to reduce
stopRes number Power-of-2 resolution to stop the reduction process (min of 1)
Source:

Methods

getPixelFloatData(channelId) → {number}

Gets the reduced float data from the previous reduction.
NOTE: This is an expensive operation.
Parameters:
Name Type Description
channelId string Channel to get float data from
Source:
Returns:
Floating point result of the reduction
Type
number

reduce(texture, type, channelId)

Initiate the reduction process
Parameters:
Name Type Description
texture THREE.Texture | THREE.WebGLRenderTarget Texture which contains data for reduction
type string Reduction type: 'sum' (only choice available now)
channelId string Channel to reduce: 'r', 'g', 'b' or 'a'
Source: