shaders 2.5.82 → 2.5.84
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/core/{Crescent-B4Z_WAgY.js → Crescent-DnFexzlT.js} +1 -1
- package/dist/core/{Cross-M5Vm5Kmy.js → Cross-rsVMygBv.js} +1 -1
- package/dist/core/{Ellipse-BjbjXlOx.js → Ellipse-CZWtvB3q.js} +1 -1
- package/dist/core/{Emboss-K5TExa67.js → Emboss-DCKgs4_G.js} +11 -62
- package/dist/core/{Flower-B-53jiUT.js → Flower-fYEx6ZSB.js} +1 -1
- package/dist/core/{Glass-D7wAPADg.js → Glass-BioLeiH6.js} +12 -63
- package/dist/core/{Neon-By5OgQ24.js → Neon-uXetpVop.js} +10 -61
- package/dist/core/{Polygon-MN_gj5R6.js → Polygon-7mzxbJeF.js} +1 -1
- package/dist/core/{Ring-76XLaaus.js → Ring-H6B01ZMz.js} +1 -1
- package/dist/core/{RoundedRect-D6q6xf_O.js → RoundedRect-OszKdYVD.js} +1 -1
- package/dist/core/{Star-DN6qziUO.js → Star-CyjNgJVp.js} +1 -1
- package/dist/core/{Trapezoid-C-HfI0fp.js → Trapezoid-SuI0dRgI.js} +1 -1
- package/dist/core/{Vesica-DXWePxDj.js → Vesica-Cj--pgNW.js} +1 -1
- package/dist/core/index.js +15 -15
- package/dist/core/registry.js +15 -15
- package/dist/core/{sdf-BDsv-WBk.js → sdf-CZRX0uur.js} +86 -2
- package/dist/core/{shaderRegistry-C0Tmid5z.js → shaderRegistry-ClxU5BC7.js} +13 -13
- package/dist/core/shaders/Crescent/index.js +2 -2
- package/dist/core/shaders/Cross/index.js +2 -2
- package/dist/core/shaders/Ellipse/index.js +2 -2
- package/dist/core/shaders/Emboss/index.d.ts +6 -0
- package/dist/core/shaders/Emboss/index.d.ts.map +1 -1
- package/dist/core/shaders/Emboss/index.js +2 -2
- package/dist/core/shaders/Flower/index.js +2 -2
- package/dist/core/shaders/Glass/index.d.ts +6 -0
- package/dist/core/shaders/Glass/index.d.ts.map +1 -1
- package/dist/core/shaders/Glass/index.js +2 -2
- package/dist/core/shaders/Neon/index.d.ts +6 -0
- package/dist/core/shaders/Neon/index.d.ts.map +1 -1
- package/dist/core/shaders/Neon/index.js +2 -2
- package/dist/core/shaders/Polygon/index.js +2 -2
- package/dist/core/shaders/Ring/index.js +2 -2
- package/dist/core/shaders/RoundedRect/index.js +2 -2
- package/dist/core/shaders/Star/index.js +2 -2
- package/dist/core/shaders/Trapezoid/index.js +2 -2
- package/dist/core/shaders/Vesica/index.js +2 -2
- package/dist/core/utilities/sdf.d.ts +5 -0
- package/dist/core/utilities/sdf.d.ts.map +1 -1
- package/dist/js/createShader.js +1 -1
- package/dist/react/Shader.js +1 -1
- package/dist/registry.js +15 -0
- package/dist/solid/engine/Shader.js +1 -1
- package/dist/svelte/index.js +1 -1
- package/dist/vue/Emboss.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/vue/Glass.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/vue/Neon.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as transformColor, l as transformPosition, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-BPpDnR5I.js";
|
|
3
|
-
import {
|
|
3
|
+
import { i as crescentSdf } from "./sdf-CZRX0uur.js";
|
|
4
4
|
import { cos, float, screenUV, sin, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
5
5
|
var transformStrokePosition = (value) => {
|
|
6
6
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as transformColor, l as transformPosition, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-BPpDnR5I.js";
|
|
3
|
-
import {
|
|
3
|
+
import { a as crossSdf } from "./sdf-CZRX0uur.js";
|
|
4
4
|
import { cos, float, screenUV, sin, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
5
5
|
var transformStrokePosition = (value) => {
|
|
6
6
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as transformColor, l as transformPosition, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-BPpDnR5I.js";
|
|
3
|
-
import {
|
|
3
|
+
import { o as ellipseSdf } from "./sdf-CZRX0uur.js";
|
|
4
4
|
import { cos, float, screenUV, sin, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
5
5
|
var transformStrokePosition = (value) => {
|
|
6
6
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { l as transformPosition } from "./transformations-B5lM6fYX.js";
|
|
2
|
-
import {
|
|
3
|
-
import { Fn, abs, clamp, convertToTexture, cos, float, max,
|
|
2
|
+
import { n as createAnalyticSdfSampler, r as createSvgSdfSampler } from "./sdf-CZRX0uur.js";
|
|
3
|
+
import { Fn, abs, clamp, convertToTexture, cos, float, max, screenUV, sin, smoothstep, sqrt, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
var _INV_LIGHT_LEN = 1 / Math.sqrt(1.49);
|
|
5
5
|
var _LZN = .7 * _INV_LIGHT_LEN;
|
|
6
6
|
function applyEmbossEffect(childTexture, sdfSampler, uniforms) {
|
|
@@ -154,6 +154,11 @@ const componentDefinition = {
|
|
|
154
154
|
default: "",
|
|
155
155
|
compileTime: true,
|
|
156
156
|
description: "URL to a pre-generated SDF .bin file — when non-empty, activates SVG mode and triggers a shader recompile"
|
|
157
|
+
},
|
|
158
|
+
shapeType: {
|
|
159
|
+
default: "",
|
|
160
|
+
compileTime: true,
|
|
161
|
+
description: "Active SDF shape type — triggers recompile when shape is switched. When empty, derived from shape JSON at mount time."
|
|
157
162
|
}
|
|
158
163
|
},
|
|
159
164
|
fragmentNode: ({ uniforms, childNode, onCleanup, onBeforeRender }) => {
|
|
@@ -164,8 +169,10 @@ const componentDefinition = {
|
|
|
164
169
|
});
|
|
165
170
|
const shapeSdfUrl = uniforms.shapeSdfUrl.uniform.value;
|
|
166
171
|
const initialConfig = (() => {
|
|
172
|
+
const val = uniforms.shape.uniform.value;
|
|
173
|
+
if (typeof val === "object" && val !== null) return val;
|
|
167
174
|
try {
|
|
168
|
-
return JSON.parse(
|
|
175
|
+
return JSON.parse(val);
|
|
169
176
|
} catch {
|
|
170
177
|
return {
|
|
171
178
|
type: "circleSDF",
|
|
@@ -176,65 +183,7 @@ const componentDefinition = {
|
|
|
176
183
|
}
|
|
177
184
|
})();
|
|
178
185
|
if (shapeSdfUrl) return applyEmbossEffect(childTexture, createSvgSdfSampler(shapeSdfUrl, onBeforeRender, onCleanup), uniforms);
|
|
179
|
-
else
|
|
180
|
-
const SHAPE_MODES = {
|
|
181
|
-
circleSDF: 0,
|
|
182
|
-
polygonSDF: 1,
|
|
183
|
-
flowerSDF: 2,
|
|
184
|
-
ringSDF: 3,
|
|
185
|
-
crossSDF: 4,
|
|
186
|
-
starSDF: 5,
|
|
187
|
-
roundedRectSDF: 6,
|
|
188
|
-
ellipseSDF: 7,
|
|
189
|
-
vesicaSDF: 8,
|
|
190
|
-
crescentSDF: 9,
|
|
191
|
-
trapezoidSDF: 10
|
|
192
|
-
};
|
|
193
|
-
const radiusU = uniform(initialConfig.radius ?? .35);
|
|
194
|
-
const sidesU = uniform(initialConfig.sides ?? 6);
|
|
195
|
-
const roundingU = uniform(initialConfig.rounding ?? 0);
|
|
196
|
-
const innerRatioU = uniform(initialConfig.innerRatio ?? initialConfig.thickness ?? .4);
|
|
197
|
-
const rotationU = uniform(initialConfig.rotation ?? 0);
|
|
198
|
-
const heightU = uniform(initialConfig.height ?? .25);
|
|
199
|
-
const offsetU = uniform(initialConfig.offset ?? .2);
|
|
200
|
-
const shapeModeU = uniform(SHAPE_MODES[initialConfig.type] ?? 0);
|
|
201
|
-
onBeforeRender(() => {
|
|
202
|
-
try {
|
|
203
|
-
const cfg = JSON.parse(uniforms.shape.uniform.value);
|
|
204
|
-
radiusU.value = cfg.radius ?? cfg.width ?? cfg.bottomWidth ?? .35;
|
|
205
|
-
sidesU.value = cfg.sides ?? 6;
|
|
206
|
-
roundingU.value = cfg.rounding ?? 0;
|
|
207
|
-
innerRatioU.value = cfg.innerRatio ?? cfg.thickness ?? cfg.spread ?? cfg.topWidth ?? cfg.topRatio ?? .4;
|
|
208
|
-
rotationU.value = cfg.rotation ?? 0;
|
|
209
|
-
heightU.value = cfg.height ?? .25;
|
|
210
|
-
offsetU.value = cfg.offset ?? .2;
|
|
211
|
-
shapeModeU.value = SHAPE_MODES[cfg.type] ?? 0;
|
|
212
|
-
} catch {}
|
|
213
|
-
});
|
|
214
|
-
const sdfSampler = (uv$1) => {
|
|
215
|
-
const dx = uv$1.x.sub(float(.5));
|
|
216
|
-
const dy = uv$1.y.sub(float(.5));
|
|
217
|
-
const rotRad = rotationU.mul(float(Math.PI / 180));
|
|
218
|
-
const cosR = cos(rotRad);
|
|
219
|
-
const sinR = sin(rotRad);
|
|
220
|
-
const rdx = dx.mul(cosR).add(dy.mul(sinR));
|
|
221
|
-
const rdy = dy.mul(cosR).sub(dx.mul(sinR));
|
|
222
|
-
const circle = circleSdf(dx, dy, radiusU);
|
|
223
|
-
const polygon = mix(polygonSdf(rdx, rdy, radiusU, sidesU), circle, roundingU);
|
|
224
|
-
const flower = flowerSdf(rdx, rdy, radiusU, sidesU, innerRatioU);
|
|
225
|
-
const ring = ringSdf(dx, dy, radiusU, innerRatioU);
|
|
226
|
-
const cross = crossSdf(rdx, rdy, radiusU, innerRatioU, roundingU);
|
|
227
|
-
const star = starSdf(rdx, rdy, radiusU, sidesU, innerRatioU);
|
|
228
|
-
const roundedRect = roundedRectSdf(rdx, rdy, radiusU, heightU, roundingU);
|
|
229
|
-
const ellipse = ellipseSdf(rdx, rdy, radiusU, heightU);
|
|
230
|
-
const vesica = vesicaSdf(rdx, rdy, radiusU, innerRatioU);
|
|
231
|
-
const crescent = crescentSdf(rdx, rdy, radiusU, innerRatioU, offsetU);
|
|
232
|
-
const trapezoid = trapezoidSdf(rdx, rdy, innerRatioU, radiusU, heightU);
|
|
233
|
-
const m = shapeModeU;
|
|
234
|
-
return vec4(m.lessThan(float(.5)).select(circle, m.lessThan(float(1.5)).select(polygon, m.lessThan(float(2.5)).select(flower, m.lessThan(float(3.5)).select(ring, m.lessThan(float(4.5)).select(cross, m.lessThan(float(5.5)).select(star, m.lessThan(float(6.5)).select(roundedRect, m.lessThan(float(7.5)).select(ellipse, m.lessThan(float(8.5)).select(vesica, m.lessThan(float(9.5)).select(crescent, trapezoid)))))))))), float(0), float(0), float(1));
|
|
235
|
-
};
|
|
236
|
-
return applyEmbossEffect(childTexture, sdfSampler, uniforms);
|
|
237
|
-
}
|
|
186
|
+
else return applyEmbossEffect(childTexture, createAnalyticSdfSampler(uniforms.shapeType.uniform.value || initialConfig.type || "circleSDF", initialConfig, uniforms.shape, onBeforeRender), uniforms);
|
|
238
187
|
}
|
|
239
188
|
};
|
|
240
189
|
var Emboss_default = componentDefinition;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as transformColor, l as transformPosition, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-BPpDnR5I.js";
|
|
3
|
-
import {
|
|
3
|
+
import { s as flowerSdf } from "./sdf-CZRX0uur.js";
|
|
4
4
|
import { cos, float, screenUV, sin, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
5
5
|
var transformStrokePosition = (value) => {
|
|
6
6
|
return {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as transformColor, l as transformPosition } from "./transformations-B5lM6fYX.js";
|
|
2
|
-
import {
|
|
3
|
-
import { Fn, clamp, convertToTexture, cos, dot, exp2, float, max, mix, pow, screenUV, sin, smoothstep, sqrt,
|
|
2
|
+
import { n as createAnalyticSdfSampler, r as createSvgSdfSampler } from "./sdf-CZRX0uur.js";
|
|
3
|
+
import { Fn, clamp, convertToTexture, cos, dot, exp2, float, max, mix, pow, screenUV, sin, smoothstep, sqrt, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
var GOLDEN_ANGLE = 2.3999632297286535;
|
|
5
|
-
var BLUR_SAMPLE_COUNT =
|
|
5
|
+
var BLUR_SAMPLE_COUNT = 9;
|
|
6
6
|
const BLUR_DISK = [];
|
|
7
7
|
for (let i = 0; i < BLUR_SAMPLE_COUNT; i++) {
|
|
8
8
|
const angle = i * GOLDEN_ANGLE;
|
|
@@ -334,6 +334,11 @@ const componentDefinition = {
|
|
|
334
334
|
default: "",
|
|
335
335
|
compileTime: true,
|
|
336
336
|
description: "URL to a pre-generated SDF .bin file — when non-empty, activates SVG mode and triggers a shader recompile"
|
|
337
|
+
},
|
|
338
|
+
shapeType: {
|
|
339
|
+
default: "",
|
|
340
|
+
compileTime: true,
|
|
341
|
+
description: "Active SDF shape type — triggers recompile when shape is switched. When empty, derived from shape JSON at mount time."
|
|
337
342
|
}
|
|
338
343
|
},
|
|
339
344
|
fragmentNode: ({ uniforms, childNode, onCleanup, onBeforeRender }) => {
|
|
@@ -344,8 +349,10 @@ const componentDefinition = {
|
|
|
344
349
|
});
|
|
345
350
|
const shapeSdfUrl = uniforms.shapeSdfUrl.uniform.value;
|
|
346
351
|
const initialConfig = (() => {
|
|
352
|
+
const val = uniforms.shape.uniform.value;
|
|
353
|
+
if (typeof val === "object" && val !== null) return val;
|
|
347
354
|
try {
|
|
348
|
-
return JSON.parse(
|
|
355
|
+
return JSON.parse(val);
|
|
349
356
|
} catch {
|
|
350
357
|
return {
|
|
351
358
|
type: "circleSDF",
|
|
@@ -356,65 +363,7 @@ const componentDefinition = {
|
|
|
356
363
|
}
|
|
357
364
|
})();
|
|
358
365
|
if (shapeSdfUrl) return applyGlassEffect(childTexture, createSvgSdfSampler(shapeSdfUrl, onBeforeRender, onCleanup), uniforms);
|
|
359
|
-
else
|
|
360
|
-
const SHAPE_MODES = {
|
|
361
|
-
circleSDF: 0,
|
|
362
|
-
polygonSDF: 1,
|
|
363
|
-
flowerSDF: 2,
|
|
364
|
-
ringSDF: 3,
|
|
365
|
-
crossSDF: 4,
|
|
366
|
-
starSDF: 5,
|
|
367
|
-
roundedRectSDF: 6,
|
|
368
|
-
ellipseSDF: 7,
|
|
369
|
-
vesicaSDF: 8,
|
|
370
|
-
crescentSDF: 9,
|
|
371
|
-
trapezoidSDF: 10
|
|
372
|
-
};
|
|
373
|
-
const radiusU = uniform(initialConfig.radius ?? .35);
|
|
374
|
-
const sidesU = uniform(initialConfig.sides ?? 6);
|
|
375
|
-
const roundingU = uniform(initialConfig.rounding ?? 0);
|
|
376
|
-
const innerRatioU = uniform(initialConfig.innerRatio ?? initialConfig.thickness ?? .4);
|
|
377
|
-
const rotationU = uniform(initialConfig.rotation ?? 0);
|
|
378
|
-
const heightU = uniform(initialConfig.height ?? .25);
|
|
379
|
-
const offsetU = uniform(initialConfig.offset ?? .2);
|
|
380
|
-
const shapeModeU = uniform(SHAPE_MODES[initialConfig.type] ?? 0);
|
|
381
|
-
onBeforeRender(() => {
|
|
382
|
-
try {
|
|
383
|
-
const cfg = JSON.parse(uniforms.shape.uniform.value);
|
|
384
|
-
radiusU.value = cfg.radius ?? cfg.width ?? cfg.bottomWidth ?? .35;
|
|
385
|
-
sidesU.value = cfg.sides ?? 6;
|
|
386
|
-
roundingU.value = cfg.rounding ?? 0;
|
|
387
|
-
innerRatioU.value = cfg.innerRatio ?? cfg.thickness ?? cfg.spread ?? cfg.topWidth ?? cfg.topRatio ?? .4;
|
|
388
|
-
rotationU.value = cfg.rotation ?? 0;
|
|
389
|
-
heightU.value = cfg.height ?? .25;
|
|
390
|
-
offsetU.value = cfg.offset ?? .2;
|
|
391
|
-
shapeModeU.value = SHAPE_MODES[cfg.type] ?? 0;
|
|
392
|
-
} catch {}
|
|
393
|
-
});
|
|
394
|
-
const sdfSampler = (uv$1) => {
|
|
395
|
-
const dx = uv$1.x.sub(float(.5));
|
|
396
|
-
const dy = uv$1.y.sub(float(.5));
|
|
397
|
-
const rotRad = rotationU.mul(float(Math.PI / 180));
|
|
398
|
-
const cosR = cos(rotRad);
|
|
399
|
-
const sinR = sin(rotRad);
|
|
400
|
-
const rdx = dx.mul(cosR).add(dy.mul(sinR));
|
|
401
|
-
const rdy = dy.mul(cosR).sub(dx.mul(sinR));
|
|
402
|
-
const circle = circleSdf(dx, dy, radiusU);
|
|
403
|
-
const polygon = mix(polygonSdf(rdx, rdy, radiusU, sidesU), circle, roundingU);
|
|
404
|
-
const flower = flowerSdf(rdx, rdy, radiusU, sidesU, innerRatioU);
|
|
405
|
-
const ring = ringSdf(dx, dy, radiusU, innerRatioU);
|
|
406
|
-
const cross = crossSdf(rdx, rdy, radiusU, innerRatioU, roundingU);
|
|
407
|
-
const star = starSdf(rdx, rdy, radiusU, sidesU, innerRatioU);
|
|
408
|
-
const roundedRect = roundedRectSdf(rdx, rdy, radiusU, heightU, roundingU);
|
|
409
|
-
const ellipse = ellipseSdf(rdx, rdy, radiusU, heightU);
|
|
410
|
-
const vesica = vesicaSdf(rdx, rdy, radiusU, innerRatioU);
|
|
411
|
-
const crescent = crescentSdf(rdx, rdy, radiusU, innerRatioU, offsetU);
|
|
412
|
-
const trapezoid = trapezoidSdf(rdx, rdy, innerRatioU, radiusU, heightU);
|
|
413
|
-
const m = shapeModeU;
|
|
414
|
-
return vec4(m.lessThan(float(.5)).select(circle, m.lessThan(float(1.5)).select(polygon, m.lessThan(float(2.5)).select(flower, m.lessThan(float(3.5)).select(ring, m.lessThan(float(4.5)).select(cross, m.lessThan(float(5.5)).select(star, m.lessThan(float(6.5)).select(roundedRect, m.lessThan(float(7.5)).select(ellipse, m.lessThan(float(8.5)).select(vesica, m.lessThan(float(9.5)).select(crescent, trapezoid)))))))))), float(0), float(0), float(1));
|
|
415
|
-
};
|
|
416
|
-
return applyGlassEffect(childTexture, sdfSampler, uniforms);
|
|
417
|
-
}
|
|
366
|
+
else return applyGlassEffect(childTexture, createAnalyticSdfSampler(uniforms.shapeType.uniform.value || initialConfig.type || "circleSDF", initialConfig, uniforms.shape, onBeforeRender), uniforms);
|
|
418
367
|
}
|
|
419
368
|
};
|
|
420
369
|
var Glass_default = componentDefinition;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as transformColor, l as transformPosition } from "./transformations-B5lM6fYX.js";
|
|
2
|
-
import {
|
|
2
|
+
import { n as createAnalyticSdfSampler, r as createSvgSdfSampler } from "./sdf-CZRX0uur.js";
|
|
3
3
|
import { Fn, atan, clamp, cos, exp, exp2, float, max, mix, pow, screenUV, sin, smoothstep, sqrt, uniform, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
var _LZ = .7;
|
|
5
5
|
var _INV_LIGHT_LEN = 1 / Math.sqrt(1 + _LZ * _LZ);
|
|
@@ -332,6 +332,11 @@ const componentDefinition = {
|
|
|
332
332
|
default: "",
|
|
333
333
|
compileTime: true,
|
|
334
334
|
description: "URL to a pre-generated SDF .bin file — when non-empty, activates SVG mode and triggers a shader recompile"
|
|
335
|
+
},
|
|
336
|
+
shapeType: {
|
|
337
|
+
default: "",
|
|
338
|
+
compileTime: true,
|
|
339
|
+
description: "Active SDF shape type — triggers recompile when shape is switched. When empty, derived from shape JSON at mount time."
|
|
335
340
|
}
|
|
336
341
|
},
|
|
337
342
|
fragmentNode: ({ uniforms, onCleanup, onBeforeRender }) => {
|
|
@@ -341,8 +346,10 @@ const componentDefinition = {
|
|
|
341
346
|
});
|
|
342
347
|
const shapeSdfUrl = uniforms.shapeSdfUrl.uniform.value;
|
|
343
348
|
const initialConfig = (() => {
|
|
349
|
+
const val = uniforms.shape.uniform.value;
|
|
350
|
+
if (typeof val === "object" && val !== null) return val;
|
|
344
351
|
try {
|
|
345
|
-
return JSON.parse(
|
|
352
|
+
return JSON.parse(val);
|
|
346
353
|
} catch {
|
|
347
354
|
return {
|
|
348
355
|
type: "circleSDF",
|
|
@@ -353,65 +360,7 @@ const componentDefinition = {
|
|
|
353
360
|
}
|
|
354
361
|
})();
|
|
355
362
|
if (shapeSdfUrl) return applyNeonEffect(createSvgSdfSampler(shapeSdfUrl, onBeforeRender, onCleanup), uniforms, timeU);
|
|
356
|
-
else
|
|
357
|
-
const SHAPE_MODES = {
|
|
358
|
-
circleSDF: 0,
|
|
359
|
-
polygonSDF: 1,
|
|
360
|
-
flowerSDF: 2,
|
|
361
|
-
ringSDF: 3,
|
|
362
|
-
crossSDF: 4,
|
|
363
|
-
starSDF: 5,
|
|
364
|
-
roundedRectSDF: 6,
|
|
365
|
-
ellipseSDF: 7,
|
|
366
|
-
vesicaSDF: 8,
|
|
367
|
-
crescentSDF: 9,
|
|
368
|
-
trapezoidSDF: 10
|
|
369
|
-
};
|
|
370
|
-
const radiusU = uniform(initialConfig.radius ?? .35);
|
|
371
|
-
const sidesU = uniform(initialConfig.sides ?? 6);
|
|
372
|
-
const roundingU = uniform(initialConfig.rounding ?? 0);
|
|
373
|
-
const innerRatioU = uniform(initialConfig.innerRatio ?? initialConfig.thickness ?? .4);
|
|
374
|
-
const rotationU = uniform(initialConfig.rotation ?? 0);
|
|
375
|
-
const heightU = uniform(initialConfig.height ?? .25);
|
|
376
|
-
const offsetU = uniform(initialConfig.offset ?? .2);
|
|
377
|
-
const shapeModeU = uniform(SHAPE_MODES[initialConfig.type] ?? 0);
|
|
378
|
-
onBeforeRender(() => {
|
|
379
|
-
try {
|
|
380
|
-
const cfg = JSON.parse(uniforms.shape.uniform.value);
|
|
381
|
-
radiusU.value = cfg.radius ?? cfg.width ?? cfg.bottomWidth ?? .35;
|
|
382
|
-
sidesU.value = cfg.sides ?? 6;
|
|
383
|
-
roundingU.value = cfg.rounding ?? 0;
|
|
384
|
-
innerRatioU.value = cfg.innerRatio ?? cfg.thickness ?? cfg.spread ?? cfg.topWidth ?? cfg.topRatio ?? .4;
|
|
385
|
-
rotationU.value = cfg.rotation ?? 0;
|
|
386
|
-
heightU.value = cfg.height ?? .25;
|
|
387
|
-
offsetU.value = cfg.offset ?? .2;
|
|
388
|
-
shapeModeU.value = SHAPE_MODES[cfg.type] ?? 0;
|
|
389
|
-
} catch {}
|
|
390
|
-
});
|
|
391
|
-
const sdfSampler = (uv$1) => {
|
|
392
|
-
const dx = uv$1.x.sub(float(.5));
|
|
393
|
-
const dy = uv$1.y.sub(float(.5));
|
|
394
|
-
const rotRad = rotationU.mul(float(Math.PI / 180));
|
|
395
|
-
const cosR = cos(rotRad);
|
|
396
|
-
const sinR = sin(rotRad);
|
|
397
|
-
const rdx = dx.mul(cosR).add(dy.mul(sinR));
|
|
398
|
-
const rdy = dy.mul(cosR).sub(dx.mul(sinR));
|
|
399
|
-
const circle = circleSdf(dx, dy, radiusU);
|
|
400
|
-
const polygon = mix(polygonSdf(rdx, rdy, radiusU, sidesU), circle, roundingU);
|
|
401
|
-
const flower = flowerSdf(rdx, rdy, radiusU, sidesU, innerRatioU);
|
|
402
|
-
const ring = ringSdf(dx, dy, radiusU, innerRatioU);
|
|
403
|
-
const cross = crossSdf(rdx, rdy, radiusU, innerRatioU, roundingU);
|
|
404
|
-
const star = starSdf(rdx, rdy, radiusU, sidesU, innerRatioU);
|
|
405
|
-
const roundedRect = roundedRectSdf(rdx, rdy, radiusU, heightU, roundingU);
|
|
406
|
-
const ellipse = ellipseSdf(rdx, rdy, radiusU, heightU);
|
|
407
|
-
const vesica = vesicaSdf(rdx, rdy, radiusU, innerRatioU);
|
|
408
|
-
const crescent = crescentSdf(rdx, rdy, radiusU, innerRatioU, offsetU);
|
|
409
|
-
const trapezoid = trapezoidSdf(rdx, rdy, innerRatioU, radiusU, heightU);
|
|
410
|
-
const m = shapeModeU;
|
|
411
|
-
return vec4(m.lessThan(float(.5)).select(circle, m.lessThan(float(1.5)).select(polygon, m.lessThan(float(2.5)).select(flower, m.lessThan(float(3.5)).select(ring, m.lessThan(float(4.5)).select(cross, m.lessThan(float(5.5)).select(star, m.lessThan(float(6.5)).select(roundedRect, m.lessThan(float(7.5)).select(ellipse, m.lessThan(float(8.5)).select(vesica, m.lessThan(float(9.5)).select(crescent, trapezoid)))))))))), float(0), float(0), float(1));
|
|
412
|
-
};
|
|
413
|
-
return applyNeonEffect(sdfSampler, uniforms, timeU);
|
|
414
|
-
}
|
|
363
|
+
else return applyNeonEffect(createAnalyticSdfSampler(uniforms.shapeType.uniform.value || initialConfig.type || "circleSDF", initialConfig, uniforms.shape, onBeforeRender), uniforms, timeU);
|
|
415
364
|
}
|
|
416
365
|
};
|
|
417
366
|
var Neon_default = componentDefinition;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as transformColor, l as transformPosition, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-BPpDnR5I.js";
|
|
3
|
-
import {
|
|
3
|
+
import { c as polygonSdf, t as circleSdf } from "./sdf-CZRX0uur.js";
|
|
4
4
|
import { cos, float, mix, screenUV, sin, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
5
5
|
var transformStrokePosition = (value) => {
|
|
6
6
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as transformColor, l as transformPosition, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-BPpDnR5I.js";
|
|
3
|
-
import {
|
|
3
|
+
import { l as ringSdf } from "./sdf-CZRX0uur.js";
|
|
4
4
|
import { float, screenUV, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
5
5
|
var transformStrokePosition = (value) => {
|
|
6
6
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as transformColor, l as transformPosition, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-BPpDnR5I.js";
|
|
3
|
-
import {
|
|
3
|
+
import { u as roundedRectSdf } from "./sdf-CZRX0uur.js";
|
|
4
4
|
import { cos, float, screenUV, sin, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
5
5
|
var transformStrokePosition = (value) => {
|
|
6
6
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as transformColor, l as transformPosition, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-BPpDnR5I.js";
|
|
3
|
-
import {
|
|
3
|
+
import { d as starSdf } from "./sdf-CZRX0uur.js";
|
|
4
4
|
import { cos, float, screenUV, sin, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
5
5
|
var transformStrokePosition = (value) => {
|
|
6
6
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as transformColor, l as transformPosition, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-BPpDnR5I.js";
|
|
3
|
-
import {
|
|
3
|
+
import { f as trapezoidSdf } from "./sdf-CZRX0uur.js";
|
|
4
4
|
import { cos, float, screenUV, sin, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
5
5
|
var transformStrokePosition = (value) => {
|
|
6
6
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as transformColor, l as transformPosition, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-BPpDnR5I.js";
|
|
3
|
-
import {
|
|
3
|
+
import { p as vesicaSdf } from "./sdf-CZRX0uur.js";
|
|
4
4
|
import { cos, float, screenUV, sin, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
5
5
|
var transformStrokePosition = (value) => {
|
|
6
6
|
return {
|
package/dist/core/index.js
CHANGED
|
@@ -18,9 +18,9 @@ import "./ChromaticAberration-G8_bwQtD.js";
|
|
|
18
18
|
import "./Circle--0oHzoCi.js";
|
|
19
19
|
import "./ConcentricSpin-BzxzMieZ.js";
|
|
20
20
|
import "./ContourLines-yEb5IJ1Y.js";
|
|
21
|
-
import "./sdf-
|
|
22
|
-
import "./Crescent-
|
|
23
|
-
import "./Cross-
|
|
21
|
+
import "./sdf-CZRX0uur.js";
|
|
22
|
+
import "./Crescent-DnFexzlT.js";
|
|
23
|
+
import "./Cross-rsVMygBv.js";
|
|
24
24
|
import "./CRTScreen-BZ-sAmPZ.js";
|
|
25
25
|
import "./CursorRipples-BY1iu4MX.js";
|
|
26
26
|
import "./CursorTrail-BzrL2WMh.js";
|
|
@@ -28,16 +28,16 @@ import "./DiffuseBlur-Dyd42LXw.js";
|
|
|
28
28
|
import "./Dither-CTInG_SB.js";
|
|
29
29
|
import "./DotGrid-CsL0dnYB.js";
|
|
30
30
|
import "./Duotone-BbCFLFMK.js";
|
|
31
|
-
import "./Ellipse-
|
|
32
|
-
import "./Emboss-
|
|
31
|
+
import "./Ellipse-CZWtvB3q.js";
|
|
32
|
+
import "./Emboss-DCKgs4_G.js";
|
|
33
33
|
import "./FallingLines-DBNJVWio.js";
|
|
34
34
|
import "./FilmGrain-CSuerGc6.js";
|
|
35
35
|
import "./FloatingParticles-CoBM_CJ8.js";
|
|
36
|
-
import "./Flower-
|
|
36
|
+
import "./Flower-fYEx6ZSB.js";
|
|
37
37
|
import "./FlowField-Bh3-dX6I.js";
|
|
38
38
|
import "./FlowingGradient-DVproCI1.js";
|
|
39
39
|
import "./Form3D-DhezVuyN.js";
|
|
40
|
-
import "./Glass-
|
|
40
|
+
import "./Glass-BioLeiH6.js";
|
|
41
41
|
import "./GlassTiles-ClrOIpCg.js";
|
|
42
42
|
import "./Glitch-DmWytiRl.js";
|
|
43
43
|
import "./Glow-Dm4dfZ_m.js";
|
|
@@ -56,20 +56,20 @@ import "./LinearBlur-AR65FcZh.js";
|
|
|
56
56
|
import "./LinearGradient-DXCXjS-K.js";
|
|
57
57
|
import "./Liquify-mhzPd19o.js";
|
|
58
58
|
import "./Mirror-CSc5mJi1.js";
|
|
59
|
-
import "./Neon-
|
|
59
|
+
import "./Neon-uXetpVop.js";
|
|
60
60
|
import "./Paper-DfUka0dt.js";
|
|
61
61
|
import "./Perspective-uPiPmWy_.js";
|
|
62
62
|
import "./Pixelate-DRkAW4Lo.js";
|
|
63
63
|
import "./Plasma-ELzbK-Us.js";
|
|
64
64
|
import "./PolarCoordinates-CalS_TB6.js";
|
|
65
|
-
import "./Polygon-
|
|
65
|
+
import "./Polygon-7mzxbJeF.js";
|
|
66
66
|
import "./Posterize-C4vtRmtA.js";
|
|
67
67
|
import "./ProgressiveBlur-CLYhfOvQ.js";
|
|
68
68
|
import "./RadialGradient-DtD8HWdM.js";
|
|
69
69
|
import "./RectangularCoordinates-B96mflF5.js";
|
|
70
|
-
import "./Ring-
|
|
70
|
+
import "./Ring-H6B01ZMz.js";
|
|
71
71
|
import "./Ripples-Cevf-Hvg.js";
|
|
72
|
-
import "./RoundedRect-
|
|
72
|
+
import "./RoundedRect-OszKdYVD.js";
|
|
73
73
|
import "./Saturation-CcDwPh2v.js";
|
|
74
74
|
import "./Sharpness-D_dXfDEo.js";
|
|
75
75
|
import "./Shatter-NfZzVt54.js";
|
|
@@ -78,7 +78,7 @@ import "./SineWave-CVeYx3n-.js";
|
|
|
78
78
|
import "./SolidColor-BdbBnLxX.js";
|
|
79
79
|
import "./Spherize-BRGwLGeu.js";
|
|
80
80
|
import "./Spiral-BkTBXb7z.js";
|
|
81
|
-
import "./Star-
|
|
81
|
+
import "./Star-CyjNgJVp.js";
|
|
82
82
|
import "./Strands-Cjsw-cPu.js";
|
|
83
83
|
import "./Stretch-9cta3Z1W.js";
|
|
84
84
|
import "./Stripes-C0sCGCz_.js";
|
|
@@ -86,17 +86,17 @@ import "./StudioBackground-BYv_-8df.js";
|
|
|
86
86
|
import "./Swirl-DXjIXfy7.js";
|
|
87
87
|
import "./TiltShift-56lcZ4cJ.js";
|
|
88
88
|
import "./Tint-8_WIy9_e.js";
|
|
89
|
-
import "./Trapezoid-
|
|
89
|
+
import "./Trapezoid-SuI0dRgI.js";
|
|
90
90
|
import "./Tritone-nyJyybHI.js";
|
|
91
91
|
import "./Twirl-BzSEz4xK.js";
|
|
92
|
-
import "./Vesica-
|
|
92
|
+
import "./Vesica-Cj--pgNW.js";
|
|
93
93
|
import "./Vibrance-BETLN3Ie.js";
|
|
94
94
|
import "./browser-CqdrcD5J.js";
|
|
95
95
|
import "./VideoTexture-Dbsbgb1Y.js";
|
|
96
96
|
import "./WaveDistortion-C-j597Jm.js";
|
|
97
97
|
import "./WebcamTexture-xvb8MuFz.js";
|
|
98
98
|
import "./ZoomBlur-DFw0J9x3.js";
|
|
99
|
-
import { t as getAllShaders } from "./shaderRegistry-
|
|
99
|
+
import { t as getAllShaders } from "./shaderRegistry-ClxU5BC7.js";
|
|
100
100
|
import { Material, Mesh, MeshBasicNodeMaterial, OrthographicCamera, PlaneGeometry, SRGBColorSpace, Scene, Vector2, WebGPURenderer } from "three/webgpu";
|
|
101
101
|
import { WebGLRenderer } from "three";
|
|
102
102
|
import { PI, abs, add, atan, clamp, convertToTexture, cos, div, dot, float, fract, max, min, mix, mul, pow, screenUV, sign, sin, smoothstep, sqrt, step, sub, time, uniform, uv, vec2, vec3, vec4 } from "three/tsl";
|
package/dist/core/registry.js
CHANGED
|
@@ -18,9 +18,9 @@ import "./ChromaticAberration-G8_bwQtD.js";
|
|
|
18
18
|
import "./Circle--0oHzoCi.js";
|
|
19
19
|
import "./ConcentricSpin-BzxzMieZ.js";
|
|
20
20
|
import "./ContourLines-yEb5IJ1Y.js";
|
|
21
|
-
import "./sdf-
|
|
22
|
-
import "./Crescent-
|
|
23
|
-
import "./Cross-
|
|
21
|
+
import "./sdf-CZRX0uur.js";
|
|
22
|
+
import "./Crescent-DnFexzlT.js";
|
|
23
|
+
import "./Cross-rsVMygBv.js";
|
|
24
24
|
import "./CRTScreen-BZ-sAmPZ.js";
|
|
25
25
|
import "./CursorRipples-BY1iu4MX.js";
|
|
26
26
|
import "./CursorTrail-BzrL2WMh.js";
|
|
@@ -28,16 +28,16 @@ import "./DiffuseBlur-Dyd42LXw.js";
|
|
|
28
28
|
import "./Dither-CTInG_SB.js";
|
|
29
29
|
import "./DotGrid-CsL0dnYB.js";
|
|
30
30
|
import "./Duotone-BbCFLFMK.js";
|
|
31
|
-
import "./Ellipse-
|
|
32
|
-
import "./Emboss-
|
|
31
|
+
import "./Ellipse-CZWtvB3q.js";
|
|
32
|
+
import "./Emboss-DCKgs4_G.js";
|
|
33
33
|
import "./FallingLines-DBNJVWio.js";
|
|
34
34
|
import "./FilmGrain-CSuerGc6.js";
|
|
35
35
|
import "./FloatingParticles-CoBM_CJ8.js";
|
|
36
|
-
import "./Flower-
|
|
36
|
+
import "./Flower-fYEx6ZSB.js";
|
|
37
37
|
import "./FlowField-Bh3-dX6I.js";
|
|
38
38
|
import "./FlowingGradient-DVproCI1.js";
|
|
39
39
|
import "./Form3D-DhezVuyN.js";
|
|
40
|
-
import "./Glass-
|
|
40
|
+
import "./Glass-BioLeiH6.js";
|
|
41
41
|
import "./GlassTiles-ClrOIpCg.js";
|
|
42
42
|
import "./Glitch-DmWytiRl.js";
|
|
43
43
|
import "./Glow-Dm4dfZ_m.js";
|
|
@@ -56,20 +56,20 @@ import "./LinearBlur-AR65FcZh.js";
|
|
|
56
56
|
import "./LinearGradient-DXCXjS-K.js";
|
|
57
57
|
import "./Liquify-mhzPd19o.js";
|
|
58
58
|
import "./Mirror-CSc5mJi1.js";
|
|
59
|
-
import "./Neon-
|
|
59
|
+
import "./Neon-uXetpVop.js";
|
|
60
60
|
import "./Paper-DfUka0dt.js";
|
|
61
61
|
import "./Perspective-uPiPmWy_.js";
|
|
62
62
|
import "./Pixelate-DRkAW4Lo.js";
|
|
63
63
|
import "./Plasma-ELzbK-Us.js";
|
|
64
64
|
import "./PolarCoordinates-CalS_TB6.js";
|
|
65
|
-
import "./Polygon-
|
|
65
|
+
import "./Polygon-7mzxbJeF.js";
|
|
66
66
|
import "./Posterize-C4vtRmtA.js";
|
|
67
67
|
import "./ProgressiveBlur-CLYhfOvQ.js";
|
|
68
68
|
import "./RadialGradient-DtD8HWdM.js";
|
|
69
69
|
import "./RectangularCoordinates-B96mflF5.js";
|
|
70
|
-
import "./Ring-
|
|
70
|
+
import "./Ring-H6B01ZMz.js";
|
|
71
71
|
import "./Ripples-Cevf-Hvg.js";
|
|
72
|
-
import "./RoundedRect-
|
|
72
|
+
import "./RoundedRect-OszKdYVD.js";
|
|
73
73
|
import "./Saturation-CcDwPh2v.js";
|
|
74
74
|
import "./Sharpness-D_dXfDEo.js";
|
|
75
75
|
import "./Shatter-NfZzVt54.js";
|
|
@@ -78,7 +78,7 @@ import "./SineWave-CVeYx3n-.js";
|
|
|
78
78
|
import "./SolidColor-BdbBnLxX.js";
|
|
79
79
|
import "./Spherize-BRGwLGeu.js";
|
|
80
80
|
import "./Spiral-BkTBXb7z.js";
|
|
81
|
-
import "./Star-
|
|
81
|
+
import "./Star-CyjNgJVp.js";
|
|
82
82
|
import "./Strands-Cjsw-cPu.js";
|
|
83
83
|
import "./Stretch-9cta3Z1W.js";
|
|
84
84
|
import "./Stripes-C0sCGCz_.js";
|
|
@@ -86,15 +86,15 @@ import "./StudioBackground-BYv_-8df.js";
|
|
|
86
86
|
import "./Swirl-DXjIXfy7.js";
|
|
87
87
|
import "./TiltShift-56lcZ4cJ.js";
|
|
88
88
|
import "./Tint-8_WIy9_e.js";
|
|
89
|
-
import "./Trapezoid-
|
|
89
|
+
import "./Trapezoid-SuI0dRgI.js";
|
|
90
90
|
import "./Tritone-nyJyybHI.js";
|
|
91
91
|
import "./Twirl-BzSEz4xK.js";
|
|
92
|
-
import "./Vesica-
|
|
92
|
+
import "./Vesica-Cj--pgNW.js";
|
|
93
93
|
import "./Vibrance-BETLN3Ie.js";
|
|
94
94
|
import "./browser-CqdrcD5J.js";
|
|
95
95
|
import "./VideoTexture-Dbsbgb1Y.js";
|
|
96
96
|
import "./WaveDistortion-C-j597Jm.js";
|
|
97
97
|
import "./WebcamTexture-xvb8MuFz.js";
|
|
98
98
|
import "./ZoomBlur-DFw0J9x3.js";
|
|
99
|
-
import { a as shaderRegistry, i as getShadersByCategory, n as getShaderByName, r as getShaderCategories, t as getAllShaders } from "./shaderRegistry-
|
|
99
|
+
import { a as shaderRegistry, i as getShadersByCategory, n as getShaderByName, r as getShaderCategories, t as getAllShaders } from "./shaderRegistry-ClxU5BC7.js";
|
|
100
100
|
export { getAllShaders, getShaderByName, getShaderCategories, getShadersByCategory, shaderRegistry };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataTexture, FloatType, LinearFilter, RedFormat } from "three";
|
|
2
|
-
import { abs, atan, cos, float, floor, max, min, sign, sin, sqrt, texture } from "three/tsl";
|
|
2
|
+
import { abs, atan, cos, float, floor, max, min, mix, sign, sin, sqrt, texture, uniform, vec4 } from "three/tsl";
|
|
3
3
|
function circleSdf(dx, dy, radius) {
|
|
4
4
|
return sqrt(dx.mul(dx).add(dy.mul(dy))).sub(radius);
|
|
5
5
|
}
|
|
@@ -148,4 +148,88 @@ function createSvgSdfSampler(shapeSdfUrl, onBeforeRender, onCleanup) {
|
|
|
148
148
|
const sdfNode = texture(sdfTexture);
|
|
149
149
|
return (uv$1) => sdfNode.sample(uv$1);
|
|
150
150
|
}
|
|
151
|
-
|
|
151
|
+
function createAnalyticSdfSampler(shapeType, initialConfig, shapeUniform, onBeforeRender) {
|
|
152
|
+
const radiusU = uniform(initialConfig.radius ?? .35);
|
|
153
|
+
const sidesU = uniform(initialConfig.sides ?? 6);
|
|
154
|
+
const roundingU = uniform(initialConfig.rounding ?? 0);
|
|
155
|
+
const innerRatioU = uniform(initialConfig.innerRatio ?? initialConfig.thickness ?? .4);
|
|
156
|
+
const rotationU = uniform(initialConfig.rotation ?? 0);
|
|
157
|
+
const heightU = uniform(initialConfig.height ?? .25);
|
|
158
|
+
const offsetU = uniform(initialConfig.offset ?? .2);
|
|
159
|
+
let lastShapeJson = "";
|
|
160
|
+
let lastCfg = initialConfig;
|
|
161
|
+
onBeforeRender(() => {
|
|
162
|
+
const raw = shapeUniform.uniform.value;
|
|
163
|
+
if (typeof raw === "object" && raw !== null) lastCfg = raw;
|
|
164
|
+
else {
|
|
165
|
+
const str = raw;
|
|
166
|
+
if (str !== lastShapeJson) {
|
|
167
|
+
lastShapeJson = str;
|
|
168
|
+
try {
|
|
169
|
+
lastCfg = JSON.parse(str);
|
|
170
|
+
} catch {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
radiusU.value = lastCfg.radius ?? lastCfg.width ?? lastCfg.bottomWidth ?? .35;
|
|
176
|
+
sidesU.value = lastCfg.sides ?? 6;
|
|
177
|
+
roundingU.value = lastCfg.rounding ?? 0;
|
|
178
|
+
innerRatioU.value = lastCfg.innerRatio ?? lastCfg.thickness ?? lastCfg.spread ?? lastCfg.topWidth ?? lastCfg.topRatio ?? .4;
|
|
179
|
+
rotationU.value = lastCfg.rotation ?? 0;
|
|
180
|
+
heightU.value = lastCfg.height ?? .25;
|
|
181
|
+
offsetU.value = lastCfg.offset ?? .2;
|
|
182
|
+
});
|
|
183
|
+
const needsRotation = shapeType !== "circleSDF" && shapeType !== "ringSDF";
|
|
184
|
+
return (uv$1) => {
|
|
185
|
+
const dx = uv$1.x.sub(float(.5));
|
|
186
|
+
const dy = uv$1.y.sub(float(.5));
|
|
187
|
+
let rdx = dx, rdy = dy;
|
|
188
|
+
if (needsRotation) {
|
|
189
|
+
const rotRad = rotationU.mul(float(Math.PI / 180));
|
|
190
|
+
const cosR = cos(rotRad);
|
|
191
|
+
const sinR = sin(rotRad);
|
|
192
|
+
rdx = dx.mul(cosR).add(dy.mul(sinR));
|
|
193
|
+
rdy = dy.mul(cosR).sub(dx.mul(sinR));
|
|
194
|
+
}
|
|
195
|
+
let dist;
|
|
196
|
+
switch (shapeType) {
|
|
197
|
+
case "polygonSDF":
|
|
198
|
+
dist = mix(polygonSdf(rdx, rdy, radiusU, sidesU), circleSdf(dx, dy, radiusU), roundingU);
|
|
199
|
+
break;
|
|
200
|
+
case "flowerSDF":
|
|
201
|
+
dist = flowerSdf(rdx, rdy, radiusU, sidesU, innerRatioU);
|
|
202
|
+
break;
|
|
203
|
+
case "ringSDF":
|
|
204
|
+
dist = ringSdf(dx, dy, radiusU, innerRatioU);
|
|
205
|
+
break;
|
|
206
|
+
case "crossSDF":
|
|
207
|
+
dist = crossSdf(rdx, rdy, radiusU, innerRatioU, roundingU);
|
|
208
|
+
break;
|
|
209
|
+
case "starSDF":
|
|
210
|
+
dist = starSdf(rdx, rdy, radiusU, sidesU, innerRatioU);
|
|
211
|
+
break;
|
|
212
|
+
case "roundedRectSDF":
|
|
213
|
+
dist = roundedRectSdf(rdx, rdy, radiusU, heightU, roundingU);
|
|
214
|
+
break;
|
|
215
|
+
case "ellipseSDF":
|
|
216
|
+
dist = ellipseSdf(rdx, rdy, radiusU, heightU);
|
|
217
|
+
break;
|
|
218
|
+
case "vesicaSDF":
|
|
219
|
+
dist = vesicaSdf(rdx, rdy, radiusU, innerRatioU);
|
|
220
|
+
break;
|
|
221
|
+
case "crescentSDF":
|
|
222
|
+
dist = crescentSdf(rdx, rdy, radiusU, innerRatioU, offsetU);
|
|
223
|
+
break;
|
|
224
|
+
case "trapezoidSDF":
|
|
225
|
+
dist = trapezoidSdf(rdx, rdy, innerRatioU, radiusU, heightU);
|
|
226
|
+
break;
|
|
227
|
+
case "circleSDF":
|
|
228
|
+
default:
|
|
229
|
+
dist = circleSdf(dx, dy, radiusU);
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
return vec4(dist, float(0), float(0), float(1));
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
export { crossSdf as a, polygonSdf as c, starSdf as d, trapezoidSdf as f, crescentSdf as i, ringSdf as l, createAnalyticSdfSampler as n, ellipseSdf as o, vesicaSdf as p, createSvgSdfSampler as r, flowerSdf as s, circleSdf as t, roundedRectSdf as u };
|
|
@@ -13,8 +13,8 @@ import { n as componentDefinition$11 } from "./ChromaticAberration-G8_bwQtD.js";
|
|
|
13
13
|
import { n as componentDefinition$12 } from "./Circle--0oHzoCi.js";
|
|
14
14
|
import { n as componentDefinition$13 } from "./ConcentricSpin-BzxzMieZ.js";
|
|
15
15
|
import { n as componentDefinition$14 } from "./ContourLines-yEb5IJ1Y.js";
|
|
16
|
-
import { n as componentDefinition$15 } from "./Crescent-
|
|
17
|
-
import { n as componentDefinition$16 } from "./Cross-
|
|
16
|
+
import { n as componentDefinition$15 } from "./Crescent-DnFexzlT.js";
|
|
17
|
+
import { n as componentDefinition$16 } from "./Cross-rsVMygBv.js";
|
|
18
18
|
import { n as componentDefinition$17 } from "./CRTScreen-BZ-sAmPZ.js";
|
|
19
19
|
import { n as componentDefinition$18 } from "./CursorRipples-BY1iu4MX.js";
|
|
20
20
|
import { n as componentDefinition$19 } from "./CursorTrail-BzrL2WMh.js";
|
|
@@ -22,16 +22,16 @@ import { n as componentDefinition$20 } from "./DiffuseBlur-Dyd42LXw.js";
|
|
|
22
22
|
import { n as componentDefinition$21 } from "./Dither-CTInG_SB.js";
|
|
23
23
|
import { n as componentDefinition$22 } from "./DotGrid-CsL0dnYB.js";
|
|
24
24
|
import { n as componentDefinition$23 } from "./Duotone-BbCFLFMK.js";
|
|
25
|
-
import { n as componentDefinition$24 } from "./Ellipse-
|
|
26
|
-
import { n as componentDefinition$25 } from "./Emboss-
|
|
25
|
+
import { n as componentDefinition$24 } from "./Ellipse-CZWtvB3q.js";
|
|
26
|
+
import { n as componentDefinition$25 } from "./Emboss-DCKgs4_G.js";
|
|
27
27
|
import { n as componentDefinition$26 } from "./FallingLines-DBNJVWio.js";
|
|
28
28
|
import { n as componentDefinition$27 } from "./FilmGrain-CSuerGc6.js";
|
|
29
29
|
import { n as componentDefinition$28 } from "./FloatingParticles-CoBM_CJ8.js";
|
|
30
|
-
import { n as componentDefinition$29 } from "./Flower-
|
|
30
|
+
import { n as componentDefinition$29 } from "./Flower-fYEx6ZSB.js";
|
|
31
31
|
import { n as componentDefinition$30 } from "./FlowField-Bh3-dX6I.js";
|
|
32
32
|
import { n as componentDefinition$31 } from "./FlowingGradient-DVproCI1.js";
|
|
33
33
|
import { n as componentDefinition$32 } from "./Form3D-DhezVuyN.js";
|
|
34
|
-
import { n as componentDefinition$33 } from "./Glass-
|
|
34
|
+
import { n as componentDefinition$33 } from "./Glass-BioLeiH6.js";
|
|
35
35
|
import { n as componentDefinition$34 } from "./GlassTiles-ClrOIpCg.js";
|
|
36
36
|
import { n as componentDefinition$35 } from "./Glitch-DmWytiRl.js";
|
|
37
37
|
import { n as componentDefinition$36 } from "./Glow-Dm4dfZ_m.js";
|
|
@@ -50,20 +50,20 @@ import { n as componentDefinition$48 } from "./LinearBlur-AR65FcZh.js";
|
|
|
50
50
|
import { n as componentDefinition$49 } from "./LinearGradient-DXCXjS-K.js";
|
|
51
51
|
import { n as componentDefinition$50 } from "./Liquify-mhzPd19o.js";
|
|
52
52
|
import { n as componentDefinition$51 } from "./Mirror-CSc5mJi1.js";
|
|
53
|
-
import { n as componentDefinition$52 } from "./Neon-
|
|
53
|
+
import { n as componentDefinition$52 } from "./Neon-uXetpVop.js";
|
|
54
54
|
import { n as componentDefinition$53 } from "./Paper-DfUka0dt.js";
|
|
55
55
|
import { n as componentDefinition$54 } from "./Perspective-uPiPmWy_.js";
|
|
56
56
|
import { n as componentDefinition$55 } from "./Pixelate-DRkAW4Lo.js";
|
|
57
57
|
import { n as componentDefinition$56 } from "./Plasma-ELzbK-Us.js";
|
|
58
58
|
import { n as componentDefinition$57 } from "./PolarCoordinates-CalS_TB6.js";
|
|
59
|
-
import { n as componentDefinition$58 } from "./Polygon-
|
|
59
|
+
import { n as componentDefinition$58 } from "./Polygon-7mzxbJeF.js";
|
|
60
60
|
import { n as componentDefinition$59 } from "./Posterize-C4vtRmtA.js";
|
|
61
61
|
import { n as componentDefinition$60 } from "./ProgressiveBlur-CLYhfOvQ.js";
|
|
62
62
|
import { n as componentDefinition$61 } from "./RadialGradient-DtD8HWdM.js";
|
|
63
63
|
import { n as componentDefinition$62 } from "./RectangularCoordinates-B96mflF5.js";
|
|
64
|
-
import { n as componentDefinition$63 } from "./Ring-
|
|
64
|
+
import { n as componentDefinition$63 } from "./Ring-H6B01ZMz.js";
|
|
65
65
|
import { n as componentDefinition$64 } from "./Ripples-Cevf-Hvg.js";
|
|
66
|
-
import { n as componentDefinition$65 } from "./RoundedRect-
|
|
66
|
+
import { n as componentDefinition$65 } from "./RoundedRect-OszKdYVD.js";
|
|
67
67
|
import { n as componentDefinition$66 } from "./Saturation-CcDwPh2v.js";
|
|
68
68
|
import { n as componentDefinition$67 } from "./Sharpness-D_dXfDEo.js";
|
|
69
69
|
import { n as componentDefinition$68 } from "./Shatter-NfZzVt54.js";
|
|
@@ -72,7 +72,7 @@ import { n as componentDefinition$70 } from "./SineWave-CVeYx3n-.js";
|
|
|
72
72
|
import { n as componentDefinition$71 } from "./SolidColor-BdbBnLxX.js";
|
|
73
73
|
import { n as componentDefinition$72 } from "./Spherize-BRGwLGeu.js";
|
|
74
74
|
import { n as componentDefinition$73 } from "./Spiral-BkTBXb7z.js";
|
|
75
|
-
import { n as componentDefinition$74 } from "./Star-
|
|
75
|
+
import { n as componentDefinition$74 } from "./Star-CyjNgJVp.js";
|
|
76
76
|
import { n as componentDefinition$75 } from "./Strands-Cjsw-cPu.js";
|
|
77
77
|
import { n as componentDefinition$76 } from "./Stretch-9cta3Z1W.js";
|
|
78
78
|
import { n as componentDefinition$77 } from "./Stripes-C0sCGCz_.js";
|
|
@@ -80,10 +80,10 @@ import { n as componentDefinition$78 } from "./StudioBackground-BYv_-8df.js";
|
|
|
80
80
|
import { n as componentDefinition$79 } from "./Swirl-DXjIXfy7.js";
|
|
81
81
|
import { n as componentDefinition$80 } from "./TiltShift-56lcZ4cJ.js";
|
|
82
82
|
import { n as componentDefinition$81 } from "./Tint-8_WIy9_e.js";
|
|
83
|
-
import { n as componentDefinition$82 } from "./Trapezoid-
|
|
83
|
+
import { n as componentDefinition$82 } from "./Trapezoid-SuI0dRgI.js";
|
|
84
84
|
import { n as componentDefinition$83 } from "./Tritone-nyJyybHI.js";
|
|
85
85
|
import { n as componentDefinition$84 } from "./Twirl-BzSEz4xK.js";
|
|
86
|
-
import { n as componentDefinition$85 } from "./Vesica-
|
|
86
|
+
import { n as componentDefinition$85 } from "./Vesica-Cj--pgNW.js";
|
|
87
87
|
import { n as componentDefinition$86 } from "./Vibrance-BETLN3Ie.js";
|
|
88
88
|
import { n as componentDefinition$87 } from "./VideoTexture-Dbsbgb1Y.js";
|
|
89
89
|
import { n as componentDefinition$88 } from "./WaveDistortion-C-j597Jm.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
|
-
import "../../sdf-
|
|
4
|
-
import { n as componentDefinition, t as Crescent_default } from "../../Crescent-
|
|
3
|
+
import "../../sdf-CZRX0uur.js";
|
|
4
|
+
import { n as componentDefinition, t as Crescent_default } from "../../Crescent-DnFexzlT.js";
|
|
5
5
|
export { componentDefinition, Crescent_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
|
-
import "../../sdf-
|
|
4
|
-
import { n as componentDefinition, t as Cross_default } from "../../Cross-
|
|
3
|
+
import "../../sdf-CZRX0uur.js";
|
|
4
|
+
import { n as componentDefinition, t as Cross_default } from "../../Cross-rsVMygBv.js";
|
|
5
5
|
export { componentDefinition, Cross_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
|
-
import "../../sdf-
|
|
4
|
-
import { n as componentDefinition, t as Ellipse_default } from "../../Ellipse-
|
|
3
|
+
import "../../sdf-CZRX0uur.js";
|
|
4
|
+
import { n as componentDefinition, t as Ellipse_default } from "../../Ellipse-CZWtvB3q.js";
|
|
5
5
|
export { componentDefinition, Ellipse_default as default };
|
|
@@ -53,6 +53,12 @@ export interface ComponentProps {
|
|
|
53
53
|
* @default ""
|
|
54
54
|
*/
|
|
55
55
|
shapeSdfUrl: string;
|
|
56
|
+
/**
|
|
57
|
+
* Active SDF shape type — triggers recompile when shape is switched. When empty, derived from shape JSON at mount time.
|
|
58
|
+
*
|
|
59
|
+
* @default ""
|
|
60
|
+
*/
|
|
61
|
+
shapeType: string;
|
|
56
62
|
}
|
|
57
63
|
export declare const componentDefinition: ComponentDefinition<ComponentProps>;
|
|
58
64
|
export default componentDefinition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/Emboss/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAuC,MAAM,iBAAiB,CAAA;AAGzF,OAAO,EAAC,iBAAiB,EAAC,MAAM,qCAAqC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/Emboss/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAuC,MAAM,iBAAiB,CAAA;AAGzF,OAAO,EAAC,iBAAiB,EAAC,MAAM,qCAAqC,CAAA;AASrE,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAA;IAC/C,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,MAAM,CAAA;IACtB,eAAe,EAAE,MAAM,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CACpB;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CAsFnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
|
-
import "../../sdf-
|
|
3
|
-
import { n as componentDefinition, t as Emboss_default } from "../../Emboss-
|
|
2
|
+
import "../../sdf-CZRX0uur.js";
|
|
3
|
+
import { n as componentDefinition, t as Emboss_default } from "../../Emboss-DCKgs4_G.js";
|
|
4
4
|
export { componentDefinition, Emboss_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
|
-
import "../../sdf-
|
|
4
|
-
import { n as componentDefinition, t as Flower_default } from "../../Flower-
|
|
3
|
+
import "../../sdf-CZRX0uur.js";
|
|
4
|
+
import { n as componentDefinition, t as Flower_default } from "../../Flower-fYEx6ZSB.js";
|
|
5
5
|
export { componentDefinition, Flower_default as default };
|
|
@@ -147,6 +147,12 @@ export interface ComponentProps {
|
|
|
147
147
|
* @default ""
|
|
148
148
|
*/
|
|
149
149
|
shapeSdfUrl: string;
|
|
150
|
+
/**
|
|
151
|
+
* Active SDF shape type — triggers recompile when shape is switched. When empty, derived from shape JSON at mount time.
|
|
152
|
+
*
|
|
153
|
+
* @default ""
|
|
154
|
+
*/
|
|
155
|
+
shapeType: string;
|
|
150
156
|
}
|
|
151
157
|
export declare const componentDefinition: ComponentDefinition<ComponentProps>;
|
|
152
158
|
export default componentDefinition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/Glass/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAuC,MAAM,iBAAiB,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CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
|
-
import "../../sdf-
|
|
3
|
-
import { n as componentDefinition, t as Glass_default } from "../../Glass-
|
|
2
|
+
import "../../sdf-CZRX0uur.js";
|
|
3
|
+
import { n as componentDefinition, t as Glass_default } from "../../Glass-BioLeiH6.js";
|
|
4
4
|
export { componentDefinition, Glass_default as default };
|
|
@@ -147,6 +147,12 @@ export interface ComponentProps {
|
|
|
147
147
|
* @default ""
|
|
148
148
|
*/
|
|
149
149
|
shapeSdfUrl: string;
|
|
150
|
+
/**
|
|
151
|
+
* Active SDF shape type — triggers recompile when shape is switched. When empty, derived from shape JSON at mount time.
|
|
152
|
+
*
|
|
153
|
+
* @default ""
|
|
154
|
+
*/
|
|
155
|
+
shapeType: string;
|
|
150
156
|
}
|
|
151
157
|
export declare const componentDefinition: ComponentDefinition<ComponentProps>;
|
|
152
158
|
export default componentDefinition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/Neon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAuC,MAAM,iBAAiB,CAAA;AAGzF,OAAO,EAAC,iBAAiB,EAAE,cAAc,EAAC,MAAM,qCAAqC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/Neon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAuC,MAAM,iBAAiB,CAAA;AAGzF,OAAO,EAAC,iBAAiB,EAAE,cAAc,EAAC,MAAM,qCAAqC,CAAA;AASrF,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAA;IAC/C,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3C,cAAc,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IACpD,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAC/C,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,iBAAiB,EAAE,MAAM,CAAA;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CACpB;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CA2JnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
|
-
import "../../sdf-
|
|
3
|
-
import { n as componentDefinition, t as Neon_default } from "../../Neon-
|
|
2
|
+
import "../../sdf-CZRX0uur.js";
|
|
3
|
+
import { n as componentDefinition, t as Neon_default } from "../../Neon-uXetpVop.js";
|
|
4
4
|
export { componentDefinition, Neon_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
|
-
import "../../sdf-
|
|
4
|
-
import { n as componentDefinition, t as Polygon_default } from "../../Polygon-
|
|
3
|
+
import "../../sdf-CZRX0uur.js";
|
|
4
|
+
import { n as componentDefinition, t as Polygon_default } from "../../Polygon-7mzxbJeF.js";
|
|
5
5
|
export { componentDefinition, Polygon_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
|
-
import "../../sdf-
|
|
4
|
-
import { n as componentDefinition, t as Ring_default } from "../../Ring-
|
|
3
|
+
import "../../sdf-CZRX0uur.js";
|
|
4
|
+
import { n as componentDefinition, t as Ring_default } from "../../Ring-H6B01ZMz.js";
|
|
5
5
|
export { componentDefinition, Ring_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
|
-
import "../../sdf-
|
|
4
|
-
import { n as componentDefinition, t as RoundedRect_default } from "../../RoundedRect-
|
|
3
|
+
import "../../sdf-CZRX0uur.js";
|
|
4
|
+
import { n as componentDefinition, t as RoundedRect_default } from "../../RoundedRect-OszKdYVD.js";
|
|
5
5
|
export { componentDefinition, RoundedRect_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
|
-
import "../../sdf-
|
|
4
|
-
import { n as componentDefinition, t as Star_default } from "../../Star-
|
|
3
|
+
import "../../sdf-CZRX0uur.js";
|
|
4
|
+
import { n as componentDefinition, t as Star_default } from "../../Star-CyjNgJVp.js";
|
|
5
5
|
export { componentDefinition, Star_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
|
-
import "../../sdf-
|
|
4
|
-
import { n as componentDefinition, t as Trapezoid_default } from "../../Trapezoid-
|
|
3
|
+
import "../../sdf-CZRX0uur.js";
|
|
4
|
+
import { n as componentDefinition, t as Trapezoid_default } from "../../Trapezoid-SuI0dRgI.js";
|
|
5
5
|
export { componentDefinition, Trapezoid_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
|
-
import "../../sdf-
|
|
4
|
-
import { n as componentDefinition, t as Vesica_default } from "../../Vesica-
|
|
3
|
+
import "../../sdf-CZRX0uur.js";
|
|
4
|
+
import { n as componentDefinition, t as Vesica_default } from "../../Vesica-Cj--pgNW.js";
|
|
5
5
|
export { componentDefinition, Vesica_default as default };
|
|
@@ -129,4 +129,9 @@ export declare function loadSdfFromUrl(url: string, sdfData: Float32Array): Prom
|
|
|
129
129
|
* the async load completes. Cleanup is registered via onCleanup.
|
|
130
130
|
*/
|
|
131
131
|
export declare function createSvgSdfSampler(shapeSdfUrl: string, onBeforeRender: (fn: () => void) => void, onCleanup: (fn: () => void) => void): (uv: any) => any;
|
|
132
|
+
export declare function createAnalyticSdfSampler(shapeType: string, initialConfig: Record<string, any>, shapeUniform: {
|
|
133
|
+
uniform: {
|
|
134
|
+
value: string;
|
|
135
|
+
};
|
|
136
|
+
}, onBeforeRender: (fn: () => void) => void): (uv: any) => any;
|
|
132
137
|
//# sourceMappingURL=sdf.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdf.d.ts","sourceRoot":"","sources":["../../src/utilities/sdf.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAGxC,eAAO,MAAM,YAAY,MAAM,CAAA;AAM/B;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAG,IAAI,CAEhE;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,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AAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAG,IAAI,CAuBvG;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,GAAG,IAAI,CA0BnF;AAID;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBtF;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAC/B,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,EACxC,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,GACpC,CAAC,EAAE,EAAE,GAAG,KAAK,GAAG,CAyBlB;AAMD,wBAAgB,wBAAwB,CACpC,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAClC,YAAY,EAAE;IAAE,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,EAC5C,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,GACzC,CAAC,EAAE,EAAE,GAAG,KAAK,GAAG,CAsFlB"}
|
package/dist/js/createShader.js
CHANGED
|
@@ -41,7 +41,7 @@ async function createShader(canvas, preset, options) {
|
|
|
41
41
|
if (isExternalUser() && shouldCollectTelemetry(options?.disableTelemetry || false, options?.isPreview || false)) {
|
|
42
42
|
const checkRendering = () => {
|
|
43
43
|
if (renderer.getPerformanceStats().fps > 0) {
|
|
44
|
-
telemetryCollector = startTelemetry(renderer, "2.5.
|
|
44
|
+
telemetryCollector = startTelemetry(renderer, "2.5.84", options?.disableTelemetry || false, false);
|
|
45
45
|
if (telemetryCollector) telemetryCollector.start();
|
|
46
46
|
telemetryStartTimeout = null;
|
|
47
47
|
} else telemetryStartTimeout = setTimeout(checkRendering, 500);
|
package/dist/react/Shader.js
CHANGED
|
@@ -88,7 +88,7 @@ const Shader = ({ children, disableTelemetry = false, colorSpace = "p3-linear",
|
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
90
|
if (rendererRef.current.getPerformanceStats().fps > 0) {
|
|
91
|
-
telemetryCollectorRef.current = startTelemetry(rendererRef.current, "2.5.
|
|
91
|
+
telemetryCollectorRef.current = startTelemetry(rendererRef.current, "2.5.84", disableTelemetry, isPreview);
|
|
92
92
|
if (telemetryCollectorRef.current) telemetryCollectorRef.current.start();
|
|
93
93
|
telemetryStartTimeoutRef.current = null;
|
|
94
94
|
} else telemetryStartTimeoutRef.current = window.setTimeout(checkRendering, 500);
|
package/dist/registry.js
CHANGED
|
@@ -5616,6 +5616,11 @@ export const shaderRegistry = [
|
|
|
5616
5616
|
"default": "",
|
|
5617
5617
|
"compileTime": true,
|
|
5618
5618
|
"description": "URL to a pre-generated SDF .bin file — when non-empty, activates SVG mode and triggers a shader recompile"
|
|
5619
|
+
},
|
|
5620
|
+
"shapeType": {
|
|
5621
|
+
"default": "",
|
|
5622
|
+
"compileTime": true,
|
|
5623
|
+
"description": "Active SDF shape type — triggers recompile when shape is switched. When empty, derived from shape JSON at mount time."
|
|
5619
5624
|
}
|
|
5620
5625
|
}
|
|
5621
5626
|
},
|
|
@@ -7619,6 +7624,11 @@ export const shaderRegistry = [
|
|
|
7619
7624
|
"default": "",
|
|
7620
7625
|
"compileTime": true,
|
|
7621
7626
|
"description": "URL to a pre-generated SDF .bin file — when non-empty, activates SVG mode and triggers a shader recompile"
|
|
7627
|
+
},
|
|
7628
|
+
"shapeType": {
|
|
7629
|
+
"default": "",
|
|
7630
|
+
"compileTime": true,
|
|
7631
|
+
"description": "Active SDF shape type — triggers recompile when shape is switched. When empty, derived from shape JSON at mount time."
|
|
7622
7632
|
}
|
|
7623
7633
|
}
|
|
7624
7634
|
},
|
|
@@ -10602,6 +10612,11 @@ export const shaderRegistry = [
|
|
|
10602
10612
|
"default": "",
|
|
10603
10613
|
"compileTime": true,
|
|
10604
10614
|
"description": "URL to a pre-generated SDF .bin file — when non-empty, activates SVG mode and triggers a shader recompile"
|
|
10615
|
+
},
|
|
10616
|
+
"shapeType": {
|
|
10617
|
+
"default": "",
|
|
10618
|
+
"compileTime": true,
|
|
10619
|
+
"description": "Active SDF shape type — triggers recompile when shape is switched. When empty, derived from shape JSON at mount time."
|
|
10605
10620
|
}
|
|
10606
10621
|
}
|
|
10607
10622
|
},
|
|
@@ -67,7 +67,7 @@ function Shader(allProps) {
|
|
|
67
67
|
const checkRendering = () => {
|
|
68
68
|
const stats = rendererInstance.getPerformanceStats();
|
|
69
69
|
if (stats.fps > 0) {
|
|
70
|
-
const version = "2.5.
|
|
70
|
+
const version = "2.5.84";
|
|
71
71
|
telemetryCollector = startTelemetry(rendererInstance, version, props.disableTelemetry, props.isPreview);
|
|
72
72
|
if (telemetryCollector) {
|
|
73
73
|
telemetryCollector.start();
|
package/dist/svelte/index.js
CHANGED
|
@@ -13335,7 +13335,7 @@ function Shader($$anchor, $$props) {
|
|
|
13335
13335
|
const checkRendering = () => {
|
|
13336
13336
|
if (!rendererInstance) return;
|
|
13337
13337
|
if (rendererInstance.getPerformanceStats().fps > 0) {
|
|
13338
|
-
telemetryCollector = startTelemetry(rendererInstance, "2.5.
|
|
13338
|
+
telemetryCollector = startTelemetry(rendererInstance, "2.5.84", disableTelemetry(), isPreview());
|
|
13339
13339
|
if (telemetryCollector) telemetryCollector.start();
|
|
13340
13340
|
telemetryStartTimeout = null;
|
|
13341
13341
|
} else telemetryStartTimeout = window.setTimeout(checkRendering, 500);
|
|
@@ -60,7 +60,7 @@ var Shader_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
60
60
|
const startTelemetryWhenReady = () => {
|
|
61
61
|
const checkRendering = () => {
|
|
62
62
|
if (rendererInstance.value.getPerformanceStats().fps > 0) {
|
|
63
|
-
telemetryCollector = startTelemetry(rendererInstance.value, "2.5.
|
|
63
|
+
telemetryCollector = startTelemetry(rendererInstance.value, "2.5.84", props.disableTelemetry, props.isPreview);
|
|
64
64
|
if (telemetryCollector) telemetryCollector.start();
|
|
65
65
|
telemetryStartTimeout = null;
|
|
66
66
|
} else telemetryStartTimeout = setTimeout(checkRendering, 500);
|