-
Name Type Description options
Options.
Name Type Description uniforms
Object.<string, module:ol/webgl/Helper~UniformValue> Uniform definitions; property names must match the uniform names in the provided or default shaders.
postProcesses
Array.<module:ol/webgl/Helper~PostProcessesOptions> Post-processes definitions
Extends
- module:ol/Disposable~Disposable
Methods
-
Just bind the buffer if it's in the cache. Otherwise create the WebGL buffer, bind it, populate it, and add an entry to the cache.
Name Type Description buffer
module:ol/webgl/Buffer~WebGLArrayBuffer Buffer.
-
Will create or reuse a given webgl texture and apply the given size. If no image data specified, the texture will be empty, otherwise image data will be used and the
size
parameter will be ignored. Note: wrap parameters are set to clamp to edge, min filter is set to linear.Name Type Description size
Array.<number> Expected size of the texture
data
ImageData | HTMLImageElement | HTMLCanvasElement Image data/object to bind to the texture
texture
WebGLTexture Existing texture to reuse
Returns:
The generated texture
-
Execute a draw call based on the currently bound program, texture, buffers, attributes.
Name Type Description start
number Start index.
end
number End index.
-
Will enable the following attributes to be read from the currently bound buffer, i.e. tell the GPU where to read the different attributes in the buffer. An error in the size/type/order of attributes will most likely break the rendering and throw a WebGL exception.
Name Type Description attributes
Array.<module:ol/webgl/Helper~AttributeDescription> Ordered list of attributes to read from the buffer
-
Apply the successive post process passes which will eventually render to the actual canvas.
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.
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.
-
Update the data contained in the buffer array; this is required for the new data to be rendered
Name Type Description buffer
module:ol/webgl/Buffer~WebGLArrayBuffer Buffer.
-
Will get the location from the shader or the cache
Name Type Description name
string Attribute name
Returns:
attribLocation
-
Returns:
Canvas.
-
Get the WebGL rendering context
Returns:
The rendering context.
-
Create a program for a vertex and fragment shader. Throws if shader compilation fails.
Name Type Description fragmentShaderSource
string Fragment shader source.
vertexShaderSource
string Vertex shader source.
Returns:
Program
-
Will get the location from the shader or the cache
Name Type Description name
string Uniform name
Returns:
uniformLocation
-
makeProjectionTransform(frameState, transform){module:ol/transform~Transform}
-
Modifies the given transform to apply the rotation/translation/scaling of the given frame state. The resulting transform can be used to convert world space coordinates to view coordinates.
Name Type Description frameState
module:ol/PluggableMap~FrameState Frame state.
transform
module:ol/transform~Transform Transform to update.
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.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.
Returns:
The updated transform object.
-
Clear the buffer & set the viewport to draw. Post process passes will be initialized here, the first one being bound as a render target for subsequent draw calls.
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.
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.
-
Give a value for a standard float uniform
Name Type Description uniform
string Uniform name
value
number Value
-
Give a value for a standard matrix4 uniform
Name Type Description uniform
string Uniform name
value
Array.<number> Matrix value
-
Use a program. If the program is already in use, this will return
false
.Name Type Description program
WebGLProgram Program.
Returns:
Changed.