-
Name Type Description webGlContextWebGLRenderingContext WebGL context; mandatory.
scaleRationumber | undefined Scale ratio; if < 1, the post process will render to a texture smaller than the main canvas that will then be sampled up (useful for saving resource on blur steps).
vertexShaderstring | undefined Vertex shader source
fragmentShaderstring | undefined Fragment shader source
uniformsObject<UniformValue> | undefined Uniform definitions for the post process step
Methods
-
Render to the next postprocessing pass (or to the canvas if final pass).
Name Type Description frameStateFrameState current frame state
nextPassWebGLPostProcessingPass | undefined Next pass, optional
preComposefunction | undefined Called before composing.
postComposefunction | undefined Called before composing.
frameState.pixelRationumber The pixel ratio of the frame.
frameState.timenumber The time when rendering of the frame was requested.
frameState.viewStateState The state of the current view.
frameState.animateboolean Animate.
frameState.coordinateToPixelTransformTransform CoordinateToPixelTransform.
frameState.declutterTreemodule:rbush DeclutterTree.
frameState.extentnull | Extent Extent (in view projection coordinates).
frameState.nextExtentExtent | undefined Next extent during an animation series.
frameState.indexnumber Index.
frameState.layerStatesArrayArray<State> LayerStatesArray.
frameState.layerIndexnumber LayerIndex.
frameState.pixelToCoordinateTransformTransform PixelToCoordinateTransform.
frameState.postRenderFunctionsArray<PostRenderFunction> PostRenderFunctions.
frameState.sizeSize Size.
frameState.tileQueueTileQueue TileQueue.
frameState.usedTilesObject.<string, Object.<string, boolean>> UsedTiles.
frameState.viewHintsArray.<number> ViewHints.
frameState.wantedTilesObject.<string, Object.<string, boolean>> WantedTiles.
frameState.mapIdstring The id of the map.
frameState.renderTargetsObject.<string, boolean> Identifiers of previously rendered elements.
-
Returns:
Depth buffer
-
Returns:
Frame buffer
-
Get the WebGL rendering context
Returns:
The rendering context.
-
Initialize the render target texture of the post process, make sure it is at the right size and bind it as a render target for the next draw calls. The last step to be initialized will be the one where the primitives are rendered.
Name Type Description frameStatecurrent frame state
Name Type Description pixelRationumber The pixel ratio of the frame.
timenumber The time when rendering of the frame was requested.
viewStateState The state of the current view.
animateboolean Animate.
coordinateToPixelTransformTransform CoordinateToPixelTransform.
declutterTreemodule:rbush DeclutterTree.
extentnull | Extent Extent (in view projection coordinates).
nextExtentExtent | undefined Next extent during an animation series.
indexnumber Index.
layerStatesArrayArray<State> LayerStatesArray.
layerIndexnumber LayerIndex.
pixelToCoordinateTransformTransform PixelToCoordinateTransform.
postRenderFunctionsArray<PostRenderFunction> PostRenderFunctions.
sizeSize Size.
tileQueueTileQueue TileQueue.
usedTilesObject.<string, Object.<string, boolean>> UsedTiles.
viewHintsArray.<number> ViewHints.
wantedTilesObject.<string, Object.<string, boolean>> WantedTiles.
mapIdstring The id of the map.
renderTargetsObject.<string, boolean> Identifiers of previously rendered elements.