Members | Methods |
---|---|
new V2_0()
Data loader for WebGL 2.0. Must load the data to a Texture2DArray.
The name of the texture is a constant. The order od the textures in
the z-stacking is defined in dataIndexMapping.
For details, please, see the implementation.
- Source:
Members
loadersByType
Loader strategy based on toString result, extend with your type if necessary.
If your type cannot use the given version strategy (TEXTURE_2D_ARRAY UNIT), you have
to re-define the whole API.
- Source:
Methods
declare(indicesOfImages) → {string}
Declare elements in shader
Parameters:
Name | Type | Description |
---|---|---|
indicesOfImages |
Array.<number> | mapping of shader to data index, i.e. if shader requests texture i, the texture is located in the data at indicesOfImages[i] index |
- Source:
Returns:
GLSL declaration (terminated with semicolon) of necessary elements for textures
measure(index) → {string}
Measure texture size
Parameters:
Name | Type | Description |
---|---|---|
index |
number | index of the texture |
- Source:
Returns:
GLSL expression (unterminated) to obtain texture size - vec2
sample(index, vec2coords) → {string}
Sample texture
Parameters:
Name | Type | Description |
---|---|---|
index |
number | string | texture index, must respect index re-mapping (see declare()) |
vec2coords |
string | GLSL expression that evaluates to vec2 |
- Source:
Returns:
GLSL expression (unterminated) that evaluates to vec4
toCanvas(context, dataIndexMapping, visualization, data, tileBounds, program, gl)
Called when tile is processed
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
context |
WebGLModule | context renderer reference | |||||||||
dataIndexMapping |
array | mapping of array indices to data indices, e.g. texture 0 for this shader corresponds to index dataIndexMapping[0] in the data array, -1 value used for textures not loaded | |||||||||
visualization |
object | reference to the current active visualization object | |||||||||
data |
* | data object, must contain all the data listed in WebGLModule.prototype.getSources() in the respective order, dataIndexMapping then points with index to this data; by default an Image object | |||||||||
tileBounds |
object | tile size in pixels
Properties
|
|||||||||
program |
WebGLProgram | current WebGLProgram | |||||||||
gl |
WebGL2RenderingContext |
- Source:
toCanvasFinish(context, dataIndexMapping, visualization, data, tileBounds, program, gl)
Parameters:
Name | Type | Description |
---|---|---|
context |
||
dataIndexMapping |
||
visualization |
||
data |
||
tileBounds |
||
program |
||
gl |
- Source:
(static) toBuffers(context, gl, wrap, filter, visualization)
Called when the program is being loaded (set as active)
Parameters:
Name | Type | Description |
---|---|---|
context |
WebGLModule | |
gl |
WebGL2RenderingContext | WebGL context |
wrap |
GLint | required texture GL wrap value |
filter |
GLint | required texture GL filter value |
visualization |
object | reference to the visualization object |
- Source: