-
Name Type Description options
Options.
Name Type Description webGlContext
WebGLRenderingContext WebGL context; mandatory.
scaleRatio
number | 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).
vertexShader
string | undefined Vertex shader source
fragmentShader
string | undefined Fragment shader source
uniforms
Object.<string, module:ol/webgl/Helper~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 frameState
module:ol/PluggableMap~FrameState current frame state
nextPass
module:ol/webgl/PostProcessingPass~WebGLPostProcessingPass | undefined Next pass, optional
preCompose
function | undefined Called before composing.
postCompose
function | undefined Called before composing.
frameState.pixelRatio
number The pixel ratio of the frame.
frameState.time
number The time when rendering of the frame was requested.
frameState.viewState
module:ol/View~State The state of the current view.
frameState.animate
boolean Animate.
frameState.coordinateToPixelTransform
module:ol/transform~Transform CoordinateToPixelTransform.
frameState.declutterTree
module:rbush DeclutterTree.
frameState.extent
null | module:ol/extent~Extent Extent.
frameState.nextExtent
module:ol/extent~Extent | undefined Next extent during an animation series.
frameState.index
number Index.
frameState.layerStatesArray
Array.<module:ol/layer/Layer~State> LayerStatesArray.
frameState.layerIndex
number LayerIndex.
frameState.pixelToCoordinateTransform
module:ol/transform~Transform PixelToCoordinateTransform.
frameState.postRenderFunctions
Array.<module:ol/PluggableMap~PostRenderFunction> PostRenderFunctions.
frameState.size
module:ol/size~Size Size.
frameState.tileQueue
module:ol/TileQueue~TileQueue TileQueue.
frameState.usedTiles
Object.<string, Object.<string, boolean>> UsedTiles.
frameState.viewHints
Array.<number> ViewHints.
frameState.wantedTiles
Object.<string, Object.<string, boolean>> WantedTiles.
frameState.mapId
string The id of the map.
frameState.renderTargets
Object.<string, boolean> Identifiers of previously rendered elements.
-
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 frameState
current frame state
Name Type Description pixelRatio
number The pixel ratio of the frame.
time
number The time when rendering of the frame was requested.
viewState
module:ol/View~State The state of the current view.
animate
boolean Animate.
coordinateToPixelTransform
module:ol/transform~Transform CoordinateToPixelTransform.
declutterTree
module:rbush DeclutterTree.
extent
null | module:ol/extent~Extent Extent.
nextExtent
module:ol/extent~Extent | undefined Next extent during an animation series.
index
number Index.
layerStatesArray
Array.<module:ol/layer/Layer~State> LayerStatesArray.
layerIndex
number LayerIndex.
pixelToCoordinateTransform
module:ol/transform~Transform PixelToCoordinateTransform.
postRenderFunctions
Array.<module:ol/PluggableMap~PostRenderFunction> PostRenderFunctions.
size
module:ol/size~Size Size.
tileQueue
module:ol/TileQueue~TileQueue TileQueue.
usedTiles
Object.<string, Object.<string, boolean>> UsedTiles.
viewHints
Array.<number> ViewHints.
wantedTiles
Object.<string, Object.<string, boolean>> WantedTiles.
mapId
string The id of the map.
renderTargets
Object.<string, boolean> Identifiers of previously rendered elements.