@pirireis/webglobeplugins 0.9.3 → 0.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Math/juction/arc-plane.ts +42 -18
- package/Math/quaternion.ts +5 -8
- package/package.json +1 -1
- package/programs/line-on-globe/linestrip.ts +2 -2
- package/programs/{programcache.js → programcache.ts} +6 -6
- package/programs/totems/camerauniformblock.d.ts +48 -0
- package/programs/vectorfields/logics/drawrectangleparticles.js +1 -1
- package/publish.bat +60 -0
- package/tests/Math/junction/arc-plane.test.ts +10 -6
- package/tsconfig.json +21 -0
- package/util/account/{index.ts → index.js} +1 -1
- package/util/account/single-attribute-buffer-management/{buffer-manager.js → buffer-manager.ts} +18 -9
- package/util/account/single-attribute-buffer-management/{buffer-orchestrator.js → buffer-orchestrator.ts} +18 -12
- package/util/account/single-attribute-buffer-management/{object-store.js → object-store.ts} +10 -7
- package/util/account/single-attribute-buffer-management/types.ts +39 -0
- package/util/gl-util/buffer/attribute-loader.ts +2 -2
- package/util/gl-util/draw-options/methods.ts +66 -0
- package/util/gl-util/uniform-block/manager.ts +5 -5
- package/util/webglobjectbuilders.ts +456 -0
- package/util/gl-util/draw-options/client.js +0 -59
- package/util/gl-util/draw-options/methods.js +0 -46
- /package/programs/totems/{index.js → index.ts} +0 -0
- /package/util/shaderfunctions/{geometrytransformations.js → geometrytransformations.ts} +0 -0
- /package/util/{webglobjectbuilders.js → webglobjectbuilders1.js} +0 -0
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
class DrawOptionsClient {
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @typedef DrawOptionsClientAdaptor
|
|
7
|
-
* @type {Object}
|
|
8
|
-
* @property {function} setElements
|
|
9
|
-
* @property {function} setDrawRange
|
|
10
|
-
* @property {function} free
|
|
11
|
-
*
|
|
12
|
-
* @param {*} gl
|
|
13
|
-
* @param {*} adaptorsMap
|
|
14
|
-
*/
|
|
15
|
-
constructor(gl, adaptorsMap) {
|
|
16
|
-
this.gl = gl;
|
|
17
|
-
this.adaptorsMap = adaptorsMap;
|
|
18
|
-
this.elementBuffers = new Map();
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
__init() {
|
|
22
|
-
const { gl, adaptorsMap } = this;
|
|
23
|
-
// create element buffer for each element buffer type
|
|
24
|
-
for (const [key, value] of Object.entries(adaptorsMap)) {
|
|
25
|
-
const elementBuffer = gl.createBuffer();
|
|
26
|
-
this.elementBuffers.set(key, elementBuffer);
|
|
27
|
-
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, elementBuffer);
|
|
28
|
-
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, value, gl.DYNAMIC_DRAW);
|
|
29
|
-
}
|
|
30
|
-
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
setDrawRange() {
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
* @param {null|Int32List|Int32Array} elementIndexes
|
|
44
|
-
*/
|
|
45
|
-
setElements(elementIndexes = null) {
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
getDrawOptions() {
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
free() {
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import './types'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param {WebGL2RenderingContext} gl
|
|
6
|
-
* @param {WebGL2RenderingContext.DrawMode} mode
|
|
7
|
-
* @param {DrawRangeIndexParams} drawOptions
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
// first and element effects the vertexID, which is unfortunately not effected
|
|
12
|
-
const drawInstanced = (gl, mode, drawOptions, vertexCount) => {
|
|
13
|
-
const { drawRange, elementBufferIndexType = gl.UNSIGNED_INT } = drawOptions;
|
|
14
|
-
const { first = 0, count: instanceCount = 1 } = drawRange;
|
|
15
|
-
if (first > 0 || drawOptions.elementBuffer) {
|
|
16
|
-
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, drawOptions.elementBuffer);
|
|
17
|
-
gl.drawElementsInstanced(mode, vertexCount, elementBufferIndexType, first, instanceCount);
|
|
18
|
-
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
|
|
19
|
-
} else {
|
|
20
|
-
|
|
21
|
-
gl.drawArraysInstanced(mode, first, vertexCount, instanceCount);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* @param {WebGL2RenderingContext} gl
|
|
29
|
-
* @param {WebGL2RenderingContext.DrawMode} defaultMode
|
|
30
|
-
* @param {DrawRangeIndexParams} drawOptions
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
const drawArrays = (gl, defaultMode, drawOptions) => {
|
|
34
|
-
const { drawRange, elementBuffer, elementBufferIndexType = gl.UNSIGNED_INT, drawMode = null } = drawOptions;
|
|
35
|
-
const { first, count } = drawRange;
|
|
36
|
-
const mode = drawMode ?? defaultMode;
|
|
37
|
-
if (elementBuffer) {
|
|
38
|
-
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, elementBuffer);
|
|
39
|
-
gl.drawElements(mode, count, elementBufferIndexType, first);
|
|
40
|
-
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
|
|
41
|
-
} else {
|
|
42
|
-
gl.drawArrays(mode, first, count);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export { drawArrays, drawInstanced }
|
|
File without changes
|
|
File without changes
|
|
File without changes
|