@thi.ng/shader-ast-js 1.1.86 → 1.2.0
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 +1 -1
- package/api.d.ts +6 -0
- package/env/float.js +7 -1
- package/env/vec2.js +12 -0
- package/env/vec3.js +12 -0
- package/env/vec4.js +12 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2025-
|
|
3
|
+
- **Last updated**: 2025-05-18T17:03:01Z
|
|
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.
|
|
@@ -11,6 +11,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
11
11
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
12
12
|
and/or version bumps of transitive dependencies.
|
|
13
13
|
|
|
14
|
+
## [1.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/shader-ast-js@1.2.0) (2025-05-18)
|
|
15
|
+
|
|
16
|
+
#### 🚀 Features
|
|
17
|
+
|
|
18
|
+
- add trigonometry builtins ([1653e4f](https://github.com/thi-ng/umbrella/commit/1653e4f))
|
|
19
|
+
|
|
14
20
|
### [1.1.84](https://github.com/thi-ng/umbrella/tree/@thi.ng/shader-ast-js@1.1.84) (2025-04-16)
|
|
15
21
|
|
|
16
22
|
#### ♻️ Refactoring
|
package/README.md
CHANGED
package/api.d.ts
CHANGED
|
@@ -77,11 +77,15 @@ export interface JSBuiltinsBinary<T> {
|
|
|
77
77
|
}
|
|
78
78
|
export interface JSBuiltinsFloat<T> extends JSBuiltinsCommon<T> {
|
|
79
79
|
acos: Fn<T, T>;
|
|
80
|
+
acosh: Fn<T, T>;
|
|
80
81
|
asin: Fn<T, T>;
|
|
82
|
+
asinh: Fn<T, T>;
|
|
81
83
|
atan: Fn<T, T>;
|
|
84
|
+
atanh: Fn<T, T>;
|
|
82
85
|
atannn: Fn2<T, T, T>;
|
|
83
86
|
ceil: Fn<T, T>;
|
|
84
87
|
cos: Fn<T, T>;
|
|
88
|
+
cosh: Fn<T, T>;
|
|
85
89
|
degrees: Fn<T, T>;
|
|
86
90
|
dFdx: Fn<T, T>;
|
|
87
91
|
dFdy: Fn<T, T>;
|
|
@@ -100,10 +104,12 @@ export interface JSBuiltinsFloat<T> extends JSBuiltinsCommon<T> {
|
|
|
100
104
|
pow: Fn2<T, T, T>;
|
|
101
105
|
radians: Fn<T, T>;
|
|
102
106
|
sin: Fn<T, T>;
|
|
107
|
+
sinh: Fn<T, T>;
|
|
103
108
|
smoothstep: Fn3<T, T, T, T>;
|
|
104
109
|
sqrt: Fn<T, T>;
|
|
105
110
|
step: Fn2<T, T, T>;
|
|
106
111
|
tan: Fn<T, T>;
|
|
112
|
+
tanh: Fn<T, T>;
|
|
107
113
|
}
|
|
108
114
|
export interface JSBuiltinsInt<T> extends JSBuiltinsCommon<T>, JSBuiltinsMath<T>, JSBuiltinsBinary<T> {
|
|
109
115
|
modi: Fn2<T, T, T>;
|
package/env/float.js
CHANGED
|
@@ -6,12 +6,16 @@ import { smoothStep, step } from "@thi.ng/math/step";
|
|
|
6
6
|
const FLOAT = {
|
|
7
7
|
abs: Math.abs,
|
|
8
8
|
acos: Math.acos,
|
|
9
|
+
acosh: Math.acosh,
|
|
9
10
|
asin: Math.asin,
|
|
11
|
+
asinh: Math.asinh,
|
|
10
12
|
atan: Math.atan,
|
|
13
|
+
atanh: Math.atanh,
|
|
11
14
|
atannn: Math.atan2,
|
|
12
15
|
ceil: Math.ceil,
|
|
13
16
|
clamp,
|
|
14
17
|
cos: Math.cos,
|
|
18
|
+
cosh: Math.cosh,
|
|
15
19
|
degrees: deg,
|
|
16
20
|
dFdx: () => 0,
|
|
17
21
|
dFdy: () => 0,
|
|
@@ -33,10 +37,12 @@ const FLOAT = {
|
|
|
33
37
|
radians: rad,
|
|
34
38
|
sign: Math.sign,
|
|
35
39
|
sin: Math.sin,
|
|
40
|
+
sinh: Math.sinh,
|
|
36
41
|
smoothstep: smoothStep,
|
|
37
42
|
sqrt: Math.sqrt,
|
|
38
43
|
step,
|
|
39
|
-
tan: Math.tan
|
|
44
|
+
tan: Math.tan,
|
|
45
|
+
tanh: Math.tanh
|
|
40
46
|
};
|
|
41
47
|
export {
|
|
42
48
|
FLOAT
|
package/env/vec2.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { abs2 } from "@thi.ng/vectors/abs";
|
|
2
2
|
import { acos2 } from "@thi.ng/vectors/acos";
|
|
3
|
+
import { acosh2 } from "@thi.ng/vectors/acosh";
|
|
3
4
|
import { add2 } from "@thi.ng/vectors/add";
|
|
4
5
|
import { addN2 } from "@thi.ng/vectors/addn";
|
|
5
6
|
import { ZERO2 } from "@thi.ng/vectors/api";
|
|
6
7
|
import { asin2 } from "@thi.ng/vectors/asin";
|
|
8
|
+
import { asinh2 } from "@thi.ng/vectors/asinh";
|
|
7
9
|
import { atan_2 } from "@thi.ng/vectors/atan";
|
|
8
10
|
import { atan2_2 } from "@thi.ng/vectors/atan2";
|
|
11
|
+
import { atanh_2 } from "@thi.ng/vectors/atanh";
|
|
9
12
|
import { ceil2 } from "@thi.ng/vectors/ceil";
|
|
10
13
|
import { clamp2 } from "@thi.ng/vectors/clamp";
|
|
11
14
|
import { cos2 } from "@thi.ng/vectors/cos";
|
|
15
|
+
import { cosh2 } from "@thi.ng/vectors/cosh";
|
|
12
16
|
import { degrees2 } from "@thi.ng/vectors/degrees";
|
|
13
17
|
import { dist2 } from "@thi.ng/vectors/dist";
|
|
14
18
|
import { div2 } from "@thi.ng/vectors/div";
|
|
@@ -45,25 +49,31 @@ import { reflect } from "@thi.ng/vectors/reflect";
|
|
|
45
49
|
import { refract } from "@thi.ng/vectors/refract";
|
|
46
50
|
import { sign2 } from "@thi.ng/vectors/sign";
|
|
47
51
|
import { sin2 } from "@thi.ng/vectors/sin";
|
|
52
|
+
import { sinh2 } from "@thi.ng/vectors/sinh";
|
|
48
53
|
import { smoothStep2 } from "@thi.ng/vectors/smoothstep";
|
|
49
54
|
import { sqrt2 } from "@thi.ng/vectors/sqrt";
|
|
50
55
|
import { step2 } from "@thi.ng/vectors/step";
|
|
51
56
|
import { sub2 } from "@thi.ng/vectors/sub";
|
|
52
57
|
import { subN2 } from "@thi.ng/vectors/subn";
|
|
53
58
|
import { tan2 } from "@thi.ng/vectors/tan";
|
|
59
|
+
import { tanh2 } from "@thi.ng/vectors/tanh";
|
|
54
60
|
import { Pool } from "../pool.js";
|
|
55
61
|
const VEC2 = ({ next, uniform }) => ({
|
|
56
62
|
abs: (a) => abs2(next(), a),
|
|
57
63
|
acos: (a) => acos2(next(), a),
|
|
64
|
+
acosh: (a) => acosh2(next(), a),
|
|
58
65
|
add: (a, b) => add2(next(), a, b),
|
|
59
66
|
addnv: (a, b) => addN2(next(), b, a),
|
|
60
67
|
addvn: (a, b) => addN2(next(), a, b),
|
|
61
68
|
asin: (a) => asin2(next(), a),
|
|
69
|
+
asinh: (a) => asinh2(next(), a),
|
|
62
70
|
atan: (a) => atan_2(next(), a),
|
|
71
|
+
atanh: (a) => atanh_2(next(), a),
|
|
63
72
|
atannn: (a, b) => atan2_2(next(), a, b),
|
|
64
73
|
ceil: (a) => ceil2(next(), a),
|
|
65
74
|
clamp: (x, a, b) => clamp2(next(), x, a, b),
|
|
66
75
|
cos: (a) => cos2(next(), a),
|
|
76
|
+
cosh: (a) => cosh2(next(), a),
|
|
67
77
|
dec: (a) => subN2(next(), a, 1),
|
|
68
78
|
degrees: (a) => degrees2(next(), a),
|
|
69
79
|
dFdx: () => ZERO2,
|
|
@@ -100,6 +110,7 @@ const VEC2 = ({ next, uniform }) => ({
|
|
|
100
110
|
refract: (a, b, c) => refract(next(), a, b, c),
|
|
101
111
|
sign: (a) => sign2(next(), a),
|
|
102
112
|
sin: (a) => sin2(next(), a),
|
|
113
|
+
sinh: (a) => sinh2(next(), a),
|
|
103
114
|
smoothstep: (a, b, t) => smoothStep2(next(), a, b, t),
|
|
104
115
|
sqrt: (a) => sqrt2(next(), a),
|
|
105
116
|
step: (a, b) => step2(next(), a, b),
|
|
@@ -108,6 +119,7 @@ const VEC2 = ({ next, uniform }) => ({
|
|
|
108
119
|
subnv: (a, b) => sub2(null, uniform(a), b),
|
|
109
120
|
subvn: (a, b) => subN2(next(), a, b),
|
|
110
121
|
tan: (a) => tan2(next(), a),
|
|
122
|
+
tanh: (a) => tanh2(next(), a),
|
|
111
123
|
equal: (a, b) => eq2([], a, b),
|
|
112
124
|
notEqual: (a, b) => neq2([], a, b),
|
|
113
125
|
greaterThan: (a, b) => gt2([], a, b),
|
package/env/vec3.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { abs3 } from "@thi.ng/vectors/abs";
|
|
2
2
|
import { acos3 } from "@thi.ng/vectors/acos";
|
|
3
|
+
import { acosh3 } from "@thi.ng/vectors/acosh";
|
|
3
4
|
import { add3 } from "@thi.ng/vectors/add";
|
|
4
5
|
import { addN3 } from "@thi.ng/vectors/addn";
|
|
5
6
|
import { ZERO3 } from "@thi.ng/vectors/api";
|
|
6
7
|
import { asin3 } from "@thi.ng/vectors/asin";
|
|
8
|
+
import { asinh3 } from "@thi.ng/vectors/asinh";
|
|
7
9
|
import { atan_3 } from "@thi.ng/vectors/atan";
|
|
8
10
|
import { atan2_3 } from "@thi.ng/vectors/atan2";
|
|
11
|
+
import { atanh_3 } from "@thi.ng/vectors/atanh";
|
|
9
12
|
import { ceil3 } from "@thi.ng/vectors/ceil";
|
|
10
13
|
import { clamp3 } from "@thi.ng/vectors/clamp";
|
|
11
14
|
import { cos3 } from "@thi.ng/vectors/cos";
|
|
15
|
+
import { cosh3 } from "@thi.ng/vectors/cosh";
|
|
12
16
|
import { cross3 } from "@thi.ng/vectors/cross";
|
|
13
17
|
import { degrees3 } from "@thi.ng/vectors/degrees";
|
|
14
18
|
import { dist3 } from "@thi.ng/vectors/dist";
|
|
@@ -46,25 +50,31 @@ import { reflect } from "@thi.ng/vectors/reflect";
|
|
|
46
50
|
import { refract } from "@thi.ng/vectors/refract";
|
|
47
51
|
import { sign3 } from "@thi.ng/vectors/sign";
|
|
48
52
|
import { sin3 } from "@thi.ng/vectors/sin";
|
|
53
|
+
import { sinh3 } from "@thi.ng/vectors/sinh";
|
|
49
54
|
import { smoothStep3 } from "@thi.ng/vectors/smoothstep";
|
|
50
55
|
import { sqrt3 } from "@thi.ng/vectors/sqrt";
|
|
51
56
|
import { step3 } from "@thi.ng/vectors/step";
|
|
52
57
|
import { sub3 } from "@thi.ng/vectors/sub";
|
|
53
58
|
import { subN3 } from "@thi.ng/vectors/subn";
|
|
54
59
|
import { tan3 } from "@thi.ng/vectors/tan";
|
|
60
|
+
import { tanh3 } from "@thi.ng/vectors/tanh";
|
|
55
61
|
import { Pool } from "../pool.js";
|
|
56
62
|
const VEC3 = ({ next, uniform }) => ({
|
|
57
63
|
abs: (a) => abs3(next(), a),
|
|
58
64
|
acos: (a) => acos3(next(), a),
|
|
65
|
+
acosh: (a) => acosh3(next(), a),
|
|
59
66
|
add: (a, b) => add3(next(), a, b),
|
|
60
67
|
addnv: (a, b) => addN3(next(), b, a),
|
|
61
68
|
addvn: (a, b) => addN3(next(), a, b),
|
|
62
69
|
asin: (a) => asin3(next(), a),
|
|
70
|
+
asinh: (a) => asinh3(next(), a),
|
|
63
71
|
atan: (a) => atan_3(next(), a),
|
|
72
|
+
atanh: (a) => atanh_3(next(), a),
|
|
64
73
|
atannn: (a, b) => atan2_3(next(), a, b),
|
|
65
74
|
ceil: (a) => ceil3(next(), a),
|
|
66
75
|
clamp: (x, a, b) => clamp3(next(), x, a, b),
|
|
67
76
|
cos: (a) => cos3(next(), a),
|
|
77
|
+
cosh: (a) => cosh3(next(), a),
|
|
68
78
|
cross: (a, b) => cross3(next(), a, b),
|
|
69
79
|
dec: (a) => subN3(next(), a, 1),
|
|
70
80
|
degrees: (a) => degrees3(next(), a),
|
|
@@ -102,6 +112,7 @@ const VEC3 = ({ next, uniform }) => ({
|
|
|
102
112
|
refract: (a, b, c) => refract(next(), a, b, c),
|
|
103
113
|
sign: (a) => sign3(next(), a),
|
|
104
114
|
sin: (a) => sin3(next(), a),
|
|
115
|
+
sinh: (a) => sinh3(next(), a),
|
|
105
116
|
smoothstep: (a, b, t) => smoothStep3(next(), a, b, t),
|
|
106
117
|
sqrt: (a) => sqrt3(next(), a),
|
|
107
118
|
step: (a, b) => step3(next(), a, b),
|
|
@@ -110,6 +121,7 @@ const VEC3 = ({ next, uniform }) => ({
|
|
|
110
121
|
subnv: (a, b) => sub3(null, uniform(a), b),
|
|
111
122
|
subvn: (a, b) => subN3(next(), a, b),
|
|
112
123
|
tan: (a) => tan3(next(), a),
|
|
124
|
+
tanh: (a) => tanh3(next(), a),
|
|
113
125
|
equal: (a, b) => eq3([], a, b),
|
|
114
126
|
notEqual: (a, b) => neq3([], a, b),
|
|
115
127
|
greaterThan: (a, b) => gt3([], a, b),
|
package/env/vec4.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { abs4 } from "@thi.ng/vectors/abs";
|
|
2
2
|
import { acos4 } from "@thi.ng/vectors/acos";
|
|
3
|
+
import { acosh4 } from "@thi.ng/vectors/acosh";
|
|
3
4
|
import { add4 } from "@thi.ng/vectors/add";
|
|
4
5
|
import { addN4 } from "@thi.ng/vectors/addn";
|
|
5
6
|
import { ZERO4 } from "@thi.ng/vectors/api";
|
|
6
7
|
import { asin4 } from "@thi.ng/vectors/asin";
|
|
8
|
+
import { asinh4 } from "@thi.ng/vectors/asinh";
|
|
7
9
|
import { atan_4 } from "@thi.ng/vectors/atan";
|
|
8
10
|
import { atan2_4 } from "@thi.ng/vectors/atan2";
|
|
11
|
+
import { atanh_4 } from "@thi.ng/vectors/atanh";
|
|
9
12
|
import { ceil4 } from "@thi.ng/vectors/ceil";
|
|
10
13
|
import { clamp4 } from "@thi.ng/vectors/clamp";
|
|
11
14
|
import { cos4 } from "@thi.ng/vectors/cos";
|
|
15
|
+
import { cosh4 } from "@thi.ng/vectors/cosh";
|
|
12
16
|
import { degrees4 } from "@thi.ng/vectors/degrees";
|
|
13
17
|
import { dist4 } from "@thi.ng/vectors/dist";
|
|
14
18
|
import { div4 } from "@thi.ng/vectors/div";
|
|
@@ -45,25 +49,31 @@ import { reflect } from "@thi.ng/vectors/reflect";
|
|
|
45
49
|
import { refract } from "@thi.ng/vectors/refract";
|
|
46
50
|
import { sign4 } from "@thi.ng/vectors/sign";
|
|
47
51
|
import { sin4 } from "@thi.ng/vectors/sin";
|
|
52
|
+
import { sinh4 } from "@thi.ng/vectors/sinh";
|
|
48
53
|
import { smoothStep4 } from "@thi.ng/vectors/smoothstep";
|
|
49
54
|
import { sqrt4 } from "@thi.ng/vectors/sqrt";
|
|
50
55
|
import { step4 } from "@thi.ng/vectors/step";
|
|
51
56
|
import { sub4 } from "@thi.ng/vectors/sub";
|
|
52
57
|
import { subN4 } from "@thi.ng/vectors/subn";
|
|
53
58
|
import { tan4 } from "@thi.ng/vectors/tan";
|
|
59
|
+
import { tanh4 } from "@thi.ng/vectors/tanh";
|
|
54
60
|
import { Pool } from "../pool.js";
|
|
55
61
|
const VEC4 = ({ next, uniform }) => ({
|
|
56
62
|
abs: (a) => abs4(next(), a),
|
|
57
63
|
acos: (a) => acos4(next(), a),
|
|
64
|
+
acosh: (a) => acosh4(next(), a),
|
|
58
65
|
add: (a, b) => add4(next(), a, b),
|
|
59
66
|
addnv: (a, b) => addN4(next(), b, a),
|
|
60
67
|
addvn: (a, b) => addN4(next(), a, b),
|
|
61
68
|
asin: (a) => asin4(next(), a),
|
|
69
|
+
asinh: (a) => asinh4(next(), a),
|
|
62
70
|
atan: (a) => atan_4(next(), a),
|
|
71
|
+
atanh: (a) => atanh_4(next(), a),
|
|
63
72
|
atannn: (a, b) => atan2_4(next(), a, b),
|
|
64
73
|
ceil: (a) => ceil4(next(), a),
|
|
65
74
|
clamp: (x, a, b) => clamp4(next(), x, a, b),
|
|
66
75
|
cos: (a) => cos4(next(), a),
|
|
76
|
+
cosh: (a) => cosh4(next(), a),
|
|
67
77
|
dec: (a) => subN4(next(), a, 1),
|
|
68
78
|
degrees: (a) => degrees4(next(), a),
|
|
69
79
|
dFdx: () => ZERO4,
|
|
@@ -100,6 +110,7 @@ const VEC4 = ({ next, uniform }) => ({
|
|
|
100
110
|
refract: (a, b, c) => refract(next(), a, b, c),
|
|
101
111
|
sign: (a) => sign4(next(), a),
|
|
102
112
|
sin: (a) => sin4(next(), a),
|
|
113
|
+
sinh: (a) => sinh4(next(), a),
|
|
103
114
|
smoothstep: (a, b, t) => smoothStep4(next(), a, b, t),
|
|
104
115
|
sqrt: (a) => sqrt4(next(), a),
|
|
105
116
|
step: (a, b) => step4(next(), a, b),
|
|
@@ -108,6 +119,7 @@ const VEC4 = ({ next, uniform }) => ({
|
|
|
108
119
|
subnv: (a, b) => sub4(null, uniform(a), b),
|
|
109
120
|
subvn: (a, b) => subN4(next(), a, b),
|
|
110
121
|
tan: (a) => tan4(next(), a),
|
|
122
|
+
tanh: (a) => tanh4(next(), a),
|
|
111
123
|
equal: (a, b) => eq4([], a, b),
|
|
112
124
|
notEqual: (a, b) => neq4([], a, b),
|
|
113
125
|
greaterThan: (a, b) => gt4([], a, b),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/shader-ast-js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Customizable JS codegen, compiler & runtime for @thi.ng/shader-ast",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"@thi.ng/checks": "^3.7.7",
|
|
44
44
|
"@thi.ng/errors": "^2.5.33",
|
|
45
45
|
"@thi.ng/math": "^5.11.27",
|
|
46
|
-
"@thi.ng/matrices": "^3.0.
|
|
46
|
+
"@thi.ng/matrices": "^3.0.4",
|
|
47
47
|
"@thi.ng/pixel": "^7.4.5",
|
|
48
|
-
"@thi.ng/shader-ast": "^1.0
|
|
49
|
-
"@thi.ng/vectors": "^8.
|
|
48
|
+
"@thi.ng/shader-ast": "^1.1.0",
|
|
49
|
+
"@thi.ng/vectors": "^8.2.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"esbuild": "^0.25.3",
|
|
@@ -165,5 +165,5 @@
|
|
|
165
165
|
],
|
|
166
166
|
"year": 2019
|
|
167
167
|
},
|
|
168
|
-
"gitHead": "
|
|
168
|
+
"gitHead": "99ea3cda41e61b66f3914c5c9c9b7bb60ee3ee84\n"
|
|
169
169
|
}
|