@thi.ng/shader-ast-stdlib 0.12.26 → 0.12.27

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-12-16T12:52:25Z
3
+ - **Last updated**: 2022-12-20T16:33:12Z
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.
@@ -2,14 +2,13 @@ import type { Fn2 } from "@thi.ng/api";
2
2
  import type { FloatTerm } from "@thi.ng/shader-ast";
3
3
  /**
4
4
  * Higher-order Porter-Duff alpha compositing operator. See
5
- * {@link @thi.ng/porter-duff# | @thi.ng/porter-duff} for reference. Returns an optimized AST
6
- * function which accepts 2 RGBA colors (vec4) and returns blended &
7
- * clamped result (also a vec4). All built-in PD operators are defined
8
- * via this HOF.
5
+ * [thi.ng/porter-duff](https://thi.ng/porter-duff) for reference. Returns an
6
+ * optimized AST function which accepts 2 RGBA colors (vec4) and returns blended
7
+ * & clamped result (also a vec4). All built-in PD operators are defined via
8
+ * this HOF.
9
9
  *
10
- * The two given JS functions are used to extract blending coefficients
11
- * for src/dest colors and are called with the alpha components of both
12
- * colors.
10
+ * The two given JS functions are used to extract blending coefficients for
11
+ * src/dest colors and are called with the alpha components of both colors.
13
12
  *
14
13
  * Optimization only happens for cases where either `fa` and/or `fb` are
15
14
  * {@link ZERO}.
@@ -6,14 +6,13 @@ import { clamp01 } from "../math/clamp.js";
6
6
  const coeff = (f, a, b) => (f === ZERO ? FLOAT0 : f === ONE ? a : mul(a, f($w(a), $w(b))));
7
7
  /**
8
8
  * Higher-order Porter-Duff alpha compositing operator. See
9
- * {@link @thi.ng/porter-duff# | @thi.ng/porter-duff} for reference. Returns an optimized AST
10
- * function which accepts 2 RGBA colors (vec4) and returns blended &
11
- * clamped result (also a vec4). All built-in PD operators are defined
12
- * via this HOF.
9
+ * [thi.ng/porter-duff](https://thi.ng/porter-duff) for reference. Returns an
10
+ * optimized AST function which accepts 2 RGBA colors (vec4) and returns blended
11
+ * & clamped result (also a vec4). All built-in PD operators are defined via
12
+ * this HOF.
13
13
  *
14
- * The two given JS functions are used to extract blending coefficients
15
- * for src/dest colors and are called with the alpha components of both
16
- * colors.
14
+ * The two given JS functions are used to extract blending coefficients for
15
+ * src/dest colors and are called with the alpha components of both colors.
17
16
  *
18
17
  * Optimization only happens for cases where either `fa` and/or `fb` are
19
18
  * {@link ZERO}.
package/fog/exp2.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  /**
2
- * Similar to {@link fogExp}. Computes exponential fog factor [0..1],
3
- * based on given fully saturated fog distance and density. Uses
4
- * {@link @thi.ng/shader-ast#exp2} internally.
2
+ * Similar to {@link fogExp}. Computes exponential fog factor [0..1], based on
3
+ * given fully saturated fog distance and density. Uses
4
+ * [`exp2()`](https://docs.thi.ng/umbrella/shader-ast/functions/exp2.html)
5
+ * internally.
5
6
  *
6
7
  * @param dist - float
7
8
  * @param density - float
package/fog/exp2.js CHANGED
@@ -5,9 +5,10 @@ import { mul, sub } from "@thi.ng/shader-ast/ast/ops";
5
5
  import { exp2 } from "@thi.ng/shader-ast/builtin/math";
6
6
  import { clamp01 } from "../math/clamp.js";
7
7
  /**
8
- * Similar to {@link fogExp}. Computes exponential fog factor [0..1],
9
- * based on given fully saturated fog distance and density. Uses
10
- * {@link @thi.ng/shader-ast#exp2} internally.
8
+ * Similar to {@link fogExp}. Computes exponential fog factor [0..1], based on
9
+ * given fully saturated fog distance and density. Uses
10
+ * [`exp2()`](https://docs.thi.ng/umbrella/shader-ast/functions/exp2.html)
11
+ * internally.
11
12
  *
12
13
  * @param dist - float
13
14
  * @param density - float
@@ -1,7 +1,7 @@
1
1
  import type { FloatTerm, Vec3Term } from "@thi.ng/shader-ast";
2
2
  /**
3
- * Inline function. Computes Lambert term, i.e. `max(dot(n, l), 0)`.
4
- * Both vectors must be pre-normalized.
3
+ * Inline function. Computes Lambert term, i.e. `max(dot(n, l), 0)`. Both
4
+ * vectors must be pre-normalized.
5
5
  *
6
6
  * @param surfNormal - vec3
7
7
  * @param lightDir - vec3
@@ -11,7 +11,7 @@ export declare const lambert: (n: Vec3Term, ldir: Vec3Term) => import("@thi.ng/s
11
11
  * Inline function. Computes Half-Lambertian term. Both vectors must be
12
12
  * pre-normalized.
13
13
  *
14
- * {@link https://developer.valvesoftware.com/wiki/Half_Lambert}
14
+ * https://developer.valvesoftware.com/wiki/Half_Lambert
15
15
  *
16
16
  * @param n -
17
17
  * @param ldir -
package/light/lambert.js CHANGED
@@ -3,8 +3,8 @@ import { madd, mul } from "@thi.ng/shader-ast/ast/ops";
3
3
  import { dot, max } from "@thi.ng/shader-ast/builtin/math";
4
4
  import { fit1101 } from "../math/fit.js";
5
5
  /**
6
- * Inline function. Computes Lambert term, i.e. `max(dot(n, l), 0)`.
7
- * Both vectors must be pre-normalized.
6
+ * Inline function. Computes Lambert term, i.e. `max(dot(n, l), 0)`. Both
7
+ * vectors must be pre-normalized.
8
8
  *
9
9
  * @param surfNormal - vec3
10
10
  * @param lightDir - vec3
@@ -14,7 +14,7 @@ export const lambert = (n, ldir) => max(dot(n, ldir), FLOAT0);
14
14
  * Inline function. Computes Half-Lambertian term. Both vectors must be
15
15
  * pre-normalized.
16
16
  *
17
- * {@link https://developer.valvesoftware.com/wiki/Half_Lambert}
17
+ * https://developer.valvesoftware.com/wiki/Half_Lambert
18
18
  *
19
19
  * @param n -
20
20
  * @param ldir -
@@ -1,14 +1,14 @@
1
1
  import type { Vec2Term } from "@thi.ng/shader-ast";
2
2
  /**
3
- * Inline function. Returns counter-clockwise perpendicular vector
4
- * (assuming Y-up). [-y, x]
3
+ * Inline function. Returns counter-clockwise perpendicular vector (assuming
4
+ * Y-up). [-y, x]
5
5
  *
6
6
  * @param v -
7
7
  */
