@thi.ng/webgl 6.8.10 → 6.8.12
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 +4 -4
- package/api/shader.d.ts +2 -2
- package/buffer.d.ts +2 -2
- package/package.json +18 -18
- package/readpixels.d.ts +1 -1
- package/shader.js +5 -7
- package/texture.d.ts +2 -1
- package/uniforms.d.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-04-
|
|
3
|
+
- **Last updated**: 2024-04-20T14:42:45Z
|
|
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.8.12](https://github.com/thi-ng/umbrella/tree/@thi.ng/webgl@6.8.12) (2024-04-20)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- update type usage ([f584c7c](https://github.com/thi-ng/umbrella/commit/f584c7c))
|
|
17
|
+
|
|
12
18
|
## [6.8.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/webgl@6.8.0) (2024-03-09)
|
|
13
19
|
|
|
14
20
|
#### 🚀 Features
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 192 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
|
@@ -95,12 +95,12 @@ import * as gl from "@thi.ng/webgl";
|
|
|
95
95
|
Browser ESM import:
|
|
96
96
|
|
|
97
97
|
```html
|
|
98
|
-
<script type="module" src="https://
|
|
98
|
+
<script type="module" src="https://esm.run/@thi.ng/webgl"></script>
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
[
|
|
101
|
+
[JSDelivr documentation](https://www.jsdelivr.com/)
|
|
102
102
|
|
|
103
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 11.
|
|
103
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 11.66 KB
|
|
104
104
|
|
|
105
105
|
## Dependencies
|
|
106
106
|
|
package/api/shader.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Fn, Fn2, Fn3, Fn4, IBind, IDeref, IObjectOf, IRelease, NumericArray } from "@thi.ng/api";
|
|
1
|
+
import type { Fn, Fn2, Fn3, Fn4, IBind, IDeref, IObjectOf, IRelease, Nullable, NumericArray } from "@thi.ng/api";
|
|
2
2
|
import type { ILogger } from "@thi.ng/logger";
|
|
3
3
|
import type { Func, Sym } from "@thi.ng/shader-ast";
|
|
4
4
|
import type { GLSLTarget } from "@thi.ng/shader-ast-glsl";
|
|
@@ -50,7 +50,7 @@ export type ShaderOutputSpec = GLSL | [GLSL, number];
|
|
|
50
50
|
export interface ShaderUniform {
|
|
51
51
|
type: GLSL;
|
|
52
52
|
loc: WebGLUniformLocation;
|
|
53
|
-
setter: Fn<UniformValue
|
|
53
|
+
setter: Fn<Nullable<UniformValue>, void>;
|
|
54
54
|
defaultFn?: (shaderUnis: any, specUnis: any) => UniformValue;
|
|
55
55
|
defaultVal?: UniformValue;
|
|
56
56
|
}
|
package/buffer.d.ts
CHANGED
|
@@ -24,9 +24,9 @@ export declare class WebGLArrayBuffer<T extends TypedArray> implements IWebGLBuf
|
|
|
24
24
|
set(data: T, mode?: number): void;
|
|
25
25
|
setChunk(data: T, byteOffset?: number): void;
|
|
26
26
|
}
|
|
27
|
-
export declare const defBuffer: (gl: WebGLRenderingContext, data?: TypedArray, target?: GLenum, mode?: GLenum, retain?: boolean) => WebGLArrayBuffer<
|
|
27
|
+
export declare const defBuffer: (gl: WebGLRenderingContext, data?: TypedArray, target?: GLenum, mode?: GLenum, retain?: boolean) => WebGLArrayBuffer<Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array>;
|
|
28
28
|
export declare const compileModel: (gl: WebGLRenderingContext, spec: ModelSpec, mode?: 35044) => ModelSpec;
|
|
29
|
-
export declare const compileIndices: (gl: WebGLRenderingContext, index
|
|
29
|
+
export declare const compileIndices: (gl: WebGLRenderingContext, index?: IndexBufferSpec, mode?: GLenum) => IndexBufferSpec | undefined;
|
|
30
30
|
export declare const compileVAO: (gl: WebGLRenderingContext, spec: ModelSpec) => WebGLVertexArrayObject | undefined;
|
|
31
31
|
export declare const compileAttribPool: (gl: WebGLRenderingContext, pool: AttribPool, ids?: string[], target?: GLenum, mode?: GLenum) => ModelAttributeSpecs;
|
|
32
32
|
//# sourceMappingURL=buffer.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/webgl",
|
|
3
|
-
"version": "6.8.
|
|
3
|
+
"version": "6.8.12",
|
|
4
4
|
"description": "WebGL & GLSL abstraction layer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -40,22 +40,22 @@
|
|
|
40
40
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@thi.ng/api": "^8.
|
|
44
|
-
"@thi.ng/associative": "^6.3.
|
|
45
|
-
"@thi.ng/canvas": "^0.2.
|
|
46
|
-
"@thi.ng/checks": "^3.6.
|
|
47
|
-
"@thi.ng/equiv": "^2.1.
|
|
48
|
-
"@thi.ng/errors": "^2.5.
|
|
49
|
-
"@thi.ng/logger": "^3.0.
|
|
50
|
-
"@thi.ng/matrices": "^2.3.
|
|
51
|
-
"@thi.ng/memoize": "^3.3.
|
|
52
|
-
"@thi.ng/pixel": "^6.1.
|
|
53
|
-
"@thi.ng/shader-ast": "^0.15.
|
|
54
|
-
"@thi.ng/shader-ast-glsl": "^0.4.
|
|
55
|
-
"@thi.ng/shader-ast-stdlib": "^0.18.
|
|
56
|
-
"@thi.ng/transducers": "^9.0.
|
|
57
|
-
"@thi.ng/vector-pools": "^3.1.
|
|
58
|
-
"@thi.ng/vectors": "^7.10.
|
|
43
|
+
"@thi.ng/api": "^8.11.0",
|
|
44
|
+
"@thi.ng/associative": "^6.3.57",
|
|
45
|
+
"@thi.ng/canvas": "^0.2.17",
|
|
46
|
+
"@thi.ng/checks": "^3.6.2",
|
|
47
|
+
"@thi.ng/equiv": "^2.1.56",
|
|
48
|
+
"@thi.ng/errors": "^2.5.5",
|
|
49
|
+
"@thi.ng/logger": "^3.0.10",
|
|
50
|
+
"@thi.ng/matrices": "^2.3.34",
|
|
51
|
+
"@thi.ng/memoize": "^3.3.2",
|
|
52
|
+
"@thi.ng/pixel": "^6.1.29",
|
|
53
|
+
"@thi.ng/shader-ast": "^0.15.12",
|
|
54
|
+
"@thi.ng/shader-ast-glsl": "^0.4.120",
|
|
55
|
+
"@thi.ng/shader-ast-stdlib": "^0.18.12",
|
|
56
|
+
"@thi.ng/transducers": "^9.0.2",
|
|
57
|
+
"@thi.ng/vector-pools": "^3.1.126",
|
|
58
|
+
"@thi.ng/vectors": "^7.10.28"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@microsoft/api-extractor": "^7.43.0",
|
|
@@ -221,5 +221,5 @@
|
|
|
221
221
|
],
|
|
222
222
|
"year": 2014
|
|
223
223
|
},
|
|
224
|
-
"gitHead": "
|
|
224
|
+
"gitHead": "8339d05ecc857e529c7325a9839c0063b89e728d\n"
|
|
225
225
|
}
|
package/readpixels.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UIntArray } from "@thi.ng/api";
|
|
2
2
|
import type { ITexture, ReadableTextureFormat, TextureType } from "./api/texture.js";
|
|
3
3
|
export declare const readPixels: <T extends Float32Array | UIntArray>(gl: WebGLRenderingContext, x: number, y: number, w: number, h: number, format: ReadableTextureFormat, type: TextureType, out: T) => T;
|
|
4
|
-
export declare const readTexture: <T extends Uint8Array | Uint16Array | Uint32Array
|
|
4
|
+
export declare const readTexture: <T extends Float32Array | Uint8Array | Uint16Array | Uint32Array>(gl: WebGLRenderingContext, tex: ITexture, format: ReadableTextureFormat, type: TextureType, out: T) => T;
|
|
5
5
|
//# sourceMappingURL=readpixels.d.ts.map
|
package/shader.js
CHANGED
|
@@ -170,7 +170,7 @@ const defShader = (gl, spec, opts) => {
|
|
|
170
170
|
const logger = opts?.logger || LOGGER;
|
|
171
171
|
logger.debug(srcVS);
|
|
172
172
|
logger.debug(srcFS);
|
|
173
|
-
initShaderExtensions(gl, spec.ext);
|
|
173
|
+
spec.ext && initShaderExtensions(gl, spec.ext);
|
|
174
174
|
const vs = compileShader(gl, gl.VERTEX_SHADER, srcVS);
|
|
175
175
|
const fs = compileShader(gl, gl.FRAGMENT_SHADER, srcFS);
|
|
176
176
|
const program2 = gl.createProgram() || error("error creating shader program");
|
|
@@ -203,12 +203,10 @@ const compileExtensionPragma = (id, behavior, version) => {
|
|
|
203
203
|
` : "";
|
|
204
204
|
};
|
|
205
205
|
const initShaderExtensions = (gl, exts) => {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
getExtensions(gl, [id], state === "require");
|
|
211
|
-
}
|
|
206
|
+
for (let id in exts) {
|
|
207
|
+
const state = exts[id];
|
|
208
|
+
if (state === true || state === "require") {
|
|
209
|
+
getExtensions(gl, [id], state === "require");
|
|
212
210
|
}
|
|
213
211
|
}
|
|
214
212
|
};
|
package/texture.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Nullable } from "@thi.ng/api";
|
|
1
2
|
import { TextureFilter, TextureFormat, TextureRepeat, TextureTarget, TextureType, type ITexture, type TextureOpts } from "./api/texture.js";
|
|
2
3
|
export declare const bindTextures: (textures?: ITexture[]) => void;
|
|
3
4
|
export declare const unbindTextures: (textures?: ITexture[]) => void;
|
|
@@ -59,5 +60,5 @@ export declare const defTextureCubeMap: (gl: WebGLRenderingContext, faces: (Arra
|
|
|
59
60
|
* @param format -
|
|
60
61
|
* @param type -
|
|
61
62
|
*/
|
|
62
|
-
export declare const defTextureFloat: (gl: WebGLRenderingContext, data: Float32Array
|
|
63
|
+
export declare const defTextureFloat: (gl: WebGLRenderingContext, data: Nullable<Float32Array>, width: number, height: number, format?: TextureFormat, type?: TextureType) => Texture;
|
|
63
64
|
//# sourceMappingURL=texture.d.ts.map
|
package/uniforms.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Fn, Fn3, IObjectOf } from "@thi.ng/api";
|
|
1
|
+
import type { Fn, Fn3, IObjectOf, Maybe, Nullable } from "@thi.ng/api";
|
|
2
2
|
import { type ReadonlyVec } from "@thi.ng/vectors/api";
|
|
3
3
|
import type { UniformValue } from "./api/shader.js";
|
|
4
|
-
export declare const UNIFORM_SETTERS: IObjectOf<Fn3<WebGLRenderingContext, WebGLUniformLocation, number | ReadonlyVec
|
|
4
|
+
export declare const UNIFORM_SETTERS: IObjectOf<Fn3<WebGLRenderingContext, WebGLUniformLocation, Maybe<number | ReadonlyVec>, Fn<Nullable<UniformValue>, void>>>;
|
|
5
5
|
//# sourceMappingURL=uniforms.d.ts.map
|