@thi.ng/webgl 6.7.1 → 6.8.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-03-07T20:40:47Z
3
+ - **Last updated**: 2024-03-09T13:46:38Z
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.8.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/webgl@6.8.0) (2024-03-09)
13
+
14
+ #### 🚀 Features
15
+
16
+ - add passCopyMain() multipass spec utility ([ba22536](https://github.com/thi-ng/umbrella/commit/ba22536))
17
+
18
+ #### 🩹 Bug fixes
19
+
20
+ - update readPixels() args ([458e7ff](https://github.com/thi-ng/umbrella/commit/458e7ff))
21
+
12
22
  ## [6.7.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/webgl@6.7.0) (2024-03-06)
13
23
 
14
24
  #### 🚀 Features
package/README.md CHANGED
@@ -100,7 +100,7 @@ For Node.js REPL:
100
100
  const webgl = await import("@thi.ng/webgl");
101
101
  ```
102
102
 
103
- Package sizes (brotli'd, pre-treeshake): ESM: 11.63 KB
103
+ Package sizes (brotli'd, pre-treeshake): ESM: 11.65 KB
104
104
 
105
105
  ## Dependencies
106
106
 
@@ -127,26 +127,27 @@ Several projects in this repo's
127
127
  [/examples](https://github.com/thi-ng/umbrella/tree/develop/examples)
128
128
  directory are using this package:
129
129
 
130
- | Screenshot | Description | Live demo | Source |
131
- |:-----------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------|:----------------------------------------------------------|:---------------------------------------------------------------------------------------|
132
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/shader-ast-easings.png" width="240"/> | Shader-AST meta-programming techniques for animated function plots | [Demo](https://demo.thi.ng/umbrella/shader-ast-easings/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/shader-ast-easings) |
133
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/shader-ast-evo.jpg" width="240"/> | Evolutionary shader generation using genetic programming | [Demo](https://demo.thi.ng/umbrella/shader-ast-evo/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/shader-ast-evo) |
134
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/shader-ast-noise.jpg" width="240"/> | HOF shader procedural noise function composition | [Demo](https://demo.thi.ng/umbrella/shader-ast-noise/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/shader-ast-noise) |
135
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/shader-ast/shader-ast-raymarch.jpg" width="240"/> | WebGL & JS canvas2D raymarch shader cross-compilation | [Demo](https://demo.thi.ng/umbrella/shader-ast-raymarch/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/shader-ast-raymarch) |
136
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/shader-ast-sdf2d.jpg" width="240"/> | WebGL & JS canvas 2D SDF | [Demo](https://demo.thi.ng/umbrella/shader-ast-sdf2d/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/shader-ast-sdf2d) |
137
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/shader-ast-tunnel.jpg" width="240"/> | WebGL & Canvas2D textured tunnel shader | [Demo](https://demo.thi.ng/umbrella/shader-ast-tunnel/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/shader-ast-tunnel) |
138
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/shader-graph.jpg" width="240"/> | Minimal shader graph developed during livestream #2 | [Demo](https://demo.thi.ng/umbrella/shader-graph/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/shader-graph) |
139
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/soa-ecs-100k.png" width="240"/> | Entity Component System w/ 100k 3D particles | [Demo](https://demo.thi.ng/umbrella/soa-ecs/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/soa-ecs) |
140
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-channel-mixer.jpg" width="240"/> | rdom & WebGL-based image channel editor | [Demo](https://demo.thi.ng/umbrella/webgl-channel-mixer/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-channel-mixer) |
141
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-cube.png" width="240"/> | WebGL multi-colored cube mesh | [Demo](https://demo.thi.ng/umbrella/webgl-cube/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-cube) |
142
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-cubemap.jpg" width="240"/> | WebGL cube maps with async texture loading | [Demo](https://demo.thi.ng/umbrella/webgl-cubemap/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-cubemap) |
143
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-float-fbo.jpg" width="240"/> | Drawing to floating point offscreen / multi-pass shader pipeline | [Demo](https://demo.thi.ng/umbrella/webgl-float-fbo/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-float-fbo) |
144
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-game-of-life.png" width="240"/> | Game of Life implemented as WebGL2 multi-pass shader pipeline | [Demo](https://demo.thi.ng/umbrella/webgl-game-of-life/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-game-of-life) |
145
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-grid.jpg" width="240"/> | WebGL instancing, animated grid | [Demo](https://demo.thi.ng/umbrella/webgl-grid/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-grid) |
146
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-msdf.jpg" width="240"/> | WebGL MSDF text rendering & particle system | [Demo](https://demo.thi.ng/umbrella/webgl-msdf/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-msdf) |
147
- | | Minimal multi-pass / GPGPU example | [Demo](https://demo.thi.ng/umbrella/webgl-multipass/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-multipass) |
148
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-shadertoy.jpg" width="240"/> | Shadertoy-like WebGL setup | [Demo](https://demo.thi.ng/umbrella/webgl-shadertoy/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-shadertoy) |
149
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-ssao.jpg" width="240"/> | WebGL screenspace ambient occlusion | [Demo](https://demo.thi.ng/umbrella/webgl-ssao/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-ssao) |
130
+ | Screenshot | Description | Live demo | Source |
131
+ |:-----------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------|:----------------------------------------------------------|:---------------------------------------------------------------------------------------|
132
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/shader-ast-easings.png" width="240"/> | Shader-AST meta-programming techniques for animated function plots | [Demo](https://demo.thi.ng/umbrella/shader-ast-easings/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/shader-ast-easings) |
133
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/shader-ast-evo.jpg" width="240"/> | Evolutionary shader generation using genetic programming | [Demo](https://demo.thi.ng/umbrella/shader-ast-evo/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/shader-ast-evo) |
134
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/shader-ast-noise.jpg" width="240"/> | HOF shader procedural noise function composition | [Demo](https://demo.thi.ng/umbrella/shader-ast-noise/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/shader-ast-noise) |
135
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/shader-ast/shader-ast-raymarch.jpg" width="240"/> | WebGL & JS canvas2D raymarch shader cross-compilation | [Demo](https://demo.thi.ng/umbrella/shader-ast-raymarch/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/shader-ast-raymarch) |
136
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/shader-ast-sdf2d.jpg" width="240"/> | WebGL & JS canvas 2D SDF | [Demo](https://demo.thi.ng/umbrella/shader-ast-sdf2d/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/shader-ast-sdf2d) |
137
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/shader-ast-tunnel.jpg" width="240"/> | WebGL & Canvas2D textured tunnel shader | [Demo](https://demo.thi.ng/umbrella/shader-ast-tunnel/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/shader-ast-tunnel) |
138
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/shader-graph.jpg" width="240"/> | Minimal shader graph developed during livestream #2 | [Demo](https://demo.thi.ng/umbrella/shader-graph/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/shader-graph) |
139
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/soa-ecs-100k.png" width="240"/> | Entity Component System w/ 100k 3D particles | [Demo](https://demo.thi.ng/umbrella/soa-ecs/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/soa-ecs) |
140
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-channel-mixer.jpg" width="240"/> | rdom & WebGL-based image channel editor | [Demo](https://demo.thi.ng/umbrella/webgl-channel-mixer/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-channel-mixer) |
141
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-cube.png" width="240"/> | WebGL multi-colored cube mesh | [Demo](https://demo.thi.ng/umbrella/webgl-cube/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-cube) |
142
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-cubemap.jpg" width="240"/> | WebGL cube maps with async texture loading | [Demo](https://demo.thi.ng/umbrella/webgl-cubemap/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-cubemap) |
143
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-float-fbo.jpg" width="240"/> | Drawing to floating point offscreen / multi-pass shader pipeline | [Demo](https://demo.thi.ng/umbrella/webgl-float-fbo/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-float-fbo) |
144
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-game-of-life.png" width="240"/> | Game of Life implemented as WebGL2 multi-pass shader pipeline | [Demo](https://demo.thi.ng/umbrella/webgl-game-of-life/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-game-of-life) |
145
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-grid.jpg" width="240"/> | WebGL instancing, animated grid | [Demo](https://demo.thi.ng/umbrella/webgl-grid/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-grid) |
146
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-msdf.jpg" width="240"/> | WebGL MSDF text rendering & particle system | [Demo](https://demo.thi.ng/umbrella/webgl-msdf/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-msdf) |
147
+ | | Minimal multi-pass / GPGPU example | [Demo](https://demo.thi.ng/umbrella/webgl-multipass/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-multipass) |
148
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-shadertoy.jpg" width="240"/> | Shadertoy-like WebGL setup | [Demo](https://demo.thi.ng/umbrella/webgl-shadertoy/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-shadertoy) |
149
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-ssao.jpg" width="240"/> | WebGL screenspace ambient occlusion | [Demo](https://demo.thi.ng/umbrella/webgl-ssao/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-ssao) |
150
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-texture-paint.jpg" width="240"/> | Interactively drawing to & reading from a WebGL offscreen render texture | [Demo](https://demo.thi.ng/umbrella/webgl-texture-paint/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-texture-paint) |
150
151
 
151
152
  ## API
152
153
 
package/multipass.d.ts CHANGED
@@ -15,4 +15,5 @@ export declare const defMultiPass: (opts: MultipassOpts) => Multipass;
15
15
  * @param dest -
16
16
  */
17
17
  export declare const passCopy: (src: string[], dest: string[]) => PassOpts;
18
+ export declare const passCopyMain: (src: string) => PassOpts;
18
19
  //# sourceMappingURL=multipass.d.ts.map
package/multipass.js CHANGED
@@ -186,7 +186,20 @@ const passCopy = (src, dest) => {
186
186
  outputs: dest
187
187
  };
188
188
  };
189
+ const passCopyMain = (src) => ({
190
+ fs: (gl, unis, _, outs) => [
191
+ defMain(() => [
192
+ assign(
193
+ outs.fragColor,
194
+ texelFetch(unis.input0, ivec2($xy(gl.gl_FragCoord)), INT0)
195
+ )
196
+ ])
197
+ ],
198
+ inputs: [src],
199
+ outputs: []
200
+ });
189
201
  export {
190
202
  defMultiPass,
191
- passCopy
203
+ passCopy,
204
+ passCopyMain
192
205
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/webgl",
3
- "version": "6.7.1",
3
+ "version": "6.8.1",
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.9.28",
44
- "@thi.ng/associative": "^6.3.46",
45
- "@thi.ng/canvas": "^0.2.9",
43
+ "@thi.ng/api": "^8.9.29",
44
+ "@thi.ng/associative": "^6.3.47",
45
+ "@thi.ng/canvas": "^0.2.11",
46
46
  "@thi.ng/checks": "^3.5.2",
47
47
  "@thi.ng/equiv": "^2.1.51",
48
48
  "@thi.ng/errors": "^2.4.20",
49
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"
50
+ "@thi.ng/matrices": "^2.3.23",
51
+ "@thi.ng/memoize": "^3.1.64",
52
+ "@thi.ng/pixel": "^6.1.18",
53
+ "@thi.ng/shader-ast": "^0.15.2",
54
+ "@thi.ng/shader-ast-glsl": "^0.4.110",
55
+ "@thi.ng/shader-ast-stdlib": "^0.18.2",
56
+ "@thi.ng/transducers": "^8.9.11",
57
+ "@thi.ng/vector-pools": "^3.1.115",
58
+ "@thi.ng/vectors": "^7.10.17"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@microsoft/api-extractor": "^7.40.1",
@@ -220,5 +220,5 @@
220
220
  ],
221
221
  "year": 2014
222
222
  },
223
- "gitHead": "a421058a65ba76608d94129ac29451bfedaf201c\n"
223
+ "gitHead": "0d3bacf526db92363b43e81356e8cef18368272a\n"
224
224
  }
package/readpixels.d.ts CHANGED
@@ -1,4 +1,5 @@
1
+ import type { UIntArray } from "@thi.ng/api";
1
2
  import type { ITexture, ReadableTextureFormat, TextureType } from "./api/texture.js";
2
- export declare const readPixels: <T extends Uint8Array | Uint16Array | Uint32Array | Float32Array>(gl: WebGLRenderingContext, x: number, y: number, w: number, h: number, format: ReadableTextureFormat, type: TextureType, out: T) => T;
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;
3
4
  export declare const readTexture: <T extends Uint8Array | Uint16Array | Uint32Array | Float32Array>(gl: WebGLRenderingContext, tex: ITexture, format: ReadableTextureFormat, type: TextureType, out: T) => T;
4
5
  //# sourceMappingURL=readpixels.d.ts.map