@thi.ng/webgl 6.2.15 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2022-11-23T22:46:54Z
3
+ - **Last updated**: 2022-12-16T12:52:26Z
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.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  <!-- This file is generated - DO NOT EDIT! -->
2
2
 
3
- # ![webgl](https://media.thi.ng/umbrella/banners-20220914/thing-webgl.svg?f7d7962f)
3
+ # ![@thi.ng/webgl](https://media.thi.ng/umbrella/banners-20220914/thing-webgl.svg?f7d7962f)
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@thi.ng/webgl.svg)](https://www.npmjs.com/package/@thi.ng/webgl)
6
6
  ![npm downloads](https://img.shields.io/npm/dm/@thi.ng/webgl.svg)
7
- [![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
7
+ [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](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,14 +91,11 @@ ES module import:
93
91
 
94
92
  For Node.js REPL:
95
93
 
96
- ```text
97
- # with flag only for < v16
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
- Package sizes (gzipped, pre-treeshake): ESM: 12.46 KB
98
+ Package sizes (brotli'd, pre-treeshake): ESM: 11.23 KB
104
99
 
105
100
  ## Dependencies
106
101
 
@@ -156,12 +151,7 @@ TODO
156
151
 
157
152
  ## Authors
158
153
 
159
- ### Maintainer
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
- &copy; 2014 - 2022 Karsten Schmidt // Apache Software License 2.0
171
+ &copy; 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 declare type BlendFunc = Tuple<Blend, 2>;
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 declare type IndexBufferData = Uint16Array | Uint32Array;
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 declare type ExtensionName = keyof WebGLExtensionMap;
41
- export declare type ExtensionBehavior = "require" | "warn" | boolean;
42
- export declare type ExtensionBehaviors = Partial<Record<keyof WebGLExtensionMap, ExtensionBehavior>>;
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 declare type GLSL = Type;
4
- export declare type GLVec = number[] | Float32Array;
5
- export declare type GLVec2 = Tuple<number, 2> | Float32Array;
6
- export declare type GLVec3 = Tuple<number, 3> | Float32Array;
7
- export declare type GLVec4 = Tuple<number, 4> | Float32Array;
8
- export declare type GLIntVec = number[] | Int32Array;
9
- export declare type GLUintVec = number[] | Uint32Array;
10
- export declare type GLIntVec2 = Tuple<number, 2> | Int32Array;
11
- export declare type GLIntVec3 = Tuple<number, 3> | Int32Array;
12
- export declare type GLIntVec4 = Tuple<number, 4> | Int32Array;
13
- export declare type GLMat2 = Tuple<number, 4> | Float32Array;
14
- export declare type GLMat3 = Tuple<number, 9> | Float32Array;
15
- export declare type GLMat4 = Tuple<number, 16> | Float32Array;
16
- export declare type GLMat23 = Tuple<number, 6> | Float32Array;
17
- export declare type GLMat24 = Tuple<number, 8> | Float32Array;
18
- export declare type GLMat34 = Tuple<number, 12> | Float32Array;
19
- export declare type GLSLScalarType = "bool" | "float" | "int" | "uint" | "sampler2D" | "samplerCube";
20
- export declare type GLSLArrayType = "bool[]" | "int[]" | "uint[]" | "float[]" | "bvec2[]" | "bvec3[]" | "bvec4[]" | "ivec2[]" | "ivec3[]" | "ivec4[]" | "uvec2[]" | "uvec3[]" | "uvec4[]" | "vec2[]" | "vec3[]" | "vec4[]" | "mat2[]" | "mat3[]" | "mat4[]" | "sampler2D[]" | "sampler3D[]" | "samplerCube[]";
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 declare type ModelAttributeSpecs = IObjectOf<ModelAttributeSpec>;
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 declare type ShaderType = "vs" | "fs";
24
- export declare type AttribType = "bool" | "float" | "int" | "vec2" | "vec3" | "vec4";
25
- export declare type AttribBufferData = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Float32Array;
26
- export declare type UniformValue = number | NumericArray;
27
- export declare type UniformValues = IObjectOf<UniformValue | Fn2<ShaderUniforms, any, UniformValue> | IDeref<UniformValue>>;
28
- export declare type UniformDefault<T> = T | Fn2<ShaderUniforms, IObjectOf<number | ReadonlyVec>, T>;
29
- export declare 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>?];
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 declare type ShaderAttribSpecs = IObjectOf<ShaderAttribSpec>;
34
- export declare type ShaderAttribSpec = AttribType | [AttribType, number];
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 declare type ShaderAttribs = IObjectOf<ShaderAttrib>;
38
+ export type ShaderAttribs = IObjectOf<ShaderAttrib>;
39
39
  export interface ShaderAttrib {
40
40
  type: AttribType;
41
41
  loc: number;
42
42
  }
43
- export declare type ShaderVaryingSpecs = IObjectOf<ShaderVaryingSpec>;
44
- export declare type ShaderVaryingSpec = GLSL | [GLSLArrayType, number];
45
- export declare type ShaderUniformSpecs = IObjectOf<UniformDecl>;
46
- export declare type ShaderUniforms = IObjectOf<ShaderUniform>;
47
- export declare type ShaderOutputSpecs = IObjectOf<ShaderOutputSpec>;
48
- export declare type ShaderOutputSpec = GLSL | [GLSL, number];
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 declare type ShaderFn = Fn4<GLSLTarget, IObjectOf<Sym<any>>, // uni
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 declare type StencilOpParams = Tuple<StencilOp, 3>;
23
- export declare type StencilFnParams = [StencilFn, number, number];
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 declare type ReadableTextureFormat = TextureFormat.ALPHA | TextureFormat.RED | TextureFormat.RG | TextureFormat.RGB | TextureFormat.RGBA | TextureFormat.RED_INTEGER | TextureFormat.RG_INTEGER | TextureFormat.RGB_INTEGER | TextureFormat.RGBA_INTEGER;
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.15",
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 <k+npm@thi.ng>",
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.2",
38
- "@thi.ng/api": "^8.5.0",
39
- "@thi.ng/associative": "^6.2.17",
40
- "@thi.ng/checks": "^3.3.3",
41
- "@thi.ng/equiv": "^2.1.13",
42
- "@thi.ng/errors": "^2.2.4",
43
- "@thi.ng/logger": "^1.4.3",
44
- "@thi.ng/matrices": "^2.1.34",
45
- "@thi.ng/memoize": "^3.1.17",
46
- "@thi.ng/pixel": "^4.0.9",
47
- "@thi.ng/shader-ast": "^0.12.31",
48
- "@thi.ng/shader-ast-glsl": "^0.4.31",
49
- "@thi.ng/shader-ast-stdlib": "^0.12.24",
50
- "@thi.ng/transducers": "^8.3.24",
51
- "@thi.ng/vector-pools": "^3.1.35",
52
- "@thi.ng/vectors": "^7.5.25"
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.5",
56
- "@thi.ng/testament": "^0.3.5",
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.20",
60
- "typescript": "^4.8.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": "75ec32ff7f1b7b5e72e7a04ace24732cd5d6c774\n"
222
+ "gitHead": "f445a9cc8022bcdebbf6ff91fd66ced016d72f01\n"
219
223
  }
@@ -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 declare type PhongOpts = ShaderPresetOpts<Pick<Material, "ambientCol" | "diffuseCol" | "specularCol">>;
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