@thi.ng/webgl 6.2.16 → 6.2.17
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 +1 -1
- package/README.md +7 -17
- package/api/blend.d.ts +1 -1
- package/api/buffers.d.ts +1 -1
- package/api/ext.d.ts +3 -3
- package/api/glsl.d.ts +18 -18
- package/api/model.d.ts +1 -1
- package/api/shader.d.ts +17 -17
- package/api/stencil.d.ts +2 -2
- package/api/texture.d.ts +1 -1
- package/package.json +27 -23
- package/shaders/phong.d.ts +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<!-- This file is generated - DO NOT EDIT! -->
|
|
2
2
|
|
|
3
|
-
# 
|
|
3
|
+
# 
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@thi.ng/webgl)
|
|
6
6
|

|
|
7
|
-
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
This project is part of the
|
|
10
10
|
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
|
|
@@ -19,13 +19,11 @@ This project is part of the
|
|
|
19
19
|
- [Usage examples](#usage-examples)
|
|
20
20
|
- [API](#api)
|
|
21
21
|
- [Authors](#authors)
|
|
22
|
-
- [Maintainer](#maintainer)
|
|
23
|
-
- [Contributors](#contributors)
|
|
24
22
|
- [License](#license)
|
|
25
23
|
|
|
26
24
|
## About
|
|
27
25
|
|
|
28
|
-
WebGL & GLSL abstraction layer
|
|
26
|
+
WebGL & GLSL abstraction layer
|
|
29
27
|
|
|
30
28
|
Largely declarative WebGL 1.0 / 2.0 abstraction layer, partially ported
|
|
31
29
|
& updated from Clojure/ClojureScript versions of
|
|
@@ -93,11 +91,8 @@ ES module import:
|
|
|
93
91
|
|
|
94
92
|
For Node.js REPL:
|
|
95
93
|
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
node --experimental-repl-await
|
|
99
|
-
|
|
100
|
-
> const webgl = await import("@thi.ng/webgl");
|
|
94
|
+
```js
|
|
95
|
+
const webgl = await import("@thi.ng/webgl");
|
|
101
96
|
```
|
|
102
97
|
|
|
103
98
|
Package sizes (brotli'd, pre-treeshake): ESM: 11.23 KB
|
|
@@ -156,12 +151,7 @@ TODO
|
|
|
156
151
|
|
|
157
152
|
## Authors
|
|
158
153
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
- Karsten Schmidt ([@postspectacular](https://github.com/postspectacular))
|
|
162
|
-
|
|
163
|
-
### Contributors
|
|
164
|
-
|
|
154
|
+
- [Karsten Schmidt](https://thi.ng) (Main author)
|
|
165
155
|
- [@nkint](https://github.com/nkint)
|
|
166
156
|
- [@stwind](https://github.com/stwind)
|
|
167
157
|
|
|
@@ -178,4 +168,4 @@ If this project contributes to an academic publication, please cite it as:
|
|
|
178
168
|
|
|
179
169
|
## License
|
|
180
170
|
|
|
181
|
-
© 2014 - 2022 Karsten Schmidt // Apache
|
|
171
|
+
© 2014 - 2022 Karsten Schmidt // Apache License 2.0
|
package/api/blend.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare enum BlendEquation {
|
|
|
23
23
|
MAX = 32776,
|
|
24
24
|
MIN = 32775
|
|
25
25
|
}
|
|
26
|
-
export
|
|
26
|
+
export type BlendFunc = Tuple<Blend, 2>;
|
|
27
27
|
export declare const BLEND_NORMAL: BlendFunc;
|
|
28
28
|
export declare const BLEND_ADD: BlendFunc;
|
|
29
29
|
//# sourceMappingURL=blend.d.ts.map
|
package/api/buffers.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IBind, IRelease } from "@thi.ng/api";
|
|
2
2
|
import type { ITexture } from "./texture.js";
|
|
3
|
-
export
|
|
3
|
+
export type IndexBufferData = Uint16Array | Uint32Array;
|
|
4
4
|
export interface IWebGLBuffer<T> extends IBind<void>, IRelease {
|
|
5
5
|
set(data: T, mode?: GLenum): void;
|
|
6
6
|
setChunk(data: T, offset: number): void;
|
package/api/ext.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export interface WebGLExtensionMap {
|
|
|
37
37
|
WEBGL_lose_context: WEBGL_lose_context;
|
|
38
38
|
WEBGL_multi_draw: WEBGL_multi_draw;
|
|
39
39
|
}
|
|
40
|
-
export
|
|
41
|
-
export
|
|
42
|
-
export
|
|
40
|
+
export type ExtensionName = keyof WebGLExtensionMap;
|
|
41
|
+
export type ExtensionBehavior = "require" | "warn" | boolean;
|
|
42
|
+
export type ExtensionBehaviors = Partial<Record<keyof WebGLExtensionMap, ExtensionBehavior>>;
|
|
43
43
|
//# sourceMappingURL=ext.d.ts.map
|
package/api/glsl.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import type { Tuple } from "@thi.ng/api";
|
|
2
2
|
import type { Type } from "@thi.ng/shader-ast";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
3
|
+
export type GLSL = Type;
|
|
4
|
+
export type GLVec = number[] | Float32Array;
|
|
5
|
+
export type GLVec2 = Tuple<number, 2> | Float32Array;
|
|
6
|
+
export type GLVec3 = Tuple<number, 3> | Float32Array;
|
|
7
|
+
export type GLVec4 = Tuple<number, 4> | Float32Array;
|
|
8
|
+
export type GLIntVec = number[] | Int32Array;
|
|
9
|
+
export type GLUintVec = number[] | Uint32Array;
|
|
10
|
+
export type GLIntVec2 = Tuple<number, 2> | Int32Array;
|
|
11
|
+
export type GLIntVec3 = Tuple<number, 3> | Int32Array;
|
|
12
|
+
export type GLIntVec4 = Tuple<number, 4> | Int32Array;
|
|
13
|
+
export type GLMat2 = Tuple<number, 4> | Float32Array;
|
|
14
|
+
export type GLMat3 = Tuple<number, 9> | Float32Array;
|
|
15
|
+
export type GLMat4 = Tuple<number, 16> | Float32Array;
|
|
16
|
+
export type GLMat23 = Tuple<number, 6> | Float32Array;
|
|
17
|
+
export type GLMat24 = Tuple<number, 8> | Float32Array;
|
|
18
|
+
export type GLMat34 = Tuple<number, 12> | Float32Array;
|
|
19
|
+
export type GLSLScalarType = "bool" | "float" | "int" | "uint" | "sampler2D" | "samplerCube";
|
|
20
|
+
export type GLSLArrayType = "bool[]" | "int[]" | "uint[]" | "float[]" | "bvec2[]" | "bvec3[]" | "bvec4[]" | "ivec2[]" | "ivec3[]" | "ivec4[]" | "uvec2[]" | "uvec3[]" | "uvec4[]" | "vec2[]" | "vec3[]" | "vec4[]" | "mat2[]" | "mat3[]" | "mat4[]" | "sampler2D[]" | "sampler3D[]" | "samplerCube[]";
|
|
21
21
|
//# sourceMappingURL=glsl.d.ts.map
|
package/api/model.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare enum DrawMode {
|
|
|
12
12
|
TRIANGLE_STRIP = 5,
|
|
13
13
|
TRIANGLE_FAN = 6
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type ModelAttributeSpecs = IObjectOf<ModelAttributeSpec>;
|
|
16
16
|
export interface ModelSpec {
|
|
17
17
|
/**
|
|
18
18
|
* Initialized {@link IShader} instance
|
package/api/shader.d.ts
CHANGED
|
@@ -20,32 +20,32 @@ export interface GLSLDeclPrefixes {
|
|
|
20
20
|
u: string;
|
|
21
21
|
o: string;
|
|
22
22
|
}
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
23
|
+
export type ShaderType = "vs" | "fs";
|
|
24
|
+
export type AttribType = "bool" | "float" | "int" | "vec2" | "vec3" | "vec4";
|
|
25
|
+
export type AttribBufferData = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Float32Array;
|
|
26
|
+
export type UniformValue = number | NumericArray;
|
|
27
|
+
export type UniformValues = IObjectOf<UniformValue | Fn2<ShaderUniforms, any, UniformValue> | IDeref<UniformValue>>;
|
|
28
|
+
export type UniformDefault<T> = T | Fn2<ShaderUniforms, IObjectOf<number | ReadonlyVec>, T>;
|
|
29
|
+
export type UniformDecl = GLSL | [GLSLScalarType, UniformDefault<number>] | ["bvec2", UniformDefault<GLIntVec2>] | ["bvec3", UniformDefault<GLIntVec3>] | ["bvec4", UniformDefault<GLIntVec4>] | ["ivec2", UniformDefault<GLIntVec2>] | ["ivec3", UniformDefault<GLIntVec3>] | ["ivec4", UniformDefault<GLIntVec4>] | ["vec2", UniformDefault<GLVec2>] | ["vec3", UniformDefault<GLVec3>] | ["vec4", UniformDefault<GLVec4>] | ["mat2", UniformDefault<GLMat2>] | ["mat3", UniformDefault<GLMat3>] | ["mat4", UniformDefault<GLMat4>] | ["bool[]", number, UniformDefault<GLIntVec>?] | ["int[]", number, UniformDefault<GLIntVec>?] | ["uint[]", number, UniformDefault<GLUintVec>?] | ["float[]", number, UniformDefault<GLVec>?] | ["bvec2[]", number, UniformDefault<GLIntVec>?] | ["bvec3[]", number, UniformDefault<GLIntVec>?] | ["bvec4[]", number, UniformDefault<GLIntVec>?] | ["ivec2[]", number, UniformDefault<GLIntVec>?] | ["ivec3[]", number, UniformDefault<GLIntVec>?] | ["ivec4[]", number, UniformDefault<GLIntVec>?] | ["uvec2[]", number, UniformDefault<GLUintVec>?] | ["uvec3[]", number, UniformDefault<GLUintVec>?] | ["uvec4[]", number, UniformDefault<GLUintVec>?] | ["vec2[]", number, UniformDefault<GLVec>?] | ["vec3[]", number, UniformDefault<GLVec>?] | ["vec4[]", number, UniformDefault<GLVec>?] | ["mat2[]", number, UniformDefault<GLVec>?] | ["mat3[]", number, UniformDefault<GLVec>?] | ["mat4[]", number, UniformDefault<GLVec>?] | ["sampler2D[]", number, UniformDefault<GLIntVec>?] | ["sampler3D[]", number, UniformDefault<GLIntVec>?] | ["samplerCube[]", number, UniformDefault<GLIntVec>?];
|
|
30
30
|
/**
|
|
31
31
|
* Object of attribute types w/ optional locations.
|
|
32
32
|
*/
|
|
33
|
-
export
|
|
34
|
-
export
|
|
33
|
+
export type ShaderAttribSpecs = IObjectOf<ShaderAttribSpec>;
|
|
34
|
+
export type ShaderAttribSpec = AttribType | [AttribType, number];
|
|
35
35
|
/**
|
|
36
36
|
* Object of instantiated shader attributes.
|
|
37
37
|
*/
|
|
38
|
-
export
|
|
38
|
+
export type ShaderAttribs = IObjectOf<ShaderAttrib>;
|
|
39
39
|
export interface ShaderAttrib {
|
|
40
40
|
type: AttribType;
|
|
41
41
|
loc: number;
|
|
42
42
|
}
|
|
43
|
-
export
|
|
44
|
-
export
|
|
45
|
-
export
|
|
46
|
-
export
|
|
47
|
-
export
|
|
48
|
-
export
|
|
43
|
+
export type ShaderVaryingSpecs = IObjectOf<ShaderVaryingSpec>;
|
|
44
|
+
export type ShaderVaryingSpec = GLSL | [GLSLArrayType, number];
|
|
45
|
+
export type ShaderUniformSpecs = IObjectOf<UniformDecl>;
|
|
46
|
+
export type ShaderUniforms = IObjectOf<ShaderUniform>;
|
|
47
|
+
export type ShaderOutputSpecs = IObjectOf<ShaderOutputSpec>;
|
|
48
|
+
export type ShaderOutputSpec = GLSL | [GLSL, number];
|
|
49
49
|
export interface ShaderUniform {
|
|
50
50
|
type: GLSL;
|
|
51
51
|
loc: WebGLUniformLocation;
|
|
@@ -54,7 +54,7 @@ export interface ShaderUniform {
|
|
|
54
54
|
defaultVal?: UniformValue;
|
|
55
55
|
}
|
|
56
56
|
export declare const DEFAULT_OUTPUT: ShaderOutputSpecs;
|
|
57
|
-
export
|
|
57
|
+
export type ShaderFn = Fn4<GLSLTarget, IObjectOf<Sym<any>>, // uni
|
|
58
58
|
IObjectOf<Sym<any>>, // attribs
|
|
59
59
|
IObjectOf<Sym<any>>, // vary
|
|
60
60
|
(Sym<any> | Func<any>)[]>;
|
package/api/stencil.d.ts
CHANGED
|
@@ -19,6 +19,6 @@ export declare enum StencilFn {
|
|
|
19
19
|
GEQUAL = 518,
|
|
20
20
|
ALWAYS = 519
|
|
21
21
|
}
|
|
22
|
-
export
|
|
23
|
-
export
|
|
22
|
+
export type StencilOpParams = Tuple<StencilOp, 3>;
|
|
23
|
+
export type StencilFnParams = [StencilFn, number, number];
|
|
24
24
|
//# sourceMappingURL=stencil.d.ts.map
|
package/api/texture.d.ts
CHANGED
|
@@ -139,7 +139,7 @@ export interface TextureFormatDecl {
|
|
|
139
139
|
gl2?: boolean;
|
|
140
140
|
}
|
|
141
141
|
export declare const TEX_FORMATS: IObjectOf<TextureFormatDecl>;
|
|
142
|
-
export
|
|
142
|
+
export type ReadableTextureFormat = TextureFormat.ALPHA | TextureFormat.RED | TextureFormat.RG | TextureFormat.RGB | TextureFormat.RGBA | TextureFormat.RED_INTEGER | TextureFormat.RG_INTEGER | TextureFormat.RGB_INTEGER | TextureFormat.RGBA_INTEGER;
|
|
143
143
|
export interface TextureOpts {
|
|
144
144
|
/**
|
|
145
145
|
* If this value is null or a typedarray then size options (i.e.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/webgl",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.17",
|
|
4
4
|
"description": "WebGL & GLSL abstraction layer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
"url": "https://patreon.com/thing_umbrella"
|
|
22
22
|
}
|
|
23
23
|
],
|
|
24
|
-
"author": "Karsten Schmidt
|
|
24
|
+
"author": "Karsten Schmidt (https://thi.ng)",
|
|
25
|
+
"contributors": [
|
|
26
|
+
"@nkint (https://github.com/nkint)",
|
|
27
|
+
"@stwind (https://github.com/stwind)"
|
|
28
|
+
],
|
|
25
29
|
"license": "Apache-2.0",
|
|
26
30
|
"scripts": {
|
|
27
31
|
"build": "yarn clean && tsc --declaration",
|
|
@@ -34,30 +38,30 @@
|
|
|
34
38
|
"test": "testament test"
|
|
35
39
|
},
|
|
36
40
|
"dependencies": {
|
|
37
|
-
"@thi.ng/adapt-dpi": "^2.2.
|
|
38
|
-
"@thi.ng/api": "^8.
|
|
39
|
-
"@thi.ng/associative": "^6.2.
|
|
40
|
-
"@thi.ng/checks": "^3.3.
|
|
41
|
-
"@thi.ng/equiv": "^2.1.
|
|
42
|
-
"@thi.ng/errors": "^2.2.
|
|
43
|
-
"@thi.ng/logger": "^1.4.
|
|
44
|
-
"@thi.ng/matrices": "^2.1.
|
|
45
|
-
"@thi.ng/memoize": "^3.1.
|
|
46
|
-
"@thi.ng/pixel": "^4.0.
|
|
47
|
-
"@thi.ng/shader-ast": "^0.12.
|
|
48
|
-
"@thi.ng/shader-ast-glsl": "^0.4.
|
|
49
|
-
"@thi.ng/shader-ast-stdlib": "^0.12.
|
|
50
|
-
"@thi.ng/transducers": "^8.3.
|
|
51
|
-
"@thi.ng/vector-pools": "^3.1.
|
|
52
|
-
"@thi.ng/vectors": "^7.5.
|
|
41
|
+
"@thi.ng/adapt-dpi": "^2.2.4",
|
|
42
|
+
"@thi.ng/api": "^8.6.0",
|
|
43
|
+
"@thi.ng/associative": "^6.2.19",
|
|
44
|
+
"@thi.ng/checks": "^3.3.5",
|
|
45
|
+
"@thi.ng/equiv": "^2.1.15",
|
|
46
|
+
"@thi.ng/errors": "^2.2.6",
|
|
47
|
+
"@thi.ng/logger": "^1.4.5",
|
|
48
|
+
"@thi.ng/matrices": "^2.1.36",
|
|
49
|
+
"@thi.ng/memoize": "^3.1.19",
|
|
50
|
+
"@thi.ng/pixel": "^4.0.11",
|
|
51
|
+
"@thi.ng/shader-ast": "^0.12.33",
|
|
52
|
+
"@thi.ng/shader-ast-glsl": "^0.4.33",
|
|
53
|
+
"@thi.ng/shader-ast-stdlib": "^0.12.26",
|
|
54
|
+
"@thi.ng/transducers": "^8.3.26",
|
|
55
|
+
"@thi.ng/vector-pools": "^3.1.37",
|
|
56
|
+
"@thi.ng/vectors": "^7.5.27"
|
|
53
57
|
},
|
|
54
58
|
"devDependencies": {
|
|
55
|
-
"@microsoft/api-extractor": "^7.33.
|
|
56
|
-
"@thi.ng/testament": "^0.3.
|
|
59
|
+
"@microsoft/api-extractor": "^7.33.7",
|
|
60
|
+
"@thi.ng/testament": "^0.3.7",
|
|
57
61
|
"rimraf": "^3.0.2",
|
|
58
62
|
"tools": "^0.0.1",
|
|
59
|
-
"typedoc": "^0.23.
|
|
60
|
-
"typescript": "^4.
|
|
63
|
+
"typedoc": "^0.23.22",
|
|
64
|
+
"typescript": "^4.9.4"
|
|
61
65
|
},
|
|
62
66
|
"keywords": [
|
|
63
67
|
"2d",
|
|
@@ -215,5 +219,5 @@
|
|
|
215
219
|
],
|
|
216
220
|
"year": 2014
|
|
217
221
|
},
|
|
218
|
-
"gitHead": "
|
|
222
|
+
"gitHead": "f445a9cc8022bcdebbf6ff91fd66ced016d72f01\n"
|
|
219
223
|
}
|
package/shaders/phong.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Material } from "../api/material.js";
|
|
2
2
|
import type { ShaderPresetOpts, ShaderSpec } from "../api/shader.js";
|
|
3
|
-
export
|
|
3
|
+
export type PhongOpts = ShaderPresetOpts<Pick<Material, "ambientCol" | "diffuseCol" | "specularCol">>;
|
|
4
4
|
export declare const PHONG: (opts?: Partial<PhongOpts>) => ShaderSpec;
|
|
5
5
|
//# sourceMappingURL=phong.d.ts.map
|