shaders 2.5.89 → 2.5.91
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/{CursorTrail-Dm2pOh9x.js → CursorTrail-C-0lpOV1.js} +24 -16
- package/dist/core/index.js +2 -2
- package/dist/core/registry.js +2 -2
- package/dist/core/{shaderRegistry-DICjiu4V.js → shaderRegistry-DFpnXcuC.js} +1 -1
- package/dist/core/shaders/CursorTrail/index.d.ts.map +1 -1
- package/dist/core/shaders/CursorTrail/index.js +1 -1
- package/dist/core/telemetry/index.js +1 -1
- package/dist/js/createShader.d.ts.map +1 -1
- package/dist/js/createShader.js +3 -3
- package/dist/react/Shader.js +3 -3
- package/dist/solid/engine/Shader.js +3 -3
- package/dist/svelte/index.js +3 -3
- package/dist/svelte/source/engine/Shader.svelte +2 -2
- package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +3 -3
- package/package.json +1 -1
|
@@ -107,22 +107,30 @@ const componentDefinition = {
|
|
|
107
107
|
}
|
|
108
108
|
if (speed > .001) {
|
|
109
109
|
const influenceRadius = radius * 3;
|
|
110
|
-
const
|
|
111
|
-
const
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
const
|
|
118
|
-
const
|
|
119
|
-
const
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
110
|
+
const stepSize = Math.max(.005, radius * .5);
|
|
111
|
+
const numSteps = Math.min(20, Math.max(1, Math.ceil(speed / stepSize)));
|
|
112
|
+
const amountPerStep = speed / numSteps * 50 * dt;
|
|
113
|
+
for (let s = 0; s < numSteps; s++) {
|
|
114
|
+
const t = (s + .5) / numSteps;
|
|
115
|
+
const px = prevX + dx * t;
|
|
116
|
+
const py = prevY + dy * t;
|
|
117
|
+
const minJ = Math.max(0, Math.floor((px - influenceRadius) * GRID_SIZE));
|
|
118
|
+
const maxJ = Math.min(GRID_SIZE - 1, Math.ceil((px + influenceRadius) * GRID_SIZE));
|
|
119
|
+
const minI = Math.max(0, Math.floor((py - influenceRadius) * GRID_SIZE));
|
|
120
|
+
const maxI = Math.min(GRID_SIZE - 1, Math.ceil((py + influenceRadius) * GRID_SIZE));
|
|
121
|
+
for (let i = minI; i <= maxI; i++) for (let j = minJ; j <= maxJ; j++) {
|
|
122
|
+
const idx = (i * GRID_SIZE + j) * 4;
|
|
123
|
+
const cellX = (j + .5) / GRID_SIZE;
|
|
124
|
+
const cellY = (i + .5) / GRID_SIZE;
|
|
125
|
+
const cellDx = aspect >= 1 ? (cellX - px) * aspect : cellX - px;
|
|
126
|
+
const cellDy = aspect >= 1 ? cellY - py : (cellY - py) / aspect;
|
|
127
|
+
const dist = Math.sqrt(cellDx * cellDx + cellDy * cellDy);
|
|
128
|
+
if (dist < influenceRadius) {
|
|
129
|
+
const influence = Math.exp(-dist * dist / (radius * radius));
|
|
130
|
+
trailData[idx] = Math.min(1, trailData[idx] + influence * amountPerStep);
|
|
131
|
+
trailData[idx + 1] = 1;
|
|
132
|
+
trailData[idx + 2] = 0;
|
|
133
|
+
}
|
|
126
134
|
}
|
|
127
135
|
}
|
|
128
136
|
}
|
package/dist/core/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import "./Cross-CDyzf8TT.js";
|
|
|
25
25
|
import "./CRTScreen-DolQEkb1.js";
|
|
26
26
|
import "./Crystal-DSuN8TNY.js";
|
|
27
27
|
import "./CursorRipples-n_xEDr10.js";
|
|
28
|
-
import "./CursorTrail-
|
|
28
|
+
import "./CursorTrail-C-0lpOV1.js";
|
|
29
29
|
import "./DiamondGradient-TsOxHjg_.js";
|
|
30
30
|
import "./DiffuseBlur-BqIV4JLM.js";
|
|
31
31
|
import "./Dither-D_YF6z03.js";
|
|
@@ -107,7 +107,7 @@ import "./WaveDistortion-C7mIgJok.js";
|
|
|
107
107
|
import "./Weave-DzZv1-19.js";
|
|
108
108
|
import "./WebcamTexture-7SK_C_Xf.js";
|
|
109
109
|
import "./ZoomBlur-DUcqnggc.js";
|
|
110
|
-
import { t as getAllShaders } from "./shaderRegistry-
|
|
110
|
+
import { t as getAllShaders } from "./shaderRegistry-DFpnXcuC.js";
|
|
111
111
|
import { Material, Mesh, MeshBasicNodeMaterial, OrthographicCamera, PlaneGeometry, SRGBColorSpace, Scene, Vector2, WebGPURenderer } from "three/webgpu";
|
|
112
112
|
import { WebGLRenderer } from "three";
|
|
113
113
|
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
|
@@ -25,7 +25,7 @@ import "./Cross-CDyzf8TT.js";
|
|
|
25
25
|
import "./CRTScreen-DolQEkb1.js";
|
|
26
26
|
import "./Crystal-DSuN8TNY.js";
|
|
27
27
|
import "./CursorRipples-n_xEDr10.js";
|
|
28
|
-
import "./CursorTrail-
|
|
28
|
+
import "./CursorTrail-C-0lpOV1.js";
|
|
29
29
|
import "./DiamondGradient-TsOxHjg_.js";
|
|
30
30
|
import "./DiffuseBlur-BqIV4JLM.js";
|
|
31
31
|
import "./Dither-D_YF6z03.js";
|
|
@@ -107,5 +107,5 @@ import "./WaveDistortion-C7mIgJok.js";
|
|
|
107
107
|
import "./Weave-DzZv1-19.js";
|
|
108
108
|
import "./WebcamTexture-7SK_C_Xf.js";
|
|
109
109
|
import "./ZoomBlur-DUcqnggc.js";
|
|
110
|
-
import { a as shaderRegistry, i as getShadersByCategory, n as getShaderByName, r as getShaderCategories, t as getAllShaders } from "./shaderRegistry-
|
|
110
|
+
import { a as shaderRegistry, i as getShadersByCategory, n as getShaderByName, r as getShaderCategories, t as getAllShaders } from "./shaderRegistry-DFpnXcuC.js";
|
|
111
111
|
export { getAllShaders, getShaderByName, getShaderCategories, getShadersByCategory, shaderRegistry };
|
|
@@ -19,7 +19,7 @@ import { n as componentDefinition$17 } from "./Cross-CDyzf8TT.js";
|
|
|
19
19
|
import { n as componentDefinition$18 } from "./CRTScreen-DolQEkb1.js";
|
|
20
20
|
import { n as componentDefinition$19 } from "./Crystal-DSuN8TNY.js";
|
|
21
21
|
import { n as componentDefinition$20 } from "./CursorRipples-n_xEDr10.js";
|
|
22
|
-
import { n as componentDefinition$21 } from "./CursorTrail-
|
|
22
|
+
import { n as componentDefinition$21 } from "./CursorTrail-C-0lpOV1.js";
|
|
23
23
|
import { n as componentDefinition$22 } from "./DiamondGradient-TsOxHjg_.js";
|
|
24
24
|
import { n as componentDefinition$23 } from "./DiffuseBlur-BqIV4JLM.js";
|
|
25
25
|
import { n as componentDefinition$24 } from "./Dither-D_YF6z03.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/CursorTrail/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,iBAAiB,CAAA;AAIvE,OAAO,EAAC,cAAc,EAAyC,MAAM,qCAAqC,CAAA;AAI1G,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,MAAM,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAA;CACrB;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/CursorTrail/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,iBAAiB,CAAA;AAIvE,OAAO,EAAC,cAAc,EAAyC,MAAM,qCAAqC,CAAA;AAI1G,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,MAAM,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAA;CACrB;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CAkMnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
|
-
import { n as componentDefinition, t as CursorTrail_default } from "../../CursorTrail-
|
|
3
|
+
import { n as componentDefinition, t as CursorTrail_default } from "../../CursorTrail-C-0lpOV1.js";
|
|
4
4
|
export { componentDefinition, CursorTrail_default as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createShader.d.ts","sourceRoot":"","sources":["../src/createShader.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAmB,MAAM,cAAc,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAa5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"createShader.d.ts","sourceRoot":"","sources":["../src/createShader.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAmB,MAAM,cAAc,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAa5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,cAAc,CAAC,CAyOzB"}
|
package/dist/js/createShader.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createUniformsMap, shaderRenderer } from "../core/index.js";
|
|
2
2
|
import { getAllShaders } from "../core/registry.js";
|
|
3
|
-
import { isExternalUser,
|
|
3
|
+
import { isExternalUser, startTelemetry } from "../core/telemetry/index.js";
|
|
4
4
|
import { vec4 } from "three/tsl";
|
|
5
5
|
var METADATA_PROPS = new Set([
|
|
6
6
|
"opacity",
|
|
@@ -38,10 +38,10 @@ async function createShader(canvas, preset, options) {
|
|
|
38
38
|
});
|
|
39
39
|
let telemetryCollector = null;
|
|
40
40
|
let telemetryStartTimeout = null;
|
|
41
|
-
if (isExternalUser()
|
|
41
|
+
if (isExternalUser()) {
|
|
42
42
|
const checkRendering = () => {
|
|
43
43
|
if (renderer.getPerformanceStats().fps > 0) {
|
|
44
|
-
telemetryCollector = startTelemetry(renderer, "2.5.
|
|
44
|
+
telemetryCollector = startTelemetry(renderer, "2.5.91", 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
|
@@ -2,7 +2,7 @@ import { createContext, useEffect, useId, useMemo, useRef } from "react";
|
|
|
2
2
|
import { shaderRenderer } from "../core/index.js";
|
|
3
3
|
import { setColorSpaceMode } from "../core/utilities/transformations/index.js";
|
|
4
4
|
import { vec4 } from "three/tsl";
|
|
5
|
-
import { isExternalUser,
|
|
5
|
+
import { isExternalUser, startTelemetry } from "../core/telemetry/index.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
const ShaderContext = createContext(null);
|
|
8
8
|
const Shader = ({ children, disableTelemetry = false, colorSpace = "p3-linear", isPreview = false, onReady, style = {}, className = "",...rest }) => {
|
|
@@ -89,7 +89,7 @@ const Shader = ({ children, disableTelemetry = false, colorSpace = "p3-linear",
|
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
91
|
if (rendererRef.current.getPerformanceStats().fps > 0) {
|
|
92
|
-
telemetryCollectorRef.current = startTelemetry(rendererRef.current, "2.5.
|
|
92
|
+
telemetryCollectorRef.current = startTelemetry(rendererRef.current, "2.5.91", disableTelemetry, isPreview);
|
|
93
93
|
if (telemetryCollectorRef.current) telemetryCollectorRef.current.start();
|
|
94
94
|
telemetryStartTimeoutRef.current = null;
|
|
95
95
|
} else telemetryStartTimeoutRef.current = window.setTimeout(checkRendering, 500);
|
|
@@ -109,7 +109,7 @@ const Shader = ({ children, disableTelemetry = false, colorSpace = "p3-linear",
|
|
|
109
109
|
renderer.registerNode(rootId, ({ childNode }) => childNode || vec4(0, 0, 0, 0), null, null, {});
|
|
110
110
|
isInitializedRef.current = true;
|
|
111
111
|
isInitializingRef.current = false;
|
|
112
|
-
if (shouldSendTelemetryRef.current === null) shouldSendTelemetryRef.current = isExternalUser()
|
|
112
|
+
if (shouldSendTelemetryRef.current === null) shouldSendTelemetryRef.current = isExternalUser();
|
|
113
113
|
if (shouldSendTelemetryRef.current && !telemetryCollectorRef.current) startTelemetryWhenReady();
|
|
114
114
|
} catch (err) {
|
|
115
115
|
console.error("[Shader] Initialization failed:", err);
|
|
@@ -2,7 +2,7 @@ import { createComponent, template, spread, mergeProps, insert, use } from "soli
|
|
|
2
2
|
import { createContext, splitProps, createUniqueId, createMemo, onMount, onCleanup, createEffect, useContext } from "solid-js";
|
|
3
3
|
import { shaderRenderer } from "../../core/index.js";
|
|
4
4
|
import { vec4 } from "three/tsl";
|
|
5
|
-
import { isExternalUser,
|
|
5
|
+
import { isExternalUser, startTelemetry } from "../../core/telemetry/index.js";
|
|
6
6
|
import { setColorSpaceMode } from "../../core/utilities/transformations/index.js";
|
|
7
7
|
var _tmpl$ = /* @__PURE__ */ template(`<div><canvas data-renderer=shaders style=width:100%;height:100%;display:block>`);
|
|
8
8
|
const ShaderContext = createContext();
|
|
@@ -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.91";
|
|
71
71
|
telemetryCollector = startTelemetry(rendererInstance, version, props.disableTelemetry, props.isPreview);
|
|
72
72
|
if (telemetryCollector) {
|
|
73
73
|
telemetryCollector.start();
|
|
@@ -108,7 +108,7 @@ function Shader(allProps) {
|
|
|
108
108
|
isInitialized = true;
|
|
109
109
|
isInitializing = false;
|
|
110
110
|
if (shouldSendTelemetry === null) {
|
|
111
|
-
shouldSendTelemetry = isExternalUser()
|
|
111
|
+
shouldSendTelemetry = isExternalUser();
|
|
112
112
|
}
|
|
113
113
|
if (shouldSendTelemetry && !telemetryCollector) {
|
|
114
114
|
startTelemetryWhenReady();
|
package/dist/svelte/index.js
CHANGED
|
@@ -107,7 +107,7 @@ import { componentDefinition as componentDefinition$99 } from "../core/shaders/W
|
|
|
107
107
|
import { componentDefinition as componentDefinition$100 } from "../core/shaders/WebcamTexture/index.js";
|
|
108
108
|
import { componentDefinition as componentDefinition$101 } from "../core/shaders/ZoomBlur/index.js";
|
|
109
109
|
import { vec4 } from "three/tsl";
|
|
110
|
-
import { isExternalUser,
|
|
110
|
+
import { isExternalUser, startTelemetry } from "../core/telemetry/index.js";
|
|
111
111
|
var root$102 = $.from_html(`<span style="display:contents"><!></span>`);
|
|
112
112
|
function AngularBlur($$anchor, $$props) {
|
|
113
113
|
$.push($$props, true);
|
|
@@ -14941,7 +14941,7 @@ function Shader($$anchor, $$props) {
|
|
|
14941
14941
|
const checkRendering = () => {
|
|
14942
14942
|
if (!rendererInstance) return;
|
|
14943
14943
|
if (rendererInstance.getPerformanceStats().fps > 0) {
|
|
14944
|
-
telemetryCollector = startTelemetry(rendererInstance, "2.5.
|
|
14944
|
+
telemetryCollector = startTelemetry(rendererInstance, "2.5.91", disableTelemetry(), isPreview());
|
|
14945
14945
|
if (telemetryCollector) telemetryCollector.start();
|
|
14946
14946
|
telemetryStartTimeout = null;
|
|
14947
14947
|
} else telemetryStartTimeout = window.setTimeout(checkRendering, 500);
|
|
@@ -14956,7 +14956,7 @@ function Shader($$anchor, $$props) {
|
|
|
14956
14956
|
colorSpace: colorSpace()
|
|
14957
14957
|
});
|
|
14958
14958
|
rendererInstance.registerNode(rootId, ({ childNode }) => childNode || vec4(0, 0, 0, 0), null, null, {});
|
|
14959
|
-
if (shouldSendTelemetry === null) shouldSendTelemetry = isExternalUser()
|
|
14959
|
+
if (shouldSendTelemetry === null) shouldSendTelemetry = isExternalUser();
|
|
14960
14960
|
if (shouldSendTelemetry && !telemetryCollector) startTelemetryWhenReady();
|
|
14961
14961
|
} catch (err) {
|
|
14962
14962
|
console.error("[Shader] Initialization failed:", err);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { shaderRenderer } from '../../../core/index.js';
|
|
4
4
|
import { vec4 } from 'three/tsl';
|
|
5
5
|
import type { UniformsMap, BlendMode, NodeMetadata } from '../../../core/index.js';
|
|
6
|
-
import {
|
|
6
|
+
import { isExternalUser, startTelemetry } from '../../../core/telemetry/index.js';
|
|
7
7
|
import { setColorSpaceMode } from '../../../core/utilities/transformations/index.js';
|
|
8
8
|
|
|
9
9
|
declare const __SHADERS_VERSION__: string;
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
|
|
121
121
|
// Compute sampling decision once (includes random sampling roll)
|
|
122
122
|
if (shouldSendTelemetry === null) {
|
|
123
|
-
shouldSendTelemetry = isExternalUser()
|
|
123
|
+
shouldSendTelemetry = isExternalUser();
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
if (shouldSendTelemetry && !telemetryCollector) {
|
|
@@ -2,7 +2,7 @@ import { computed, createElementBlock, createElementVNode, defineComponent, merg
|
|
|
2
2
|
import { shaderRenderer } from "../core/index.js";
|
|
3
3
|
import { setColorSpaceMode } from "../core/utilities/transformations/index.js";
|
|
4
4
|
import { vec4 } from "three/tsl";
|
|
5
|
-
import { isExternalUser,
|
|
5
|
+
import { isExternalUser, startTelemetry } from "../core/telemetry/index.js";
|
|
6
6
|
var Shader_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
7
7
|
__name: "Shader",
|
|
8
8
|
props: {
|
|
@@ -54,13 +54,13 @@ var Shader_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
54
54
|
colorSpace: props.colorSpace
|
|
55
55
|
});
|
|
56
56
|
rendererInstance.value.registerNode(rootId.value, ({ childNode }) => childNode || vec4(0, 0, 0, 0), null, null, {}, void 0);
|
|
57
|
-
if (shouldSendTelemetry === null) shouldSendTelemetry = isExternalUser()
|
|
57
|
+
if (shouldSendTelemetry === null) shouldSendTelemetry = isExternalUser();
|
|
58
58
|
if (shouldSendTelemetry && !telemetryCollector) startTelemetryWhenReady();
|
|
59
59
|
};
|
|
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.91", props.disableTelemetry, props.isPreview);
|
|
64
64
|
if (telemetryCollector) telemetryCollector.start();
|
|
65
65
|
telemetryStartTimeout = null;
|
|
66
66
|
} else telemetryStartTimeout = setTimeout(checkRendering, 500);
|