@matboks/utilities 0.0.1 → 0.0.2
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/dist/constants 2.js +1 -0
- package/dist/constants 3.js +1 -0
- package/dist/constants.d 2.ts +1 -0
- package/dist/constants.d 3.ts +1 -0
- package/dist/index 2.js +11 -0
- package/dist/index 3.js +11 -0
- package/dist/index.d 2.ts +11 -0
- package/dist/index.d 3.ts +11 -0
- package/dist/shader-modules/modules/camera.js +42 -42
- package/dist/shader-modules/modules/color/blend.js +107 -107
- package/dist/shader-modules/modules/color/index.js +134 -134
- package/dist/shader-modules/modules/constants.js +13 -13
- package/dist/shader-modules/modules/geometry.js +109 -109
- package/dist/shader-modules/modules/math.js +18 -18
- package/dist/shader-modules/modules/noise.d.ts +1 -1
- package/dist/shader-modules/modules/noise.js +449 -409
- package/dist/shader-modules/modules/random.d.ts +1 -1
- package/dist/shader-modules/modules/random.js +172 -146
- package/dist/shader-modules/modules/ray-marching.js +53 -53
- package/dist/shader-modules/modules/sdf/index.js +182 -182
- package/dist/shader-modules/modules/sdf/operations.js +76 -76
- package/dist/shader-modules/modules/sdf.d.ts +1 -0
- package/dist/shader-modules/modules/sdf.js +126 -0
- package/dist/shader-modules/modules/utils.js +114 -114
- package/dist/shader-modules/shaders.js +107 -107
- package/dist/shader-renderer/pixel-vertex-shader.js +13 -13
- package/dist/tilings/tiler.d.ts +1 -0
- package/dist/tilings/tiler.js +4 -0
- package/dist/types 2.js +1 -0
- package/dist/types 3.js +1 -0
- package/dist/types.d 2.ts +1 -0
- package/dist/types.d 3.ts +1 -0
- package/package.json +2 -2
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
export const utilsDefinition = /*glsl*/ `
|
|
2
|
-
|
|
3
|
-
import { EPS } from "@/constants";
|
|
4
|
-
import { rotate } from "@/geometry";
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
aastep,
|
|
8
|
-
triangleWave,
|
|
9
|
-
lerp,
|
|
10
|
-
signed,
|
|
11
|
-
tile,
|
|
12
|
-
dot2,
|
|
13
|
-
smoothsteps,
|
|
14
|
-
triplanarTexture
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
float aastep(float threshold, float value) {
|
|
18
|
-
float d = length(vec2(dFdx(value), dFdy(value))) * 0.707;
|
|
19
|
-
return smoothstep(-d, d, value - threshold);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
float triangleWave(float p) {
|
|
23
|
-
return 2.*abs(p - floor(p + .5));
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
float triangleWave(vec2 p) {
|
|
27
|
-
return triangleWave(p.x);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
float triangleWave(vec2 p, float o) {
|
|
31
|
-
return triangleWave(rotate(p, o));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
float lerp(float x, float a, float b) {
|
|
35
|
-
return clamp((x - a)/(b - a), 0.0, 1.0);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
float signed(float t) {
|
|
39
|
-
return -1.0 + 2.0*t;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
vec2 signed(vec2 t) {
|
|
43
|
-
return -1.0 + 2.0*t;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
vec3 signed(vec3 t) {
|
|
47
|
-
return -1.0 + 2.0*t;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
vec4 signed(vec4 t) {
|
|
51
|
-
return -1.0 + 2.0*t;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
float tile(float p, float s) {
|
|
55
|
-
return mod(p, 2.0*s) - s;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
vec2 tile(vec2 p, vec2 s) {
|
|
59
|
-
return mod(p, 2.0*s) - s;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
vec2 tile(vec2 p, float s) {
|
|
63
|
-
return tile(p, vec2(s));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
vec3 tile(vec3 p, vec3 s) {
|
|
67
|
-
return mod(p, 2.0*s) - s;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
vec3 tile(vec3 p, float s) {
|
|
71
|
-
return tile(p, vec3(s));
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
vec4 tile(vec4 p, vec4 s) {
|
|
75
|
-
return mod(p, 2.0*s) - s;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
vec4 tile(vec4 p, float s) {
|
|
79
|
-
return tile(p, vec4(s));
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
float dot2(vec2 v) {
|
|
83
|
-
return dot(v, v);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
float dot2(vec3 v) {
|
|
87
|
-
return dot(v, v);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
float dot2(vec4 v) {
|
|
91
|
-
return dot(v, v);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
float smoothsteps(float t, int steps, float flatness) {
|
|
95
|
-
if (t < 0.0) return 0.0;
|
|
96
|
-
if (t > 1.0) return 1.0;
|
|
97
|
-
|
|
98
|
-
float sf = float(steps);
|
|
99
|
-
float value;
|
|
100
|
-
if (flatness == 1.0) {
|
|
101
|
-
value = floor(t*(sf + 1.0))/sf;
|
|
102
|
-
} else {
|
|
103
|
-
float l = 1.0/sf*(1.0 - flatness/(sf + 1.0));
|
|
104
|
-
value = (floor(t/l) + smoothstep(flatness, 1.0, fract(t/l)))/sf;
|
|
105
|
-
}
|
|
106
|
-
return clamp(value, 0.0, 1.0);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
float triplanarTexture(vec3 p, vec3 normal, float power, float texture(vec2)) {
|
|
110
|
-
vec3 w = pow(abs(normal), vec3(power));
|
|
111
|
-
vec3 v = vec3(texture(p.yz), texture(p.xz), texture(p.xy));
|
|
112
|
-
return dot(w, v) / dot(w, vec3(1));
|
|
113
|
-
}
|
|
114
|
-
|
|
1
|
+
export const utilsDefinition = /*glsl*/ `
|
|
2
|
+
|
|
3
|
+
import { EPS } from "@/constants";
|
|
4
|
+
import { rotate } from "@/geometry";
|
|
5
|
+
|
|
6
|
+
export {
|
|
7
|
+
aastep,
|
|
8
|
+
triangleWave,
|
|
9
|
+
lerp,
|
|
10
|
+
signed,
|
|
11
|
+
tile,
|
|
12
|
+
dot2,
|
|
13
|
+
smoothsteps,
|
|
14
|
+
triplanarTexture
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
float aastep(float threshold, float value) {
|
|
18
|
+
float d = length(vec2(dFdx(value), dFdy(value))) * 0.707;
|
|
19
|
+
return smoothstep(-d, d, value - threshold);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
float triangleWave(float p) {
|
|
23
|
+
return 2.*abs(p - floor(p + .5));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
float triangleWave(vec2 p) {
|
|
27
|
+
return triangleWave(p.x);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
float triangleWave(vec2 p, float o) {
|
|
31
|
+
return triangleWave(rotate(p, o));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
float lerp(float x, float a, float b) {
|
|
35
|
+
return clamp((x - a)/(b - a), 0.0, 1.0);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
float signed(float t) {
|
|
39
|
+
return -1.0 + 2.0*t;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
vec2 signed(vec2 t) {
|
|
43
|
+
return -1.0 + 2.0*t;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
vec3 signed(vec3 t) {
|
|
47
|
+
return -1.0 + 2.0*t;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
vec4 signed(vec4 t) {
|
|
51
|
+
return -1.0 + 2.0*t;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
float tile(float p, float s) {
|
|
55
|
+
return mod(p, 2.0*s) - s;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
vec2 tile(vec2 p, vec2 s) {
|
|
59
|
+
return mod(p, 2.0*s) - s;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
vec2 tile(vec2 p, float s) {
|
|
63
|
+
return tile(p, vec2(s));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
vec3 tile(vec3 p, vec3 s) {
|
|
67
|
+
return mod(p, 2.0*s) - s;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
vec3 tile(vec3 p, float s) {
|
|
71
|
+
return tile(p, vec3(s));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
vec4 tile(vec4 p, vec4 s) {
|
|
75
|
+
return mod(p, 2.0*s) - s;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
vec4 tile(vec4 p, float s) {
|
|
79
|
+
return tile(p, vec4(s));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
float dot2(vec2 v) {
|
|
83
|
+
return dot(v, v);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
float dot2(vec3 v) {
|
|
87
|
+
return dot(v, v);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
float dot2(vec4 v) {
|
|
91
|
+
return dot(v, v);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
float smoothsteps(float t, int steps, float flatness) {
|
|
95
|
+
if (t < 0.0) return 0.0;
|
|
96
|
+
if (t > 1.0) return 1.0;
|
|
97
|
+
|
|
98
|
+
float sf = float(steps);
|
|
99
|
+
float value;
|
|
100
|
+
if (flatness == 1.0) {
|
|
101
|
+
value = floor(t*(sf + 1.0))/sf;
|
|
102
|
+
} else {
|
|
103
|
+
float l = 1.0/sf*(1.0 - flatness/(sf + 1.0));
|
|
104
|
+
value = (floor(t/l) + smoothstep(flatness, 1.0, fract(t/l)))/sf;
|
|
105
|
+
}
|
|
106
|
+
return clamp(value, 0.0, 1.0);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
float triplanarTexture(vec3 p, vec3 normal, float power, float texture(vec2)) {
|
|
110
|
+
vec3 w = pow(abs(normal), vec3(power));
|
|
111
|
+
vec3 v = vec3(texture(p.yz), texture(p.xz), texture(p.xy));
|
|
112
|
+
return dot(w, v) / dot(w, vec3(1));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
115
|
`;
|
|
@@ -1,109 +1,109 @@
|
|
|
1
1
|
import { glslRegistry } from "./registry.js";
|
|
2
|
-
export const testFragmentShaderDefinition = glslRegistry.resolve(/*glsl*/ `
|
|
3
|
-
#version 300 es
|
|
4
|
-
|
|
5
|
-
import { meshSDF, sdfNormal, discoBall } from "glslkit/sdf";
|
|
6
|
-
import { rayMarch, RayMarchResult as RMR, Ray } from "glslkit/ray-marching";
|
|
7
|
-
import { orthographic } from "glslkit/camera";
|
|
8
|
-
import { axisAngle, create2DBasisVectors, rotate } from "glslkit/geometry";
|
|
9
|
-
import { PI } from "glslkit/constants";
|
|
10
|
-
import { aastep, signed } from "glslkit/utils";
|
|
11
|
-
import { perlinNoise, valueNoise } from "glslkit/noise";
|
|
12
|
-
|
|
13
|
-
precision highp float;
|
|
14
|
-
|
|
15
|
-
in vec2 uv;
|
|
16
|
-
out vec4 color;
|
|
17
|
-
|
|
18
|
-
struct Camera {
|
|
19
|
-
vec3 position;
|
|
20
|
-
vec3 lookAt;
|
|
21
|
-
float viewport;
|
|
22
|
-
float rotation;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
uniform int u_id;
|
|
26
|
-
uniform vec2 u_resolution;
|
|
27
|
-
uniform float u_time;
|
|
28
|
-
uniform sampler2D u_vertices;
|
|
29
|
-
uniform int u_numVertices;
|
|
30
|
-
uniform vec3 u_cameraPosition;
|
|
31
|
-
uniform vec3 u_lookAt;
|
|
32
|
-
uniform float u_viewport;
|
|
33
|
-
uniform float u_rotation;
|
|
34
|
-
uniform float u_values[10];
|
|
35
|
-
|
|
36
|
-
void main() {
|
|
37
|
-
Camera;
|
|
38
|
-
float aspectRatio = u_resolution.x / u_resolution.y;
|
|
39
|
-
vec2 p = 2.0*vec2(aspectRatio, 1)*(uv - 0.5);
|
|
40
|
-
|
|
41
|
-
Ray ray = orthographic({
|
|
42
|
-
uv,
|
|
43
|
-
cameraPosition: u_cameraPosition,
|
|
44
|
-
lookAt: u_lookAt,
|
|
45
|
-
viewport: u_viewport,
|
|
46
|
-
aspectRatio,
|
|
47
|
-
rotation: u_rotation
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
// float sdf = (vec3 p) => length(p) - 0.5;
|
|
51
|
-
|
|
52
|
-
float sdf = (vec3 p) => {
|
|
53
|
-
// p += 0.01*signed(valueNoise(p, 100.0, 0.0));
|
|
54
|
-
// p = axisAngle(p, vec3(0, 1, 0), 0.);
|
|
55
|
-
float d0 = meshSDF(p, u_vertices, u_numVertices);
|
|
56
|
-
// float d0 = length(p) - 20.0;
|
|
57
|
-
// float d1 = length(p.xy) - 0.5;
|
|
58
|
-
|
|
59
|
-
// float d1 = min(min(length(p.xz), length(p.yz)), length(p.xy)) - 0.5;
|
|
60
|
-
float d1 = discoBall(p, vec3(0, 0, 1), 0.25, 8.0, 0.);
|
|
61
|
-
// float d1 = length(p - vec3(0, 0, 1)) - 1.;
|
|
62
|
-
|
|
63
|
-
float d = d0;
|
|
64
|
-
// d = max(d, -d1);
|
|
65
|
-
// d = min(d, d1);
|
|
66
|
-
// d = min(d, length(p) - 0.3);
|
|
67
|
-
// d = min(d, length(p.xy) - 0.25);
|
|
68
|
-
// d = d0;
|
|
69
|
-
return d;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
RMR rmr = rayMarch(ray, sdf);
|
|
73
|
-
|
|
74
|
-
if (!rmr.hit) {
|
|
75
|
-
color = vec4(0, 0, 0, 0);
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
vec3 position = rmr.position;
|
|
80
|
-
|
|
81
|
-
vec3 normal = sdfNormal(position + vec3(0, 0, 0.000), sdf, 0.0005);
|
|
82
|
-
|
|
83
|
-
mat2x3 basis2D = create2DBasisVectors(normal);
|
|
84
|
-
vec2 pn = position*basis2D;
|
|
85
|
-
|
|
86
|
-
vec3 lightDirection = normalize(vec3(1, -1, -1));
|
|
87
|
-
// vec3 lightDirection = ray.direction;
|
|
88
|
-
float light = clamp(-dot(normal, lightDirection), 0.0, 1.0);
|
|
89
|
-
|
|
90
|
-
// float value = smoothstep(0.45, 0.55, light);
|
|
91
|
-
float value;
|
|
92
|
-
|
|
93
|
-
// value = light;
|
|
94
|
-
value = aastep(1.0 - (-0.1 + 1.2*light), 0.5 + 0.5*sin(20.0*2.*PI*pn.x));
|
|
95
|
-
// value = aastep(1.0 - light, perlinNoise(pn, 0.01, 0.0));
|
|
96
|
-
// if (p.y > 0.0) {
|
|
97
|
-
// } else {
|
|
98
|
-
// }
|
|
99
|
-
|
|
100
|
-
// vec3 c = vec3(value);
|
|
101
|
-
vec3 c = mix(vec3(0, 0, 0), vec3(1, 1, 1), value);
|
|
102
|
-
|
|
103
|
-
// c = texture(u_vertices, uv).rgb;
|
|
104
|
-
|
|
105
|
-
// color = vec4(1, 0, 0, 1);
|
|
106
|
-
color = vec4(c, 1);
|
|
107
|
-
}
|
|
108
|
-
|
|
2
|
+
export const testFragmentShaderDefinition = glslRegistry.resolve(/*glsl*/ `
|
|
3
|
+
#version 300 es
|
|
4
|
+
|
|
5
|
+
import { meshSDF, sdfNormal, discoBall } from "glslkit/sdf";
|
|
6
|
+
import { rayMarch, RayMarchResult as RMR, Ray } from "glslkit/ray-marching";
|
|
7
|
+
import { orthographic } from "glslkit/camera";
|
|
8
|
+
import { axisAngle, create2DBasisVectors, rotate } from "glslkit/geometry";
|
|
9
|
+
import { PI } from "glslkit/constants";
|
|
10
|
+
import { aastep, signed } from "glslkit/utils";
|
|
11
|
+
import { perlinNoise, valueNoise } from "glslkit/noise";
|
|
12
|
+
|
|
13
|
+
precision highp float;
|
|
14
|
+
|
|
15
|
+
in vec2 uv;
|
|
16
|
+
out vec4 color;
|
|
17
|
+
|
|
18
|
+
struct Camera {
|
|
19
|
+
vec3 position;
|
|
20
|
+
vec3 lookAt;
|
|
21
|
+
float viewport;
|
|
22
|
+
float rotation;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
uniform int u_id;
|
|
26
|
+
uniform vec2 u_resolution;
|
|
27
|
+
uniform float u_time;
|
|
28
|
+
uniform sampler2D u_vertices;
|
|
29
|
+
uniform int u_numVertices;
|
|
30
|
+
uniform vec3 u_cameraPosition;
|
|
31
|
+
uniform vec3 u_lookAt;
|
|
32
|
+
uniform float u_viewport;
|
|
33
|
+
uniform float u_rotation;
|
|
34
|
+
uniform float u_values[10];
|
|
35
|
+
|
|
36
|
+
void main() {
|
|
37
|
+
Camera;
|
|
38
|
+
float aspectRatio = u_resolution.x / u_resolution.y;
|
|
39
|
+
vec2 p = 2.0*vec2(aspectRatio, 1)*(uv - 0.5);
|
|
40
|
+
|
|
41
|
+
Ray ray = orthographic({
|
|
42
|
+
uv,
|
|
43
|
+
cameraPosition: u_cameraPosition,
|
|
44
|
+
lookAt: u_lookAt,
|
|
45
|
+
viewport: u_viewport,
|
|
46
|
+
aspectRatio,
|
|
47
|
+
rotation: u_rotation
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// float sdf = (vec3 p) => length(p) - 0.5;
|
|
51
|
+
|
|
52
|
+
float sdf = (vec3 p) => {
|
|
53
|
+
// p += 0.01*signed(valueNoise(p, 100.0, 0.0));
|
|
54
|
+
// p = axisAngle(p, vec3(0, 1, 0), 0.);
|
|
55
|
+
float d0 = meshSDF(p, u_vertices, u_numVertices);
|
|
56
|
+
// float d0 = length(p) - 20.0;
|
|
57
|
+
// float d1 = length(p.xy) - 0.5;
|
|
58
|
+
|
|
59
|
+
// float d1 = min(min(length(p.xz), length(p.yz)), length(p.xy)) - 0.5;
|
|
60
|
+
float d1 = discoBall(p, vec3(0, 0, 1), 0.25, 8.0, 0.);
|
|
61
|
+
// float d1 = length(p - vec3(0, 0, 1)) - 1.;
|
|
62
|
+
|
|
63
|
+
float d = d0;
|
|
64
|
+
// d = max(d, -d1);
|
|
65
|
+
// d = min(d, d1);
|
|
66
|
+
// d = min(d, length(p) - 0.3);
|
|
67
|
+
// d = min(d, length(p.xy) - 0.25);
|
|
68
|
+
// d = d0;
|
|
69
|
+
return d;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
RMR rmr = rayMarch(ray, sdf);
|
|
73
|
+
|
|
74
|
+
if (!rmr.hit) {
|
|
75
|
+
color = vec4(0, 0, 0, 0);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
vec3 position = rmr.position;
|
|
80
|
+
|
|
81
|
+
vec3 normal = sdfNormal(position + vec3(0, 0, 0.000), sdf, 0.0005);
|
|
82
|
+
|
|
83
|
+
mat2x3 basis2D = create2DBasisVectors(normal);
|
|
84
|
+
vec2 pn = position*basis2D;
|
|
85
|
+
|
|
86
|
+
vec3 lightDirection = normalize(vec3(1, -1, -1));
|
|
87
|
+
// vec3 lightDirection = ray.direction;
|
|
88
|
+
float light = clamp(-dot(normal, lightDirection), 0.0, 1.0);
|
|
89
|
+
|
|
90
|
+
// float value = smoothstep(0.45, 0.55, light);
|
|
91
|
+
float value;
|
|
92
|
+
|
|
93
|
+
// value = light;
|
|
94
|
+
value = aastep(1.0 - (-0.1 + 1.2*light), 0.5 + 0.5*sin(20.0*2.*PI*pn.x));
|
|
95
|
+
// value = aastep(1.0 - light, perlinNoise(pn, 0.01, 0.0));
|
|
96
|
+
// if (p.y > 0.0) {
|
|
97
|
+
// } else {
|
|
98
|
+
// }
|
|
99
|
+
|
|
100
|
+
// vec3 c = vec3(value);
|
|
101
|
+
vec3 c = mix(vec3(0, 0, 0), vec3(1, 1, 1), value);
|
|
102
|
+
|
|
103
|
+
// c = texture(u_vertices, uv).rgb;
|
|
104
|
+
|
|
105
|
+
// color = vec4(1, 0, 0, 1);
|
|
106
|
+
color = vec4(c, 1);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
109
|
`.trim());
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export const pixelVertexShader = /*glsl*/ `
|
|
2
|
-
#version 300 es
|
|
3
|
-
|
|
4
|
-
precision highp float;
|
|
5
|
-
|
|
6
|
-
in vec2 p;
|
|
7
|
-
out vec2 uv;
|
|
8
|
-
|
|
9
|
-
void main() {
|
|
10
|
-
uv = p;
|
|
11
|
-
gl_Position = vec4(-1.0 + 2.0*p, 0, 1);
|
|
12
|
-
}
|
|
13
|
-
|
|
1
|
+
export const pixelVertexShader = /*glsl*/ `
|
|
2
|
+
#version 300 es
|
|
3
|
+
|
|
4
|
+
precision highp float;
|
|
5
|
+
|
|
6
|
+
in vec2 p;
|
|
7
|
+
out vec2 uv;
|
|
8
|
+
|
|
9
|
+
void main() {
|
|
10
|
+
uv = p;
|
|
11
|
+
gl_Position = vec4(-1.0 + 2.0*p, 0, 1);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
14
|
`.trim();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types 2.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types 3.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matboks/utilities",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"d3-delaunay": "^6.0.4",
|
|
14
14
|
"earcut": "^3.0.2",
|
|
15
|
-
"glsl-modules": "^0.
|
|
15
|
+
"glsl-modules": "^0.7.0",
|
|
16
16
|
"marching-squares": "^1.0.0",
|
|
17
17
|
"polyclip-ts": "^0.16.8"
|
|
18
18
|
},
|