@thi.ng/webgl 6.6.36 → 6.7.1
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 +11 -1
- package/README.md +1 -1
- package/api/multipass.d.ts +3 -0
- package/multipass.js +24 -10
- package/package.json +20 -19
- package/syntax.d.ts +1 -1
- package/syntax.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-03-
|
|
3
|
+
- **Last updated**: 2024-03-07T20:40:47Z
|
|
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,16 @@ 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.7.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/webgl@6.7.0) (2024-03-06)
|
|
13
|
+
|
|
14
|
+
#### 🚀 Features
|
|
15
|
+
|
|
16
|
+
- update shader prelude, add sampler3D default precision ([73d7818](https://github.com/thi-ng/umbrella/commit/73d7818))
|
|
17
|
+
- add `precision lowp sampler3D` to prelude (WebGL2 only)
|
|
18
|
+
- update defMultipass(), add sampler3D support ([3f924cf](https://github.com/thi-ng/umbrella/commit/3f924cf))
|
|
19
|
+
- update texture & shader init
|
|
20
|
+
- update MultipassOpts
|
|
21
|
+
|
|
12
22
|
### [6.6.32](https://github.com/thi-ng/umbrella/tree/@thi.ng/webgl@6.6.32) (2024-02-22)
|
|
13
23
|
|
|
14
24
|
#### ♻️ Refactoring
|
package/README.md
CHANGED
package/api/multipass.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { IObjectOf } from "@thi.ng/api";
|
|
2
2
|
import type { AttribPool } from "@thi.ng/vector-pools";
|
|
3
3
|
import type { IFbo, IndexBufferSpec } from "./buffers.js";
|
|
4
|
+
import type { ExtensionBehaviors } from "./ext.js";
|
|
4
5
|
import type { InstancingSpec, ModelAttributeSpecs, ModelSpec } from "./model.js";
|
|
5
6
|
import type { ShaderAttribSpecs, ShaderFn, ShaderState, ShaderVaryingSpecs, UniformDecl, UniformValues } from "./shader.js";
|
|
6
7
|
import type { ITexture, TextureOpts } from "./texture.js";
|
|
@@ -26,6 +27,7 @@ export interface MultipassOpts {
|
|
|
26
27
|
passes: PassOpts[];
|
|
27
28
|
width: number;
|
|
28
29
|
height: number;
|
|
30
|
+
depth?: number;
|
|
29
31
|
uniforms?: Partial<PassUniforms>;
|
|
30
32
|
uniformVals?: UniformValues;
|
|
31
33
|
}
|
|
@@ -44,6 +46,7 @@ export interface PassOpts {
|
|
|
44
46
|
replacePrelude?: boolean;
|
|
45
47
|
generateDecls?: boolean;
|
|
46
48
|
state?: Partial<ShaderState>;
|
|
49
|
+
ext?: ExtensionBehaviors;
|
|
47
50
|
}
|
|
48
51
|
export interface PassUniforms {
|
|
49
52
|
inputs: never;
|
package/multipass.js
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { assert } from "@thi.ng/errors/assert";
|
|
2
|
-
import { S2D, V2, V4 } from "@thi.ng/shader-ast/api/types";
|
|
2
|
+
import { S2D, S3D, V2, V4 } from "@thi.ng/shader-ast/api/types";
|
|
3
3
|
import { assign } from "@thi.ng/shader-ast/ast/assign";
|
|
4
4
|
import { defMain } from "@thi.ng/shader-ast/ast/function";
|
|
5
5
|
import { INT0, ivec2 } from "@thi.ng/shader-ast/ast/lit";
|
|
6
6
|
import { $xy } from "@thi.ng/shader-ast/ast/swizzle";
|
|
7
7
|
import { texelFetch } from "@thi.ng/shader-ast/builtin/texture";
|
|
8
|
+
import { mapIndexed } from "@thi.ng/transducers";
|
|
8
9
|
import { assocObj } from "@thi.ng/transducers/assoc-obj";
|
|
9
10
|
import { map } from "@thi.ng/transducers/map";
|
|
10
11
|
import { range } from "@thi.ng/transducers/range";
|
|
11
12
|
import { some } from "@thi.ng/transducers/some";
|
|
12
13
|
import { transduce } from "@thi.ng/transducers/transduce";
|
|
14
|
+
import {
|
|
15
|
+
TextureFilter,
|
|
16
|
+
TextureRepeat,
|
|
17
|
+
TextureTarget
|
|
18
|
+
} from "./api/texture.js";
|
|
13
19
|
import { compileModel } from "./buffer.js";
|
|
14
20
|
import { isFloatTexture, isGL2Context } from "./checks.js";
|
|
15
21
|
import { draw } from "./draw.js";
|
|
@@ -87,24 +93,31 @@ const initPasses = (opts, textures) => {
|
|
|
87
93
|
return m;
|
|
88
94
|
});
|
|
89
95
|
};
|
|
96
|
+
const TEX_TYPE_MAP = {
|
|
97
|
+
[TextureTarget.TEXTURE_2D]: S2D,
|
|
98
|
+
[TextureTarget.TEXTURE_3D]: S3D,
|
|
99
|
+
[TextureTarget.TEXTURE_CUBE_MAP]: "samplerCube"
|
|
100
|
+
};
|
|
90
101
|
const initShader = (gl, pass, textures) => {
|
|
91
102
|
const isGL2 = isGL2Context(gl);
|
|
92
|
-
const numIns = pass.inputs.length;
|
|
93
103
|
const numOuts = pass.outputs.length;
|
|
94
|
-
const ext = {};
|
|
104
|
+
const ext = { ...pass.ext };
|
|
95
105
|
const spec = {
|
|
96
106
|
vs: pass.vs || PASSTHROUGH_VS,
|
|
97
107
|
fs: pass.fs,
|
|
98
|
-
attribs: pass.attribs || {
|
|
99
|
-
position: V2
|
|
100
|
-
},
|
|
108
|
+
attribs: pass.attribs || { position: V2 },
|
|
101
109
|
varying: pass.varying,
|
|
102
110
|
uniforms: {
|
|
103
111
|
...pass.uniforms,
|
|
104
112
|
...transduce(
|
|
105
|
-
|
|
113
|
+
mapIndexed(
|
|
114
|
+
(i, id) => [
|
|
115
|
+
`input${i}`,
|
|
116
|
+
[TEX_TYPE_MAP[textures[id].target], i]
|
|
117
|
+
]
|
|
118
|
+
),
|
|
106
119
|
assocObj(),
|
|
107
|
-
|
|
120
|
+
pass.inputs
|
|
108
121
|
)
|
|
109
122
|
},
|
|
110
123
|
outputs: numOuts ? transduce(
|
|
@@ -137,8 +150,9 @@ const initTextures = (opts) => Object.keys(opts.textures).reduce((acc, id) => {
|
|
|
137
150
|
acc[id] = defTexture(opts.gl, {
|
|
138
151
|
width: opts.width,
|
|
139
152
|
height: opts.height,
|
|
140
|
-
|
|
141
|
-
|
|
153
|
+
depth: opts.depth,
|
|
154
|
+
filter: TextureFilter.NEAREST,
|
|
155
|
+
wrap: TextureRepeat.CLAMP,
|
|
142
156
|
image: null,
|
|
143
157
|
...opts.textures[id]
|
|
144
158
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/webgl",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.7.1",
|
|
4
4
|
"description": "WebGL & GLSL abstraction layer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -36,25 +36,26 @@
|
|
|
36
36
|
"doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
|
|
37
37
|
"doc:readme": "bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts",
|
|
38
38
|
"pub": "yarn npm publish --access public",
|
|
39
|
-
"test": "bun test"
|
|
39
|
+
"test": "bun test",
|
|
40
|
+
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
40
41
|
},
|
|
41
42
|
"dependencies": {
|
|
42
|
-
"@thi.ng/api": "^8.9.
|
|
43
|
-
"@thi.ng/associative": "^6.3.
|
|
44
|
-
"@thi.ng/canvas": "^0.2.
|
|
45
|
-
"@thi.ng/checks": "^3.5.
|
|
46
|
-
"@thi.ng/equiv": "^2.1.
|
|
47
|
-
"@thi.ng/errors": "^2.4.
|
|
48
|
-
"@thi.ng/logger": "^3.0.
|
|
49
|
-
"@thi.ng/matrices": "^2.3.
|
|
50
|
-
"@thi.ng/memoize": "^3.1.
|
|
51
|
-
"@thi.ng/pixel": "^6.1.
|
|
52
|
-
"@thi.ng/shader-ast": "^0.
|
|
53
|
-
"@thi.ng/shader-ast-glsl": "^0.4.
|
|
54
|
-
"@thi.ng/shader-ast-stdlib": "^0.
|
|
55
|
-
"@thi.ng/transducers": "^8.9.
|
|
56
|
-
"@thi.ng/vector-pools": "^3.1.
|
|
57
|
-
"@thi.ng/vectors": "^7.10.
|
|
43
|
+
"@thi.ng/api": "^8.9.28",
|
|
44
|
+
"@thi.ng/associative": "^6.3.46",
|
|
45
|
+
"@thi.ng/canvas": "^0.2.9",
|
|
46
|
+
"@thi.ng/checks": "^3.5.2",
|
|
47
|
+
"@thi.ng/equiv": "^2.1.51",
|
|
48
|
+
"@thi.ng/errors": "^2.4.20",
|
|
49
|
+
"@thi.ng/logger": "^3.0.5",
|
|
50
|
+
"@thi.ng/matrices": "^2.3.22",
|
|
51
|
+
"@thi.ng/memoize": "^3.1.63",
|
|
52
|
+
"@thi.ng/pixel": "^6.1.16",
|
|
53
|
+
"@thi.ng/shader-ast": "^0.15.0",
|
|
54
|
+
"@thi.ng/shader-ast-glsl": "^0.4.108",
|
|
55
|
+
"@thi.ng/shader-ast-stdlib": "^0.18.0",
|
|
56
|
+
"@thi.ng/transducers": "^8.9.10",
|
|
57
|
+
"@thi.ng/vector-pools": "^3.1.114",
|
|
58
|
+
"@thi.ng/vectors": "^7.10.16"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
61
|
"@microsoft/api-extractor": "^7.40.1",
|
|
@@ -219,5 +220,5 @@
|
|
|
219
220
|
],
|
|
220
221
|
"year": 2014
|
|
221
222
|
},
|
|
222
|
-
"gitHead": "
|
|
223
|
+
"gitHead": "a421058a65ba76608d94129ac29451bfedaf201c\n"
|
|
223
224
|
}
|
package/syntax.d.ts
CHANGED
|
@@ -26,5 +26,5 @@ export declare const EXPORT_FRAGCOL: (body?: string, out?: string) => string;
|
|
|
26
26
|
/**
|
|
27
27
|
* Default GLSL prelude.
|
|
28
28
|
*/
|
|
29
|
-
export declare const GLSL_HEADER
|
|
29
|
+
export declare const GLSL_HEADER: string;
|
|
30
30
|
//# sourceMappingURL=syntax.d.ts.map
|