@thi.ng/webgl 6.6.4 → 6.6.7
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/CHANGELOG.md +7 -1
- package/README.md +1 -1
- package/buffer.js +5 -0
- package/error.d.ts +1 -0
- package/fbo.js +4 -0
- package/package.json +23 -24
- package/rbo.js +5 -0
- package/shader.js +7 -2
- package/texture.js +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2023-
|
|
3
|
+
- **Last updated**: 2023-11-09T10:28:19Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [6.6.6](https://github.com/thi-ng/umbrella/tree/@thi.ng/webgl@6.6.6) (2023-11-09)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- update all tests (packages A-S) ([e3085e4](https://github.com/thi-ng/umbrella/commit/e3085e4))
|
|
17
|
+
|
|
12
18
|
## [6.6.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/webgl@6.6.0) (2023-10-25)
|
|
13
19
|
|
|
14
20
|
#### 🚀 Features
|
package/README.md
CHANGED
package/buffer.js
CHANGED
|
@@ -3,6 +3,11 @@ import { DrawMode, } from "./api/model.js";
|
|
|
3
3
|
import { isGL2Context } from "./checks.js";
|
|
4
4
|
import { error } from "./error.js";
|
|
5
5
|
export class WebGLArrayBuffer {
|
|
6
|
+
gl;
|
|
7
|
+
buffer;
|
|
8
|
+
target;
|
|
9
|
+
mode;
|
|
10
|
+
data;
|
|
6
11
|
constructor(gl, data, target = gl.ARRAY_BUFFER, mode = gl.STATIC_DRAW, retain = false) {
|
|
7
12
|
this.gl = gl;
|
|
8
13
|
this.buffer = gl.createBuffer() || error("error creating WebGL buffer");
|
package/error.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const WebGLError: {
|
|
|
4
4
|
name: string;
|
|
5
5
|
message: string;
|
|
6
6
|
stack?: string | undefined;
|
|
7
|
+
cause?: unknown;
|
|
7
8
|
};
|
|
8
9
|
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
9
10
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
package/fbo.js
CHANGED
|
@@ -20,6 +20,10 @@ const GL_MAX_COLOR_ATTACHMENTS_WEBGL = 0x8cdf;
|
|
|
20
20
|
* https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_draw_buffers
|
|
21
21
|
*/
|
|
22
22
|
export class FBO {
|
|
23
|
+
gl;
|
|
24
|
+
fbo;
|
|
25
|
+
ext;
|
|
26
|
+
maxAttachments;
|
|
23
27
|
constructor(gl, opts) {
|
|
24
28
|
this.gl = gl;
|
|
25
29
|
this.fbo = gl.createFramebuffer() || error("error creating FBO");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/webgl",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.7",
|
|
4
4
|
"description": "WebGL & GLSL abstraction layer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -32,35 +32,34 @@
|
|
|
32
32
|
"clean": "rimraf --glob '*.js' '*.d.ts' '*.map' doc api geo shaders textures",
|
|
33
33
|
"doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
|
|
34
34
|
"doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
|
|
35
|
-
"doc:readme": "
|
|
36
|
-
"doc:stats": "tools:module-stats",
|
|
35
|
+
"doc:readme": "bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts",
|
|
37
36
|
"pub": "yarn npm publish --access public",
|
|
38
|
-
"test": "
|
|
37
|
+
"test": "bun test"
|
|
39
38
|
},
|
|
40
39
|
"dependencies": {
|
|
41
|
-
"@thi.ng/adapt-dpi": "^2.2.
|
|
42
|
-
"@thi.ng/api": "^8.9.
|
|
43
|
-
"@thi.ng/associative": "^6.3.
|
|
44
|
-
"@thi.ng/checks": "^3.4.
|
|
45
|
-
"@thi.ng/equiv": "^2.1.
|
|
46
|
-
"@thi.ng/errors": "^2.4.
|
|
47
|
-
"@thi.ng/logger": "^1.4.
|
|
48
|
-
"@thi.ng/matrices": "^2.2.
|
|
49
|
-
"@thi.ng/memoize": "^3.1.
|
|
50
|
-
"@thi.ng/pixel": "^4.3.
|
|
51
|
-
"@thi.ng/shader-ast": "^0.12.
|
|
52
|
-
"@thi.ng/shader-ast-glsl": "^0.4.
|
|
53
|
-
"@thi.ng/shader-ast-stdlib": "^0.16.
|
|
54
|
-
"@thi.ng/transducers": "^8.8.
|
|
55
|
-
"@thi.ng/vector-pools": "^3.1.
|
|
56
|
-
"@thi.ng/vectors": "^7.8.
|
|
40
|
+
"@thi.ng/adapt-dpi": "^2.2.24",
|
|
41
|
+
"@thi.ng/api": "^8.9.8",
|
|
42
|
+
"@thi.ng/associative": "^6.3.19",
|
|
43
|
+
"@thi.ng/checks": "^3.4.8",
|
|
44
|
+
"@thi.ng/equiv": "^2.1.33",
|
|
45
|
+
"@thi.ng/errors": "^2.4.2",
|
|
46
|
+
"@thi.ng/logger": "^1.4.24",
|
|
47
|
+
"@thi.ng/matrices": "^2.2.8",
|
|
48
|
+
"@thi.ng/memoize": "^3.1.42",
|
|
49
|
+
"@thi.ng/pixel": "^4.3.4",
|
|
50
|
+
"@thi.ng/shader-ast": "^0.12.80",
|
|
51
|
+
"@thi.ng/shader-ast-glsl": "^0.4.80",
|
|
52
|
+
"@thi.ng/shader-ast-stdlib": "^0.16.5",
|
|
53
|
+
"@thi.ng/transducers": "^8.8.10",
|
|
54
|
+
"@thi.ng/vector-pools": "^3.1.85",
|
|
55
|
+
"@thi.ng/vectors": "^7.8.4"
|
|
57
56
|
},
|
|
58
57
|
"devDependencies": {
|
|
59
|
-
"@microsoft/api-extractor": "^7.38.
|
|
60
|
-
"@thi.ng/testament": "^0.
|
|
58
|
+
"@microsoft/api-extractor": "^7.38.2",
|
|
59
|
+
"@thi.ng/testament": "^0.4.1",
|
|
61
60
|
"rimraf": "^5.0.5",
|
|
62
61
|
"tools": "^0.0.1",
|
|
63
|
-
"typedoc": "^0.25.
|
|
62
|
+
"typedoc": "^0.25.3",
|
|
64
63
|
"typescript": "^5.2.2"
|
|
65
64
|
},
|
|
66
65
|
"keywords": [
|
|
@@ -219,5 +218,5 @@
|
|
|
219
218
|
],
|
|
220
219
|
"year": 2014
|
|
221
220
|
},
|
|
222
|
-
"gitHead": "
|
|
221
|
+
"gitHead": "669a3151e4302480244fe3e60eff5e732ea5b7a7\n"
|
|
223
222
|
}
|
package/rbo.js
CHANGED
package/shader.js
CHANGED
|
@@ -21,9 +21,14 @@ import { GLSL_HEADER, NO_PREFIXES, SYNTAX } from "./syntax.js";
|
|
|
21
21
|
import { UNIFORM_SETTERS } from "./uniforms.js";
|
|
22
22
|
const ERROR_REGEXP = /ERROR: \d+:(\d+): (.*)/;
|
|
23
23
|
export class Shader {
|
|
24
|
+
gl;
|
|
25
|
+
program;
|
|
26
|
+
attribs;
|
|
27
|
+
uniforms;
|
|
28
|
+
state;
|
|
29
|
+
warnAttrib = doOnce((id) => LOGGER.warn(`unknown attrib: ${id} (no further warnings will be shown...)`));
|
|
30
|
+
warnUni = doOnce((id) => LOGGER.warn(`unknown uniform: ${id} (no further warnings will be shown...)`));
|
|
24
31
|
constructor(gl, program, attribs, uniforms, state) {
|
|
25
|
-
this.warnAttrib = doOnce((id) => LOGGER.warn(`unknown attrib: ${id} (no further warnings will be shown...)`));
|
|
26
|
-
this.warnUni = doOnce((id) => LOGGER.warn(`unknown uniform: ${id} (no further warnings will be shown...)`));
|
|
27
32
|
this.gl = gl;
|
|
28
33
|
this.program = program;
|
|
29
34
|
this.attribs = attribs;
|
package/texture.js
CHANGED
|
@@ -13,6 +13,14 @@ const $bind = (op) => (textures) => {
|
|
|
13
13
|
export const bindTextures = $bind("bind");
|
|
14
14
|
export const unbindTextures = $bind("unbind");
|
|
15
15
|
export class Texture {
|
|
16
|
+
gl;
|
|
17
|
+
tex;
|
|
18
|
+
target;
|
|
19
|
+
format;
|
|
20
|
+
filter;
|
|
21
|
+
wrap;
|
|
22
|
+
type;
|
|
23
|
+
size;
|
|
16
24
|
constructor(gl, opts = {}) {
|
|
17
25
|
this.gl = gl;
|
|
18
26
|
this.tex = gl.createTexture() || error("error creating WebGL texture");
|