8
8
  export declare const perpendicularCCW: (v: Vec2Term) => import("@thi.ng/shader-ast").Lit<"vec2">;
9
9
  /**
10
- * Inline function. Returns clockwise perpendicular vector (assuming
11
- * Y-up). [y,-x]
10
+ * Inline function. Returns clockwise perpendicular vector (assuming Y-up).
11
+ * [y,-x]
12
12
  *
13
13
  * @param v -
14
14
  */
@@ -16,7 +16,7 @@ export declare const perpendicularCW: (v: Vec2Term) => import("@thi.ng/shader-as
16
16
  /**
17
17
  * Returns an orthogonal vector to `v`.
18
18
  *
19
- * {@link http://lolengine.net/blog/2013/09/21/picking-orthogonal-vector-combing-coconuts}
19
+ * http://lolengine.net/blog/2013/09/21/picking-orthogonal-vector-combing-coconuts
20
20
  */
21
21
  export declare const orthogonal3: import("@thi.ng/shader-ast").TaggedFn1<"vec3", "vec3">;
22
22
  //# sourceMappingURL=orthogonal.d.ts.map
@@ -5,15 +5,15 @@ import { gt, neg } from "@thi.ng/shader-ast/ast/ops";
5
5
  import { $x, $y, $z } from "@thi.ng/shader-ast/ast/swizzle";
6
6
  import { abs } from "@thi.ng/shader-ast/builtin/math";
7
7
  /**
8
- * Inline function. Returns counter-clockwise perpendicular vector
9
- * (assuming Y-up). [-y, x]
8
+ * Inline function. Returns counter-clockwise perpendicular vector (assuming
9
+ * Y-up). [-y, x]
10
10
  *
11
11
  * @param v -
12
12
  */
13
13
  export const perpendicularCCW = (v) => vec2(neg($y(v)), $x(v));
14
14
  /**
15
- * Inline function. Returns clockwise perpendicular vector (assuming
16
- * Y-up). [y,-x]
15
+ * Inline function. Returns clockwise perpendicular vector (assuming Y-up).
16
+ * [y,-x]
17
17
  *
18
18
  * @param v -
19
19
  */
@@ -21,7 +21,7 @@ export const perpendicularCW = (v) => vec2($y(v), neg($x(v)));
21
21
  /**
22
22
  * Returns an orthogonal vector to `v`.
23
23
  *
24
- * {@link http://lolengine.net/blog/2013/09/21/picking-orthogonal-vector-combing-coconuts}
24
+ * http://lolengine.net/blog/2013/09/21/picking-orthogonal-vector-combing-coconuts
25
25
  */
26
26
  export const orthogonal3 = defn("vec3", "orthogonal3", ["vec3"], (v) => [
27
27
  ret(ternary(gt(abs($x(v)), abs($z(v))), vec3(neg($y(v)), $x(v), 0), vec3(0, neg($z(v)), $y(v)))),
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Array and textureless GLSL 2D simplex noise function. Ported from
3
- * original GLSL implementation by Ian McEwan & Ashima Arts.
2
+ * Array and textureless GLSL 2D simplex noise function. Ported from original
3
+ * GLSL implementation by Ian McEwan & Ashima Arts.
4
4
  *
5
- * {@link https://github.com/ashima/webgl-noise}
5
+ * https://github.com/ashima/webgl-noise
6
6
  */
7
7
  export declare const snoise2: import("@thi.ng/shader-ast").TaggedFn1<"vec2", "float">;
8
8
  //# sourceMappingURL=simplex2.d.ts.map
package/noise/simplex2.js CHANGED
@@ -9,10 +9,10 @@ import { abs, dot, floor, fract, max, mod, } from "@thi.ng/shader-ast/builtin/ma
9
9
  import { magSq2 } from "../math/magsq.js";
10
10
  import { permute3 } from "./permute.js";
11
11
  /**
12
- * Array and textureless GLSL 2D simplex noise function. Ported from
13
- * original GLSL implementation by Ian McEwan & Ashima Arts.
12
+ * Array and textureless GLSL 2D simplex noise function. Ported from original
13
+ * GLSL implementation by Ian McEwan & Ashima Arts.
14
14
  *
15
- * {@link https://github.com/ashima/webgl-noise}
15
+ * https://github.com/ashima/webgl-noise
16
16
  */
17
17
  export const snoise2 = defn("float", "snoise2", ["vec2"], (v) => {
18
18
  let C;
@@ -7,7 +7,7 @@
7
7
  * - perlin noise (0,1)
8
8
  * - voronoise (1,1)
9
9
  *
10
- * {@link http://www.iquilezles.org/www/articles/voronoise/voronoise.htm}
10
+ * http://www.iquilezles.org/www/articles/voronoise/voronoise.htm
11
11
  *
12
12
  * Note: This implementation uses the improved {@link hash32} by Dave Hoskins
13
13
  * instead of iq's original {@link hash3}.
package/noise/voronoi2.js CHANGED
@@ -16,7 +16,7 @@ import { hash32 } from "./hash.js";
16
16
  * - perlin noise (0,1)
17
17
  * - voronoise (1,1)
18
18
  *
19
- * {@link http://www.iquilezles.org/www/articles/voronoise/voronoise.htm}
19
+ * http://www.iquilezles.org/www/articles/voronoise/voronoise.htm
20
20
  *
21
21
  * Note: This implementation uses the improved {@link hash32} by Dave Hoskins
22
22
  * instead of iq's original {@link hash3}.
@@ -10,7 +10,7 @@ export declare const worleyDistManhattan: import("@thi.ng/shader-ast").TaggedFn2
10
10
  * can be used individually or combined (e.g. `noise.y - noise.x`)...
11
11
  *
12
12
  * Based on implementation by Stefan Gustavson:
13
- * {@link http://webstaff.itn.liu.se/~stegu/GLSL-cellular/GLSL-cellular-notes.pdf}
13
+ * http://webstaff.itn.liu.se/~stegu/GLSL-cellular/GLSL-cellular-notes.pdf
14
14
  *
15
15
  * @param distFn -
16
16
  */
package/noise/worley2.js CHANGED
@@ -18,7 +18,7 @@ export const worleyDistManhattan = defn("vec3", "worleyDistManhatten", ["vec3",
18
18
  * can be used individually or combined (e.g. `noise.y - noise.x`)...
19
19
  *
20
20
  * Based on implementation by Stefan Gustavson:
21
- * {@link http://webstaff.itn.liu.se/~stegu/GLSL-cellular/GLSL-cellular-notes.pdf}
21
+ * http://webstaff.itn.liu.se/~stegu/GLSL-cellular/GLSL-cellular-notes.pdf
22
22
  *
23
23
  * @param distFn -
24
24
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/shader-ast-stdlib",
3
- "version": "0.12.26",
3
+ "version": "0.12.27",
4
4
  "description": "Function collection for modular GPGPU / shader programming with @thi.ng/shader-ast",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -34,8 +34,8 @@
34
34
  "test": "testament test"
35
35
  },
36
36
  "dependencies": {
37
- "@thi.ng/api": "^8.6.0",
38
- "@thi.ng/shader-ast": "^0.12.33"
37
+ "@thi.ng/api": "^8.6.1",
38
+ "@thi.ng/shader-ast": "^0.12.34"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@microsoft/api-extractor": "^7.33.7",
@@ -330,5 +330,5 @@
330
330
  ],
331
331
  "year": 2019
332
332
  },
333
- "gitHead": "f445a9cc8022bcdebbf6ff91fd66ced016d72f01\n"
333
+ "gitHead": "7b2af448da8a63fb21704a79cc4cdf1f3d7d7a64\n"
334
334
  }
package/tex/blur.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * 5x5 gaussian blur texture lookup, optimized, but based on:
3
3
  *
4
- * - {@link http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/}
5
- * - {@link https://github.com/Jam3/glsl-fast-gaussian-blur}
4
+ * - http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/
5
+ * - https://github.com/Jam3/glsl-fast-gaussian-blur
6
6
  *
7
7
  * @param tex - sampler2D
8
8
  * @param res - resolution
@@ -13,8 +13,8 @@ export declare const blur5: import("@thi.ng/shader-ast").TaggedFn4<"sampler2D",
13
13
  /**
14
14
  * 9x9 gaussian blur texture lookup, optimized, but based on:
15
15
  *
16
- * - {@link http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/}
17
- * - {@link https://github.com/Jam3/glsl-fast-gaussian-blur}
16
+ * - http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/
17
+ * - https://github.com/Jam3/glsl-fast-gaussian-blur
18
18
  *
19
19
  * @param tex - sampler2D
20
20
  * @param res - resolution
@@ -25,8 +25,8 @@ export declare const blur9: import("@thi.ng/shader-ast").TaggedFn4<"sampler2D",
25
25
  /**
26
26
  * 13x13 gaussian blur texture lookup, optimized, but based on:
27
27
  *
28
- * - {@link http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/}
29
- * - {@link https://github.com/Jam3/glsl-fast-gaussian-blur}
28
+ * - http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/
29
+ * - https://github.com/Jam3/glsl-fast-gaussian-blur
30
30
  *
31
31
  * @param tex - sampler2D
32
32
  * @param res - resolution
package/tex/blur.js CHANGED
@@ -18,8 +18,8 @@ const singlePass = (col, tex, uv, off, k) => assign(col, add(col, mul(add(textur
18
18
  /**
19
19
  * 5x5 gaussian blur texture lookup, optimized, but based on:
20
20
  *
21
- * - {@link http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/}
22
- * - {@link https://github.com/Jam3/glsl-fast-gaussian-blur}
21
+ * - http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/
22
+ * - https://github.com/Jam3/glsl-fast-gaussian-blur
23
23
  *
24
24
  * @param tex - sampler2D
25
25
  * @param res - resolution
@@ -41,8 +41,8 @@ export const blur5 = defn("vec4", "blur5", ["sampler2D", "vec2", "vec2", "vec2"]
41
41
  /**
42
42
  * 9x9 gaussian blur texture lookup, optimized, but based on:
43
43
  *
44
- * - {@link http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/}
45
- * - {@link https://github.com/Jam3/glsl-fast-gaussian-blur}
44
+ * - http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/
45
+ * - https://github.com/Jam3/glsl-fast-gaussian-blur
46
46
  *
47
47
  * @param tex - sampler2D
48
48
  * @param res - resolution
@@ -69,8 +69,8 @@ export const blur9 = defn("vec4", "blur9", ["sampler2D", "vec2", "vec2", "vec2"]
69
69
  /**
70
70
  * 13x13 gaussian blur texture lookup, optimized, but based on:
71
71
  *
72
- * - {@link http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/}
73
- * - {@link https://github.com/Jam3/glsl-fast-gaussian-blur}
72
+ * - http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/
73
+ * - https://github.com/Jam3/glsl-fast-gaussian-blur
74
74
  *
75
75
  * @param tex - sampler2D
76
76
  * @param res - resolution