shaders 2.5.95 → 2.5.97
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/{Blur-CC8fo0C5.js → Blur-CXXttTb1.js} +41 -6
- package/dist/core/{ChannelBlur-CN_Zyiur.js → ChannelBlur-gzP71FWd.js} +1 -1
- package/dist/core/{Glass-gQCmJlsQ.js → Glass-DDBKYclp.js} +1 -1
- package/dist/core/{Glow-DvN-WnB4.js → Glow-BwaPYDRZ.js} +42 -6
- package/dist/core/{ProgressiveBlur-Dm530r0z.js → ProgressiveBlur-B8xwWyTM.js} +64 -13
- package/dist/core/{TiltShift-BqKaU3TM.js → TiltShift-CI3FlfYk.js} +66 -13
- package/dist/core/{computeBlur-B0KA4n89.js → computeBlur-C3oX720H.js} +1 -1
- package/dist/core/index.js +56 -16
- package/dist/core/registry.js +8 -8
- package/dist/core/renderer.d.ts +5 -1
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/core/{shaderRegistry-DriE1ikS.js → shaderRegistry-B_84rvO8.js} +6 -6
- package/dist/core/shaders/Blur/index.d.ts.map +1 -1
- package/dist/core/shaders/Blur/index.js +2 -2
- package/dist/core/shaders/ChannelBlur/index.js +2 -2
- package/dist/core/shaders/Glass/index.js +2 -2
- package/dist/core/shaders/Glow/index.d.ts.map +1 -1
- package/dist/core/shaders/Glow/index.js +2 -2
- package/dist/core/shaders/ProgressiveBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ProgressiveBlur/index.js +2 -2
- package/dist/core/shaders/TiltShift/index.d.ts.map +1 -1
- package/dist/core/shaders/TiltShift/index.js +2 -2
- package/dist/core/types.d.ts +20 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/js/createShader.js +1 -1
- package/dist/react/Shader.js +1 -1
- package/dist/solid/engine/Shader.js +1 -1
- package/dist/svelte/index.js +1 -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 { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
|
|
2
|
-
import { t as createGaussianBlurCompute } from "./computeBlur-
|
|
3
|
-
import { Fn, convertToTexture, float, screenUV, texture, vec2, vec4, viewportSize } from "three/tsl";
|
|
2
|
+
import { n as createVariableGaussianBlurCompute, t as createGaussianBlurCompute } from "./computeBlur-C3oX720H.js";
|
|
3
|
+
import { Fn, If, clamp, convertToTexture, dot, float, instanceIndex, int, mix, pow, screenUV, texture, textureLoad, textureStore, uint, uvec2, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "Blur",
|
|
6
6
|
category: "Blurs",
|
|
@@ -26,15 +26,48 @@ const componentDefinition = {
|
|
|
26
26
|
if (childTexture?.renderTarget?.dispose) childTexture.renderTarget.dispose();
|
|
27
27
|
});
|
|
28
28
|
const dpr = renderer?.getPixelRatio?.() ?? 1;
|
|
29
|
-
const
|
|
29
|
+
const texWidth = Math.round(dimensions.width * dpr);
|
|
30
|
+
const texHeight = Math.round(dimensions.height * dpr);
|
|
31
|
+
const mapInfo = uniforms.intensity.mapComputeInfo;
|
|
32
|
+
if (mapInfo) {
|
|
33
|
+
const { computeNodes: blurNodes, outputTexture: outputTexture$1, blurMapWriteNode } = createVariableGaussianBlurCompute(childTexture, texWidth, texHeight, onCleanup);
|
|
34
|
+
const w = uint(texWidth);
|
|
35
|
+
const h = uint(texHeight);
|
|
36
|
+
const { sourceTexture, channel, inputMin, inputMax, outputMin, outputMax, curve } = mapInfo;
|
|
37
|
+
const fillBlurMap = Fn(() => {
|
|
38
|
+
const idx = instanceIndex;
|
|
39
|
+
const x = idx.mod(w);
|
|
40
|
+
const y = idx.div(w);
|
|
41
|
+
If(y.lessThan(h), () => {
|
|
42
|
+
const sample = textureLoad(sourceTexture, uvec2(x, y), int(0));
|
|
43
|
+
let raw;
|
|
44
|
+
if (channel === "alpha") raw = sample.a;
|
|
45
|
+
else if (channel === "alphaInverted") raw = sample.a.oneMinus();
|
|
46
|
+
else if (channel === "luminanceInverted") raw = dot(sample.rgb, vec3(.2126, .7152, .0722)).oneMinus();
|
|
47
|
+
else raw = dot(sample.rgb, vec3(.2126, .7152, .0722));
|
|
48
|
+
const inputRange = inputMax.sub(inputMin).max(float(1e-4));
|
|
49
|
+
const radius = mix(outputMin, outputMax, pow(clamp(raw.sub(inputMin).div(inputRange), float(0), float(1)), pow(float(2), curve.negate().mul(float(2))))).mul(float(.36));
|
|
50
|
+
textureStore(blurMapWriteNode, uvec2(x, y), vec4(radius, float(0), float(0), float(1))).toWriteOnly();
|
|
51
|
+
});
|
|
52
|
+
})().compute(texWidth * texHeight, [256]);
|
|
53
|
+
return {
|
|
54
|
+
outputs: {
|
|
55
|
+
childTexture,
|
|
56
|
+
blurredTexture: outputTexture$1
|
|
57
|
+
},
|
|
58
|
+
getComputeNodes: () => [fillBlurMap, ...blurNodes]
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const { computeNodes, outputTexture, updateRadius } = createGaussianBlurCompute(childTexture, texWidth, texHeight, onCleanup);
|
|
30
62
|
return {
|
|
31
63
|
outputs: {
|
|
32
64
|
childTexture,
|
|
33
65
|
blurredTexture: outputTexture
|
|
34
66
|
},
|
|
35
67
|
getComputeNodes: () => {
|
|
36
|
-
const
|
|
37
|
-
|
|
68
|
+
const intensityEntry = uniforms.intensity;
|
|
69
|
+
const intensity = intensityEntry.getCpuValue?.() ?? (typeof intensityEntry.uniform.value === "number" ? intensityEntry.uniform.value : null);
|
|
70
|
+
if (intensity !== null) updateRadius(intensity * .36);
|
|
38
71
|
return computeNodes;
|
|
39
72
|
}
|
|
40
73
|
};
|
|
@@ -43,7 +76,9 @@ const componentDefinition = {
|
|
|
43
76
|
if (!childNode) return vec4(0, 0, 0, 0);
|
|
44
77
|
if (computeOutputs?.blurredTexture) {
|
|
45
78
|
const sharp = computeOutputs.childTexture.sample(screenUV);
|
|
46
|
-
|
|
79
|
+
const blurred = texture(computeOutputs.blurredTexture).sample(screenUV);
|
|
80
|
+
const intensityPin = uniforms.intensity.uniform.mul(float(0));
|
|
81
|
+
return unpremultiplyAlpha(vec4(blurred.rgb.add(intensityPin), sharp.a));
|
|
47
82
|
}
|
|
48
83
|
const childTexture = convertToTexture(childNode);
|
|
49
84
|
onCleanup(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
|
|
2
|
-
import { t as createGaussianBlurCompute } from "./computeBlur-
|
|
2
|
+
import { t as createGaussianBlurCompute } from "./computeBlur-C3oX720H.js";
|
|
3
3
|
import { Fn, convertToTexture, float, mix, screenUV, texture, vec2, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "ChannelBlur",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as transformColor, l as transformPosition } from "./transformations-B5lM6fYX.js";
|
|
2
|
-
import { t as createGaussianBlurCompute } from "./computeBlur-
|
|
2
|
+
import { t as createGaussianBlurCompute } from "./computeBlur-C3oX720H.js";
|
|
3
3
|
import { n as createAnalyticSdfSampler, r as createSvgSdfSampler } from "./sdf-DyC2H_qS.js";
|
|
4
4
|
import { Fn, clamp, convertToTexture, dot, exp2, float, max, mix, pow, screenUV, smoothstep, sqrt, texture, uniform, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
5
5
|
var GOLDEN_ANGLE = 2.3999632297286535;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
|
|
2
|
-
import { t as createGaussianBlurCompute } from "./computeBlur-
|
|
3
|
-
import { Fn, convertToTexture, dot, float, max, screenUV, texture, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
2
|
+
import { n as createVariableGaussianBlurCompute, t as createGaussianBlurCompute } from "./computeBlur-C3oX720H.js";
|
|
3
|
+
import { Fn, If, clamp, convertToTexture, dot, float, instanceIndex, int, max, mix, pow, screenUV, texture, textureLoad, textureStore, uint, uvec2, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "Glow",
|
|
6
6
|
category: "Stylize",
|
|
@@ -52,15 +52,48 @@ const componentDefinition = {
|
|
|
52
52
|
if (childTexture?.renderTarget?.dispose) childTexture.renderTarget.dispose();
|
|
53
53
|
});
|
|
54
54
|
const dpr = renderer?.getPixelRatio?.() ?? 1;
|
|
55
|
-
const
|
|
55
|
+
const texWidth = Math.round(dimensions.width * dpr);
|
|
56
|
+
const texHeight = Math.round(dimensions.height * dpr);
|
|
57
|
+
const sizeMapInfo = uniforms.size.mapComputeInfo;
|
|
58
|
+
if (sizeMapInfo) {
|
|
59
|
+
const { computeNodes: blurNodes, outputTexture: outputTexture$1, blurMapWriteNode } = createVariableGaussianBlurCompute(childTexture, texWidth, texHeight, onCleanup);
|
|
60
|
+
const w = uint(texWidth);
|
|
61
|
+
const h = uint(texHeight);
|
|
62
|
+
const { sourceTexture, channel, inputMin, inputMax, outputMin, outputMax, curve } = sizeMapInfo;
|
|
63
|
+
const fillBlurMap = Fn(() => {
|
|
64
|
+
const idx = instanceIndex;
|
|
65
|
+
const x = idx.mod(w);
|
|
66
|
+
const y = idx.div(w);
|
|
67
|
+
If(y.lessThan(h), () => {
|
|
68
|
+
const sample = textureLoad(sourceTexture, uvec2(x, y), int(0));
|
|
69
|
+
let raw;
|
|
70
|
+
if (channel === "alpha") raw = sample.a;
|
|
71
|
+
else if (channel === "alphaInverted") raw = sample.a.oneMinus();
|
|
72
|
+
else if (channel === "luminanceInverted") raw = dot(sample.rgb, vec3(.2126, .7152, .0722)).oneMinus();
|
|
73
|
+
else raw = dot(sample.rgb, vec3(.2126, .7152, .0722));
|
|
74
|
+
const inputRange = inputMax.sub(inputMin).max(float(1e-4));
|
|
75
|
+
const radius = mix(outputMin, outputMax, pow(clamp(raw.sub(inputMin).div(inputRange), float(0), float(1)), pow(float(2), curve.negate().mul(float(2)))));
|
|
76
|
+
textureStore(blurMapWriteNode, uvec2(x, y), vec4(radius, float(0), float(0), float(1))).toWriteOnly();
|
|
77
|
+
});
|
|
78
|
+
})().compute(texWidth * texHeight, [256]);
|
|
79
|
+
return {
|
|
80
|
+
outputs: {
|
|
81
|
+
childTexture,
|
|
82
|
+
blurredTexture: outputTexture$1
|
|
83
|
+
},
|
|
84
|
+
getComputeNodes: () => [fillBlurMap, ...blurNodes]
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const { computeNodes, outputTexture, updateRadius } = createGaussianBlurCompute(childTexture, texWidth, texHeight, onCleanup);
|
|
56
88
|
return {
|
|
57
89
|
outputs: {
|
|
58
90
|
childTexture,
|
|
59
91
|
blurredTexture: outputTexture
|
|
60
92
|
},
|
|
61
93
|
getComputeNodes: () => {
|
|
62
|
-
const
|
|
63
|
-
|
|
94
|
+
const sizeEntry = uniforms.size;
|
|
95
|
+
const size = sizeEntry.getCpuValue?.() ?? (typeof sizeEntry.uniform.value === "number" ? sizeEntry.uniform.value : null);
|
|
96
|
+
if (size !== null) updateRadius(size);
|
|
64
97
|
return computeNodes;
|
|
65
98
|
}
|
|
66
99
|
};
|
|
@@ -74,7 +107,10 @@ const componentDefinition = {
|
|
|
74
107
|
const brightnessMask = max(float(0), luminance.sub(uniforms.threshold.uniform));
|
|
75
108
|
const intensity$1 = uniforms.intensity.uniform;
|
|
76
109
|
const glow = blurredColor.mul(brightnessMask).mul(intensity$1);
|
|
77
|
-
|
|
110
|
+
const finalColor = originalColor$1.rgb.add(glow.rgb);
|
|
111
|
+
const finalAlpha = max(originalColor$1.a, glow.a);
|
|
112
|
+
const sizePin = uniforms.size.uniform.mul(float(0));
|
|
113
|
+
return unpremultiplyAlpha(vec4(finalColor.add(sizePin), finalAlpha));
|
|
78
114
|
}
|
|
79
115
|
const childTexture = convertToTexture(childNode);
|
|
80
116
|
onCleanup(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { l as transformPosition, r as transformAngle } from "./transformations-B5lM6fYX.js";
|
|
2
2
|
import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
|
|
3
|
-
import { n as createVariableGaussianBlurCompute } from "./computeBlur-
|
|
4
|
-
import { Fn, If, convertToTexture, cos, float, instanceIndex, max, radians, screenUV, sin, smoothstep, texture, textureStore, uint, uniform, uvec2, vec2, vec4, viewportSize } from "three/tsl";
|
|
3
|
+
import { n as createVariableGaussianBlurCompute } from "./computeBlur-C3oX720H.js";
|
|
4
|
+
import { Fn, If, clamp, convertToTexture, cos, dot, float, instanceIndex, int, max, mix, pow, radians, screenUV, sin, smoothstep, texture, textureLoad, textureStore, uint, uniform, uvec2, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
5
5
|
const componentDefinition = {
|
|
6
6
|
name: "ProgressiveBlur",
|
|
7
7
|
category: "Blurs",
|
|
@@ -62,6 +62,7 @@ const componentDefinition = {
|
|
|
62
62
|
},
|
|
63
63
|
computeNode: ({ childNode, onCleanup, dimensions, renderer, uniforms }) => {
|
|
64
64
|
if (!childNode) return null;
|
|
65
|
+
if (uniforms.angle.mapComputeInfo || uniforms.falloff.mapComputeInfo) return null;
|
|
65
66
|
const childTexture = convertToTexture(childNode);
|
|
66
67
|
onCleanup(() => {
|
|
67
68
|
if (childTexture?.renderTarget?.dispose) childTexture.renderTarget.dispose();
|
|
@@ -74,10 +75,63 @@ const componentDefinition = {
|
|
|
74
75
|
const centerXU = uniform(0);
|
|
75
76
|
const centerYU = uniform(.5);
|
|
76
77
|
const falloffU = uniform(1);
|
|
77
|
-
const maxRadiusU = uniform(18);
|
|
78
78
|
const aspectU = uniform(1);
|
|
79
79
|
const w = uint(texWidth);
|
|
80
80
|
const h = uint(texHeight);
|
|
81
|
+
function readScalar(entry) {
|
|
82
|
+
return entry.getCpuValue?.() ?? (typeof entry.uniform.value === "number" ? entry.uniform.value : null);
|
|
83
|
+
}
|
|
84
|
+
function updateGeometryUniforms() {
|
|
85
|
+
const angleVal = readScalar(uniforms.angle);
|
|
86
|
+
if (angleVal !== null) angleU.value = angleVal;
|
|
87
|
+
const centerXVal = uniforms.center.uniform.value?.x ?? uniforms.center.uniform.x?.value;
|
|
88
|
+
if (typeof centerXVal === "number") centerXU.value = centerXVal;
|
|
89
|
+
const centerYVal = uniforms.center.uniform.value?.y ?? uniforms.center.uniform.y?.value;
|
|
90
|
+
if (typeof centerYVal === "number") centerYU.value = centerYVal;
|
|
91
|
+
const falloffVal = readScalar(uniforms.falloff);
|
|
92
|
+
if (falloffVal !== null) falloffU.value = falloffVal;
|
|
93
|
+
aspectU.value = dimensions.width / dimensions.height;
|
|
94
|
+
}
|
|
95
|
+
const intensityMapInfo = uniforms.intensity.mapComputeInfo;
|
|
96
|
+
if (intensityMapInfo) {
|
|
97
|
+
const { sourceTexture, channel, inputMin, inputMax, outputMin, outputMax, curve } = intensityMapInfo;
|
|
98
|
+
const fillBlurMap$1 = Fn(() => {
|
|
99
|
+
const idx = instanceIndex;
|
|
100
|
+
const x = idx.mod(w);
|
|
101
|
+
const y = idx.div(w);
|
|
102
|
+
If(y.lessThan(h), () => {
|
|
103
|
+
const u = x.toFloat().add(float(.5)).div(float(texWidth));
|
|
104
|
+
const v = y.toFloat().add(float(.5)).div(float(texHeight));
|
|
105
|
+
const angleRad = angleU.mul(float(Math.PI / 180));
|
|
106
|
+
const direction = vec2(angleRad.cos().div(aspectU), angleRad.sin());
|
|
107
|
+
const centerPos = vec2(centerXU, float(1).sub(centerYU));
|
|
108
|
+
const centeredUV = vec2(u, v).sub(centerPos);
|
|
109
|
+
const directionalDist = max(float(0), centeredUV.dot(direction));
|
|
110
|
+
const blurAmount = smoothstep(float(0), falloffU, directionalDist);
|
|
111
|
+
const mapSample = textureLoad(sourceTexture, uvec2(x, y), int(0));
|
|
112
|
+
let raw;
|
|
113
|
+
if (channel === "alpha") raw = mapSample.a;
|
|
114
|
+
else if (channel === "alphaInverted") raw = mapSample.a.oneMinus();
|
|
115
|
+
else if (channel === "luminanceInverted") raw = dot(mapSample.rgb, vec3(.2126, .7152, .0722)).oneMinus();
|
|
116
|
+
else raw = dot(mapSample.rgb, vec3(.2126, .7152, .0722));
|
|
117
|
+
const inputRange = inputMax.sub(inputMin).max(float(1e-4));
|
|
118
|
+
const maxRadius = mix(outputMin, outputMax, pow(clamp(raw.sub(inputMin).div(inputRange), float(0), float(1)), pow(float(2), curve.negate().mul(float(2))))).mul(float(.36));
|
|
119
|
+
const radius = blurAmount.mul(maxRadius);
|
|
120
|
+
textureStore(blurMapWriteNode, uvec2(x, y), vec4(radius, float(0), float(0), float(1))).toWriteOnly();
|
|
121
|
+
});
|
|
122
|
+
})().compute(texWidth * texHeight, [256]);
|
|
123
|
+
return {
|
|
124
|
+
outputs: {
|
|
125
|
+
childTexture,
|
|
126
|
+
blurredTexture: outputTexture
|
|
127
|
+
},
|
|
128
|
+
getComputeNodes: () => {
|
|
129
|
+
updateGeometryUniforms();
|
|
130
|
+
return [fillBlurMap$1, ...blurNodes];
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
const maxRadiusU = uniform(18);
|
|
81
135
|
const fillBlurMap = Fn(() => {
|
|
82
136
|
const idx = instanceIndex;
|
|
83
137
|
const x = idx.mod(w);
|
|
@@ -86,9 +140,7 @@ const componentDefinition = {
|
|
|
86
140
|
const u = x.toFloat().add(float(.5)).div(float(texWidth));
|
|
87
141
|
const v = y.toFloat().add(float(.5)).div(float(texHeight));
|
|
88
142
|
const angleRad = angleU.mul(float(Math.PI / 180));
|
|
89
|
-
const
|
|
90
|
-
const sinA = angleRad.sin();
|
|
91
|
-
const direction = vec2(cosA.div(aspectU), sinA);
|
|
143
|
+
const direction = vec2(angleRad.cos().div(aspectU), angleRad.sin());
|
|
92
144
|
const centerPos = vec2(centerXU, float(1).sub(centerYU));
|
|
93
145
|
const centeredUV = vec2(u, v).sub(centerPos);
|
|
94
146
|
const directionalDist = max(float(0), centeredUV.dot(direction));
|
|
@@ -102,12 +154,9 @@ const componentDefinition = {
|
|
|
102
154
|
blurredTexture: outputTexture
|
|
103
155
|
},
|
|
104
156
|
getComputeNodes: () => {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
falloffU.value = uniforms.falloff.uniform.value;
|
|
109
|
-
aspectU.value = dimensions.width / dimensions.height;
|
|
110
|
-
maxRadiusU.value = uniforms.intensity.uniform.value * .36;
|
|
157
|
+
updateGeometryUniforms();
|
|
158
|
+
const intensityVal = readScalar(uniforms.intensity);
|
|
159
|
+
if (intensityVal !== null) maxRadiusU.value = intensityVal * .36;
|
|
111
160
|
return [fillBlurMap, ...blurNodes];
|
|
112
161
|
}
|
|
113
162
|
};
|
|
@@ -116,7 +165,9 @@ const componentDefinition = {
|
|
|
116
165
|
if (!childNode) return vec4(0, 0, 0, 0);
|
|
117
166
|
if (computeOutputs?.blurredTexture) {
|
|
118
167
|
const sharp = computeOutputs.childTexture.sample(screenUV);
|
|
119
|
-
|
|
168
|
+
const blurred = texture(computeOutputs.blurredTexture).sample(screenUV);
|
|
169
|
+
const propsPin = uniforms.intensity.uniform.mul(float(0)).add(uniforms.angle.uniform.mul(float(0))).add(uniforms.falloff.uniform.mul(float(0)));
|
|
170
|
+
return unpremultiplyAlpha(vec4(blurred.rgb.add(propsPin), sharp.a));
|
|
120
171
|
}
|
|
121
172
|
const childTexture = convertToTexture(childNode);
|
|
122
173
|
onCleanup(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { l as transformPosition, r as transformAngle } from "./transformations-B5lM6fYX.js";
|
|
2
2
|
import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
|
|
3
|
-
import { n as createVariableGaussianBlurCompute } from "./computeBlur-
|
|
4
|
-
import { Fn, If, abs, convertToTexture, cos, dot, float, instanceIndex, mix, radians, screenUV, sin, smoothstep, texture, textureStore, uint, uniform, uvec2, vec2, vec4, viewportSize } from "three/tsl";
|
|
3
|
+
import { n as createVariableGaussianBlurCompute } from "./computeBlur-C3oX720H.js";
|
|
4
|
+
import { Fn, If, abs, clamp, convertToTexture, cos, dot, float, instanceIndex, int, mix, pow, radians, screenUV, sin, smoothstep, texture, textureLoad, textureStore, uint, uniform, uvec2, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
5
5
|
const componentDefinition = {
|
|
6
6
|
name: "TiltShift",
|
|
7
7
|
category: "Blurs",
|
|
@@ -74,6 +74,7 @@ const componentDefinition = {
|
|
|
74
74
|
},
|
|
75
75
|
computeNode: ({ childNode, onCleanup, dimensions, renderer, uniforms }) => {
|
|
76
76
|
if (!childNode) return null;
|
|
77
|
+
if (uniforms.angle.mapComputeInfo || uniforms.width.mapComputeInfo || uniforms.falloff.mapComputeInfo) return null;
|
|
77
78
|
const childTexture = convertToTexture(childNode);
|
|
78
79
|
onCleanup(() => {
|
|
79
80
|
if (childTexture?.renderTarget?.dispose) childTexture.renderTarget.dispose();
|
|
@@ -87,10 +88,65 @@ const componentDefinition = {
|
|
|
87
88
|
const centerYU = uniform(.5);
|
|
88
89
|
const focusWidthU = uniform(.15);
|
|
89
90
|
const falloffU = uniform(.3);
|
|
90
|
-
const maxRadiusU = uniform(18);
|
|
91
91
|
const aspectU = uniform(1);
|
|
92
92
|
const w = uint(texWidth);
|
|
93
93
|
const h = uint(texHeight);
|
|
94
|
+
function readScalar(entry) {
|
|
95
|
+
return entry.getCpuValue?.() ?? (typeof entry.uniform.value === "number" ? entry.uniform.value : null);
|
|
96
|
+
}
|
|
97
|
+
function updateGeometryUniforms() {
|
|
98
|
+
const angleVal = readScalar(uniforms.angle);
|
|
99
|
+
if (angleVal !== null) angleU.value = angleVal;
|
|
100
|
+
const centerXVal = uniforms.center.uniform.value?.x ?? uniforms.center.uniform.x?.value;
|
|
101
|
+
if (typeof centerXVal === "number") centerXU.value = centerXVal;
|
|
102
|
+
const centerYVal = uniforms.center.uniform.value?.y ?? uniforms.center.uniform.y?.value;
|
|
103
|
+
if (typeof centerYVal === "number") centerYU.value = centerYVal;
|
|
104
|
+
const widthVal = readScalar(uniforms.width);
|
|
105
|
+
if (widthVal !== null) focusWidthU.value = widthVal * .5;
|
|
106
|
+
const falloffVal = readScalar(uniforms.falloff);
|
|
107
|
+
if (falloffVal !== null) falloffU.value = falloffVal;
|
|
108
|
+
aspectU.value = dimensions.width / dimensions.height;
|
|
109
|
+
}
|
|
110
|
+
const intensityMapInfo = uniforms.intensity.mapComputeInfo;
|
|
111
|
+
if (intensityMapInfo) {
|
|
112
|
+
const { sourceTexture, channel, inputMin, inputMax, outputMin, outputMax, curve } = intensityMapInfo;
|
|
113
|
+
const fillBlurMap$1 = Fn(() => {
|
|
114
|
+
const idx = instanceIndex;
|
|
115
|
+
const x = idx.mod(w);
|
|
116
|
+
const y = idx.div(w);
|
|
117
|
+
If(y.lessThan(h), () => {
|
|
118
|
+
const u = x.toFloat().add(float(.5)).div(float(texWidth));
|
|
119
|
+
const v = y.toFloat().add(float(.5)).div(float(texHeight));
|
|
120
|
+
const angleRad = angleU.mul(float(Math.PI / 180));
|
|
121
|
+
const perpVector = vec2(angleRad.sin().negate(), angleRad.cos());
|
|
122
|
+
const centerPos = vec2(centerXU, float(1).sub(centerYU));
|
|
123
|
+
const centeredUV = vec2(u, v).sub(centerPos);
|
|
124
|
+
const distFromLine = abs(dot(vec2(centeredUV.x.mul(aspectU), centeredUV.y), perpVector));
|
|
125
|
+
const blurAmount = smoothstep(focusWidthU, focusWidthU.add(falloffU), distFromLine);
|
|
126
|
+
const mapSample = textureLoad(sourceTexture, uvec2(x, y), int(0));
|
|
127
|
+
let raw;
|
|
128
|
+
if (channel === "alpha") raw = mapSample.a;
|
|
129
|
+
else if (channel === "alphaInverted") raw = mapSample.a.oneMinus();
|
|
130
|
+
else if (channel === "luminanceInverted") raw = dot(mapSample.rgb, vec3(.2126, .7152, .0722)).oneMinus();
|
|
131
|
+
else raw = dot(mapSample.rgb, vec3(.2126, .7152, .0722));
|
|
132
|
+
const inputRange = inputMax.sub(inputMin).max(float(1e-4));
|
|
133
|
+
const maxRadius = mix(outputMin, outputMax, pow(clamp(raw.sub(inputMin).div(inputRange), float(0), float(1)), pow(float(2), curve.negate().mul(float(2))))).mul(float(.36));
|
|
134
|
+
const radius = blurAmount.mul(maxRadius);
|
|
135
|
+
textureStore(blurMapWriteNode, uvec2(x, y), vec4(radius, float(0), float(0), float(1))).toWriteOnly();
|
|
136
|
+
});
|
|
137
|
+
})().compute(texWidth * texHeight, [256]);
|
|
138
|
+
return {
|
|
139
|
+
outputs: {
|
|
140
|
+
childTexture,
|
|
141
|
+
blurredTexture: outputTexture
|
|
142
|
+
},
|
|
143
|
+
getComputeNodes: () => {
|
|
144
|
+
updateGeometryUniforms();
|
|
145
|
+
return [fillBlurMap$1, ...blurNodes];
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
const maxRadiusU = uniform(18);
|
|
94
150
|
const fillBlurMap = Fn(() => {
|
|
95
151
|
const idx = instanceIndex;
|
|
96
152
|
const x = idx.mod(w);
|
|
@@ -99,8 +155,7 @@ const componentDefinition = {
|
|
|
99
155
|
const u = x.toFloat().add(float(.5)).div(float(texWidth));
|
|
100
156
|
const v = y.toFloat().add(float(.5)).div(float(texHeight));
|
|
101
157
|
const angleRad = angleU.mul(float(Math.PI / 180));
|
|
102
|
-
const
|
|
103
|
-
const perpVector = vec2(angleRad.sin().negate(), cosA);
|
|
158
|
+
const perpVector = vec2(angleRad.sin().negate(), angleRad.cos());
|
|
104
159
|
const centerPos = vec2(centerXU, float(1).sub(centerYU));
|
|
105
160
|
const centeredUV = vec2(u, v).sub(centerPos);
|
|
106
161
|
const distFromLine = abs(dot(vec2(centeredUV.x.mul(aspectU), centeredUV.y), perpVector));
|
|
@@ -114,13 +169,9 @@ const componentDefinition = {
|
|
|
114
169
|
blurredTexture: outputTexture
|
|
115
170
|
},
|
|
116
171
|
getComputeNodes: () => {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
focusWidthU.value = uniforms.width.uniform.value * .5;
|
|
121
|
-
falloffU.value = uniforms.falloff.uniform.value;
|
|
122
|
-
aspectU.value = dimensions.width / dimensions.height;
|
|
123
|
-
maxRadiusU.value = uniforms.intensity.uniform.value * .36;
|
|
172
|
+
updateGeometryUniforms();
|
|
173
|
+
const intensityVal = readScalar(uniforms.intensity);
|
|
174
|
+
if (intensityVal !== null) maxRadiusU.value = intensityVal * .36;
|
|
124
175
|
return [fillBlurMap, ...blurNodes];
|
|
125
176
|
}
|
|
126
177
|
};
|
|
@@ -129,7 +180,9 @@ const componentDefinition = {
|
|
|
129
180
|
if (!childNode) return vec4(0, 0, 0, 0);
|
|
130
181
|
if (computeOutputs?.blurredTexture) {
|
|
131
182
|
const sharp = computeOutputs.childTexture.sample(screenUV);
|
|
132
|
-
|
|
183
|
+
const blurred = texture(computeOutputs.blurredTexture).sample(screenUV);
|
|
184
|
+
const propsPin = uniforms.intensity.uniform.mul(float(0)).add(uniforms.width.uniform.mul(float(0))).add(uniforms.falloff.uniform.mul(float(0))).add(uniforms.angle.uniform.mul(float(0)));
|
|
185
|
+
return unpremultiplyAlpha(vec4(blurred.rgb.add(propsPin), sharp.a));
|
|
133
186
|
}
|
|
134
187
|
const childTexture = convertToTexture(childNode);
|
|
135
188
|
onCleanup(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StorageTexture } from "three/webgpu";
|
|
2
2
|
import { FloatType } from "three";
|
|
3
3
|
import { Fn, If, float, instanceIndex, int, storageTexture, textureLoad, textureStore, uint, uniformArray, uvec2, vec4 } from "three/tsl";
|
|
4
|
-
var HALF_KERNEL =
|
|
4
|
+
var HALF_KERNEL = 24;
|
|
5
5
|
var KERNEL_SIZE = HALF_KERNEL * 2 + 1;
|
|
6
6
|
var VAR_SIGMA = HALF_KERNEL / 3;
|
|
7
7
|
var FIXED_WEIGHTS = [];
|
package/dist/core/index.js
CHANGED
|
@@ -8,11 +8,11 @@ import { t as createAnimatedTime } from "./time-DUqSFWvT.js";
|
|
|
8
8
|
import "./Aurora-BPHeGEZ_.js";
|
|
9
9
|
import "./Beam-CAnoOWgt.js";
|
|
10
10
|
import "./Blob-CuRSRXmA.js";
|
|
11
|
-
import "./computeBlur-
|
|
12
|
-
import "./Blur-
|
|
11
|
+
import "./computeBlur-C3oX720H.js";
|
|
12
|
+
import "./Blur-CXXttTb1.js";
|
|
13
13
|
import "./BrightnessContrast-CJTOpQCn.js";
|
|
14
14
|
import "./Bulge-Chpbxxzj.js";
|
|
15
|
-
import "./ChannelBlur-
|
|
15
|
+
import "./ChannelBlur-gzP71FWd.js";
|
|
16
16
|
import "./Checkerboard-ucave4-a.js";
|
|
17
17
|
import "./ChromaFlow-BZXyVHtK.js";
|
|
18
18
|
import "./ChromaticAberration-DsMj-vBw.js";
|
|
@@ -43,10 +43,10 @@ import "./Flower-MAwlZEv8.js";
|
|
|
43
43
|
import "./FlowField-RyqiRxyI.js";
|
|
44
44
|
import "./FlowingGradient-C0Zoyfd6.js";
|
|
45
45
|
import "./Form3D-rKpxb9t3.js";
|
|
46
|
-
import "./Glass-
|
|
46
|
+
import "./Glass-DDBKYclp.js";
|
|
47
47
|
import "./GlassTiles-k1C4a4u8.js";
|
|
48
48
|
import "./Glitch-DzPMkBu4.js";
|
|
49
|
-
import "./Glow-
|
|
49
|
+
import "./Glow-BwaPYDRZ.js";
|
|
50
50
|
import "./Godrays-DAYmq-BP.js";
|
|
51
51
|
import "./Grayscale-lYKBBkGY.js";
|
|
52
52
|
import "./Grid-BJ-nxN3i.js";
|
|
@@ -72,7 +72,7 @@ import "./Plasma-CJWS1TvX.js";
|
|
|
72
72
|
import "./PolarCoordinates-lq6K4WBm.js";
|
|
73
73
|
import "./Polygon-DRCs3CYs.js";
|
|
74
74
|
import "./Posterize-BjH7Zscm.js";
|
|
75
|
-
import "./ProgressiveBlur-
|
|
75
|
+
import "./ProgressiveBlur-B8xwWyTM.js";
|
|
76
76
|
import "./RadialGradient-DiGFPgrn.js";
|
|
77
77
|
import "./RectangularCoordinates-COkNDxi0.js";
|
|
78
78
|
import "./Ring-QApyKPzE.js";
|
|
@@ -93,7 +93,7 @@ import "./Stretch-D7P2R5lV.js";
|
|
|
93
93
|
import "./Stripes-DF8agIiJ.js";
|
|
94
94
|
import "./StudioBackground-BFeNfwEu.js";
|
|
95
95
|
import "./Swirl-BwezrSAA.js";
|
|
96
|
-
import "./TiltShift-
|
|
96
|
+
import "./TiltShift-CI3FlfYk.js";
|
|
97
97
|
import "./Tint-BdXlqlzz.js";
|
|
98
98
|
import "./Trapezoid-BX_hmeZJ.js";
|
|
99
99
|
import "./Tritone-BlJ7cchN.js";
|
|
@@ -109,7 +109,7 @@ import "./WaveDistortion-BKma8-Ju.js";
|
|
|
109
109
|
import "./Weave-xuu_vQ5e.js";
|
|
110
110
|
import "./WebcamTexture-Cf8J7JB1.js";
|
|
111
111
|
import "./ZoomBlur-UcS2iFT2.js";
|
|
112
|
-
import { t as getAllShaders } from "./shaderRegistry-
|
|
112
|
+
import { t as getAllShaders } from "./shaderRegistry-B_84rvO8.js";
|
|
113
113
|
import { Material, Mesh, MeshBasicNodeMaterial, OrthographicCamera, PlaneGeometry, SRGBColorSpace, Scene, Vector2, WebGPURenderer } from "three/webgpu";
|
|
114
114
|
import { WebGLRenderer } from "three";
|
|
115
115
|
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";
|
|
@@ -786,7 +786,13 @@ function shaderRenderer() {
|
|
|
786
786
|
pendingResize = null;
|
|
787
787
|
currentWidth = width$1;
|
|
788
788
|
currentHeight = height$1;
|
|
789
|
-
if (!hasInitialDimensions)
|
|
789
|
+
if (!hasInitialDimensions) {
|
|
790
|
+
hasInitialDimensions = true;
|
|
791
|
+
if (nodeRegistry.nodes.size > 0 && materialUpdateBatchRAF === null) materialUpdateBatchRAF = requestAnimationFrame(() => {
|
|
792
|
+
materialUpdateBatchRAF = null;
|
|
793
|
+
updateMaterial();
|
|
794
|
+
});
|
|
795
|
+
}
|
|
790
796
|
renderer.setSize(width$1, height$1, false);
|
|
791
797
|
const aspectRatio = width$1 / height$1;
|
|
792
798
|
const frustumHeight = 2;
|
|
@@ -966,7 +972,8 @@ function shaderRenderer() {
|
|
|
966
972
|
}
|
|
967
973
|
const newProcessedMasks = new Set(processedMasks);
|
|
968
974
|
newProcessedMasks.add(currentNodeId);
|
|
969
|
-
const
|
|
975
|
+
const mapTexture = trackConvertToTexture(composeNodeTree(sourceNodeId, newProcessedMasks));
|
|
976
|
+
const sampled = mapTexture.sample(sampleUV ?? screenUV);
|
|
970
977
|
let raw;
|
|
971
978
|
switch (mapConfig.channel) {
|
|
972
979
|
case "alpha":
|
|
@@ -991,7 +998,9 @@ function shaderRenderer() {
|
|
|
991
998
|
inputMax: uniform(mapConfig.inputMax),
|
|
992
999
|
outputMin: uniform(mapConfig.outputMin),
|
|
993
1000
|
outputMax: uniform(mapConfig.outputMax),
|
|
994
|
-
curve: uniform(mapConfig.curve ?? 0)
|
|
1001
|
+
curve: uniform(mapConfig.curve ?? 0),
|
|
1002
|
+
sourceTexture: mapTexture,
|
|
1003
|
+
channel: mapConfig.channel
|
|
995
1004
|
};
|
|
996
1005
|
else {
|
|
997
1006
|
nodeInfo.mapUniforms[propName].inputMin.value = mapConfig.inputMin;
|
|
@@ -999,6 +1008,8 @@ function shaderRenderer() {
|
|
|
999
1008
|
nodeInfo.mapUniforms[propName].outputMin.value = mapConfig.outputMin;
|
|
1000
1009
|
nodeInfo.mapUniforms[propName].outputMax.value = mapConfig.outputMax;
|
|
1001
1010
|
nodeInfo.mapUniforms[propName].curve.value = mapConfig.curve ?? 0;
|
|
1011
|
+
nodeInfo.mapUniforms[propName].sourceTexture = mapTexture;
|
|
1012
|
+
nodeInfo.mapUniforms[propName].channel = mapConfig.channel;
|
|
1002
1013
|
}
|
|
1003
1014
|
const { inputMin: inputMinU, inputMax: inputMaxU, outputMin: outputMinU, outputMax: outputMaxU, curve: curveU } = nodeInfo.mapUniforms[propName];
|
|
1004
1015
|
const inputRange = max(inputMaxU.sub(inputMinU), 1e-4);
|
|
@@ -1066,7 +1077,8 @@ function shaderRenderer() {
|
|
|
1066
1077
|
const buildEffectiveUniforms = (baseUniforms, maps, nodeId, processedMasks) => {
|
|
1067
1078
|
if (!maps || Object.keys(maps).length === 0) return baseUniforms;
|
|
1068
1079
|
const effectiveUniforms = { ...baseUniforms };
|
|
1069
|
-
const
|
|
1080
|
+
const nodeInfo = nodeRegistry.nodes.get(nodeId);
|
|
1081
|
+
const customSampleUVs = nodeInfo?.mapSampleUVsFunc?.(baseUniforms) ?? {};
|
|
1070
1082
|
for (const [propName, driverConfig] of Object.entries(maps)) {
|
|
1071
1083
|
let resolvedNode = null;
|
|
1072
1084
|
if (driverConfig.type === "map") {
|
|
@@ -1086,10 +1098,38 @@ function shaderRenderer() {
|
|
|
1086
1098
|
if (!(propName in effectiveUniforms)) continue;
|
|
1087
1099
|
resolvedNode = resolveAutoAnimateForProp(driverConfig, nodeId, propName);
|
|
1088
1100
|
}
|
|
1089
|
-
if (resolvedNode !== null && propName in effectiveUniforms)
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1101
|
+
if (resolvedNode !== null && propName in effectiveUniforms) {
|
|
1102
|
+
let mapComputeInfo = void 0;
|
|
1103
|
+
if (driverConfig.type === "map") {
|
|
1104
|
+
const mu = nodeInfo?.mapUniforms?.[propName];
|
|
1105
|
+
if (mu?.sourceTexture && mu?.channel) mapComputeInfo = {
|
|
1106
|
+
sourceTexture: mu.sourceTexture,
|
|
1107
|
+
channel: mu.channel,
|
|
1108
|
+
inputMin: mu.inputMin,
|
|
1109
|
+
inputMax: mu.inputMax,
|
|
1110
|
+
outputMin: mu.outputMin,
|
|
1111
|
+
outputMax: mu.outputMax,
|
|
1112
|
+
curve: mu.curve
|
|
1113
|
+
};
|
|
1114
|
+
}
|
|
1115
|
+
let getCpuValue = void 0;
|
|
1116
|
+
if (driverConfig.type === "mouse") getCpuValue = () => {
|
|
1117
|
+
const state = nodeInfo?.mouseDriverState?.[propName];
|
|
1118
|
+
const mu = nodeInfo?.mapUniforms?.[propName];
|
|
1119
|
+
if (!state || !mu) return 0;
|
|
1120
|
+
const smooth = state.smoothedUniform.value;
|
|
1121
|
+
const oMin = mu.outputMin.value;
|
|
1122
|
+
const oMax = mu.outputMax.value;
|
|
1123
|
+
const exp$1 = Math.pow(2, -(mu.curve.value * 2));
|
|
1124
|
+
return oMin + (oMax - oMin) * Math.pow(smooth, exp$1);
|
|
1125
|
+
};
|
|
1126
|
+
effectiveUniforms[propName] = {
|
|
1127
|
+
...effectiveUniforms[propName],
|
|
1128
|
+
uniform: resolvedNode,
|
|
1129
|
+
...mapComputeInfo ? { mapComputeInfo } : {},
|
|
1130
|
+
...getCpuValue ? { getCpuValue } : {}
|
|
1131
|
+
};
|
|
1132
|
+
}
|
|
1093
1133
|
}
|
|
1094
1134
|
return effectiveUniforms;
|
|
1095
1135
|
};
|
package/dist/core/registry.js
CHANGED
|
@@ -8,11 +8,11 @@ import "./time-DUqSFWvT.js";
|
|
|
8
8
|
import "./Aurora-BPHeGEZ_.js";
|
|
9
9
|
import "./Beam-CAnoOWgt.js";
|
|
10
10
|
import "./Blob-CuRSRXmA.js";
|
|
11
|
-
import "./computeBlur-
|
|
12
|
-
import "./Blur-
|
|
11
|
+
import "./computeBlur-C3oX720H.js";
|
|
12
|
+
import "./Blur-CXXttTb1.js";
|
|
13
13
|
import "./BrightnessContrast-CJTOpQCn.js";
|
|
14
14
|
import "./Bulge-Chpbxxzj.js";
|
|
15
|
-
import "./ChannelBlur-
|
|
15
|
+
import "./ChannelBlur-gzP71FWd.js";
|
|
16
16
|
import "./Checkerboard-ucave4-a.js";
|
|
17
17
|
import "./ChromaFlow-BZXyVHtK.js";
|
|
18
18
|
import "./ChromaticAberration-DsMj-vBw.js";
|
|
@@ -43,10 +43,10 @@ import "./Flower-MAwlZEv8.js";
|
|
|
43
43
|
import "./FlowField-RyqiRxyI.js";
|
|
44
44
|
import "./FlowingGradient-C0Zoyfd6.js";
|
|
45
45
|
import "./Form3D-rKpxb9t3.js";
|
|
46
|
-
import "./Glass-
|
|
46
|
+
import "./Glass-DDBKYclp.js";
|
|
47
47
|
import "./GlassTiles-k1C4a4u8.js";
|
|
48
48
|
import "./Glitch-DzPMkBu4.js";
|
|
49
|
-
import "./Glow-
|
|
49
|
+
import "./Glow-BwaPYDRZ.js";
|
|
50
50
|
import "./Godrays-DAYmq-BP.js";
|
|
51
51
|
import "./Grayscale-lYKBBkGY.js";
|
|
52
52
|
import "./Grid-BJ-nxN3i.js";
|
|
@@ -72,7 +72,7 @@ import "./Plasma-CJWS1TvX.js";
|
|
|
72
72
|
import "./PolarCoordinates-lq6K4WBm.js";
|
|
73
73
|
import "./Polygon-DRCs3CYs.js";
|
|
74
74
|
import "./Posterize-BjH7Zscm.js";
|
|
75
|
-
import "./ProgressiveBlur-
|
|
75
|
+
import "./ProgressiveBlur-B8xwWyTM.js";
|
|
76
76
|
import "./RadialGradient-DiGFPgrn.js";
|
|
77
77
|
import "./RectangularCoordinates-COkNDxi0.js";
|
|
78
78
|
import "./Ring-QApyKPzE.js";
|
|
@@ -93,7 +93,7 @@ import "./Stretch-D7P2R5lV.js";
|
|
|
93
93
|
import "./Stripes-DF8agIiJ.js";
|
|
94
94
|
import "./StudioBackground-BFeNfwEu.js";
|
|
95
95
|
import "./Swirl-BwezrSAA.js";
|
|
96
|
-
import "./TiltShift-
|
|
96
|
+
import "./TiltShift-CI3FlfYk.js";
|
|
97
97
|
import "./Tint-BdXlqlzz.js";
|
|
98
98
|
import "./Trapezoid-BX_hmeZJ.js";
|
|
99
99
|
import "./Tritone-BlJ7cchN.js";
|
|
@@ -109,5 +109,5 @@ import "./WaveDistortion-BKma8-Ju.js";
|
|
|
109
109
|
import "./Weave-xuu_vQ5e.js";
|
|
110
110
|
import "./WebcamTexture-Cf8J7JB1.js";
|
|
111
111
|
import "./ZoomBlur-UcS2iFT2.js";
|
|
112
|
-
import { a as shaderRegistry, i as getShadersByCategory, n as getShaderByName, r as getShaderCategories, t as getAllShaders } from "./shaderRegistry-
|
|
112
|
+
import { a as shaderRegistry, i as getShadersByCategory, n as getShaderByName, r as getShaderCategories, t as getAllShaders } from "./shaderRegistry-B_84rvO8.js";
|
|
113
113
|
export { getAllShaders, getShaderByName, getShaderCategories, getShadersByCategory, shaderRegistry };
|
package/dist/core/renderer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Node, WebGPURenderer } from 'three/webgpu';
|
|
2
2
|
import { WebGLRenderer } from 'three';
|
|
3
|
-
import { CleanupCallback, ComponentDefinition, NodeMetadata, RenderCallback, ResizeCallback, UniformsMap } from './types';
|
|
3
|
+
import { CleanupCallback, ComponentDefinition, MapChannel, NodeMetadata, RenderCallback, ResizeCallback, UniformsMap } from './types';
|
|
4
4
|
import { PerformanceStats } from './performanceTracker';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -99,6 +99,8 @@ interface NodeInfo {
|
|
|
99
99
|
/**
|
|
100
100
|
* Cached uniform nodes for map remapping values, keyed by prop name.
|
|
101
101
|
* Allows inputMin/inputMax/outputMin/outputMax updates to bypass shader recompilation.
|
|
102
|
+
* Also stores the source texture node and channel so compute shaders can sample
|
|
103
|
+
* the map per-pixel via textureLoad rather than relying on screenUV.
|
|
102
104
|
*/
|
|
103
105
|
mapUniforms?: Record<string, {
|
|
104
106
|
inputMin: any;
|
|
@@ -106,6 +108,8 @@ interface NodeInfo {
|
|
|
106
108
|
outputMin: any;
|
|
107
109
|
outputMax: any;
|
|
108
110
|
curve: any;
|
|
111
|
+
sourceTexture?: any;
|
|
112
|
+
channel?: MapChannel;
|
|
109
113
|
}>;
|
|
110
114
|
/**
|
|
111
115
|
* Per-prop state for mouse-driven props.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,KAAK,IAAI,EAMT,cAAc,EACjB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAC,aAAa,EAAC,MAAM,OAAO,CAAA;AAInC,OAAO,EAAoB,eAAe,EAAE,mBAAmB,EAA8D,YAAY,EAAE,cAAc,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,KAAK,IAAI,EAMT,cAAc,EACjB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAC,aAAa,EAAC,MAAM,OAAO,CAAA;AAInC,OAAO,EAAoB,eAAe,EAAE,mBAAmB,EAAE,UAAU,EAA8D,YAAY,EAAE,cAAc,EAAE,cAAc,EAAqB,WAAW,EAAC,MAAM,SAAS,CAAA;AACrO,OAAO,EAAqB,gBAAgB,EAAC,MAAM,sBAAsB,CAAA;AAMzE;;GAEG;AACH,UAAU,QAAQ;IAEd;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,gBAAgB,EAAE,mBAAmB,CAAC,cAAc,CAAC,CAAA;IAErD;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IAEvB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAA;IAEpB;;;;OAIG;IACH,aAAa,EAAE,OAAO,CAAA;IAEtB;;OAEG;IACH,cAAc,EAAE,GAAG,CAAA;IAEnB;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAA;IAEtB;;OAEG;IACH,QAAQ,EAAE,WAAW,CAAA;IAErB;;;OAGG;IACH,gBAAgB,EAAE,eAAe,EAAE,CAAA;IAEnC;;;OAGG;IACH,qBAAqB,EAAE,cAAc,EAAE,CAAA;IAEvC;;;OAGG;IACH,oBAAoB,EAAE,cAAc,EAAE,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BAngBf,IAAI;yBAyBL,IAAI;yBA1OE,OAAO,CAAC,IAAI,CAAC;+BAgMb,gBAAgB;;eA4hBmB,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;;2BArBpE,QAAQ,GAAG,OAAO,GAAG,IAAI;;2BAwB1B,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI;;;mCA3zEZ,MAAM,KAAG,QAAQ,EAAE;oCA+CzC,IAAI,YACF,QAAQ,UACV,MAAM,kBACE,GAAG,CAAC,MAAM,CAAC,gBACb,IAAI,KACnB,IAAI;0CA0VK,IAAI,YACF,QAAQ,KACnB,IAAI;;;;EAy7DV"}
|
|
@@ -3,10 +3,10 @@ import { n as componentDefinition$1 } from "./Ascii-BwSMmD6Z.js";
|
|
|
3
3
|
import { n as componentDefinition$2 } from "./Aurora-BPHeGEZ_.js";
|
|
4
4
|
import { n as componentDefinition$3 } from "./Beam-CAnoOWgt.js";
|
|
5
5
|
import { n as componentDefinition$4 } from "./Blob-CuRSRXmA.js";
|
|
6
|
-
import { n as componentDefinition$5 } from "./Blur-
|
|
6
|
+
import { n as componentDefinition$5 } from "./Blur-CXXttTb1.js";
|
|
7
7
|
import { n as componentDefinition$6 } from "./BrightnessContrast-CJTOpQCn.js";
|
|
8
8
|
import { n as componentDefinition$7 } from "./Bulge-Chpbxxzj.js";
|
|
9
|
-
import { n as componentDefinition$8 } from "./ChannelBlur-
|
|
9
|
+
import { n as componentDefinition$8 } from "./ChannelBlur-gzP71FWd.js";
|
|
10
10
|
import { n as componentDefinition$9 } from "./Checkerboard-ucave4-a.js";
|
|
11
11
|
import { n as componentDefinition$10 } from "./ChromaFlow-BZXyVHtK.js";
|
|
12
12
|
import { n as componentDefinition$11 } from "./ChromaticAberration-DsMj-vBw.js";
|
|
@@ -36,10 +36,10 @@ import { n as componentDefinition$34 } from "./Flower-MAwlZEv8.js";
|
|
|
36
36
|
import { n as componentDefinition$35 } from "./FlowField-RyqiRxyI.js";
|
|
37
37
|
import { n as componentDefinition$36 } from "./FlowingGradient-C0Zoyfd6.js";
|
|
38
38
|
import { n as componentDefinition$37 } from "./Form3D-rKpxb9t3.js";
|
|
39
|
-
import { n as componentDefinition$38 } from "./Glass-
|
|
39
|
+
import { n as componentDefinition$38 } from "./Glass-DDBKYclp.js";
|
|
40
40
|
import { n as componentDefinition$39 } from "./GlassTiles-k1C4a4u8.js";
|
|
41
41
|
import { n as componentDefinition$40 } from "./Glitch-DzPMkBu4.js";
|
|
42
|
-
import { n as componentDefinition$41 } from "./Glow-
|
|
42
|
+
import { n as componentDefinition$41 } from "./Glow-BwaPYDRZ.js";
|
|
43
43
|
import { n as componentDefinition$42 } from "./Godrays-DAYmq-BP.js";
|
|
44
44
|
import { n as componentDefinition$43 } from "./Grayscale-lYKBBkGY.js";
|
|
45
45
|
import { n as componentDefinition$44 } from "./Grid-BJ-nxN3i.js";
|
|
@@ -65,7 +65,7 @@ import { n as componentDefinition$63 } from "./Plasma-CJWS1TvX.js";
|
|
|
65
65
|
import { n as componentDefinition$64 } from "./PolarCoordinates-lq6K4WBm.js";
|
|
66
66
|
import { n as componentDefinition$65 } from "./Polygon-DRCs3CYs.js";
|
|
67
67
|
import { n as componentDefinition$66 } from "./Posterize-BjH7Zscm.js";
|
|
68
|
-
import { n as componentDefinition$67 } from "./ProgressiveBlur-
|
|
68
|
+
import { n as componentDefinition$67 } from "./ProgressiveBlur-B8xwWyTM.js";
|
|
69
69
|
import { n as componentDefinition$68 } from "./RadialGradient-DiGFPgrn.js";
|
|
70
70
|
import { n as componentDefinition$69 } from "./RectangularCoordinates-COkNDxi0.js";
|
|
71
71
|
import { n as componentDefinition$70 } from "./Ring-QApyKPzE.js";
|
|
@@ -86,7 +86,7 @@ import { n as componentDefinition$84 } from "./Stretch-D7P2R5lV.js";
|
|
|
86
86
|
import { n as componentDefinition$85 } from "./Stripes-DF8agIiJ.js";
|
|
87
87
|
import { n as componentDefinition$86 } from "./StudioBackground-BFeNfwEu.js";
|
|
88
88
|
import { n as componentDefinition$87 } from "./Swirl-BwezrSAA.js";
|
|
89
|
-
import { n as componentDefinition$88 } from "./TiltShift-
|
|
89
|
+
import { n as componentDefinition$88 } from "./TiltShift-CI3FlfYk.js";
|
|
90
90
|
import { n as componentDefinition$89 } from "./Tint-BdXlqlzz.js";
|
|
91
91
|
import { n as componentDefinition$90 } from "./Trapezoid-BX_hmeZJ.js";
|
|
92
92
|
import { n as componentDefinition$91 } from "./Tritone-BlJ7cchN.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/Blur/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAwC,MAAM,iBAAiB,CAAA;AAM1F,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,CAAA;CACpB;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/Blur/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAwC,MAAM,iBAAiB,CAAA;AAM1F,MAAM,WAAW,cAAc;IAC3B,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 "../../alpha-C4ptedXe.js";
|
|
2
|
-
import "../../computeBlur-
|
|
3
|
-
import { n as componentDefinition, t as Blur_default } from "../../Blur-
|
|
2
|
+
import "../../computeBlur-C3oX720H.js";
|
|
3
|
+
import { n as componentDefinition, t as Blur_default } from "../../Blur-CXXttTb1.js";
|
|
4
4
|
export { componentDefinition, Blur_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../alpha-C4ptedXe.js";
|
|
2
|
-
import "../../computeBlur-
|
|
3
|
-
import { n as componentDefinition, t as ChannelBlur_default } from "../../ChannelBlur-
|
|
2
|
+
import "../../computeBlur-C3oX720H.js";
|
|
3
|
+
import { n as componentDefinition, t as ChannelBlur_default } from "../../ChannelBlur-gzP71FWd.js";
|
|
4
4
|
export { componentDefinition, ChannelBlur_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
|
-
import "../../computeBlur-
|
|
2
|
+
import "../../computeBlur-C3oX720H.js";
|
|
3
3
|
import "../../sdf-DyC2H_qS.js";
|
|
4
|
-
import { n as componentDefinition, t as Glass_default } from "../../Glass-
|
|
4
|
+
import { n as componentDefinition, t as Glass_default } from "../../Glass-DDBKYclp.js";
|
|
5
5
|
export { componentDefinition, Glass_default as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/Glow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAwC,MAAM,iBAAiB,CAAA;AAM1F,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;CACf;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/Glow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAwC,MAAM,iBAAiB,CAAA;AAM1F,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;CACf;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CAwLnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../alpha-C4ptedXe.js";
|
|
2
|
-
import "../../computeBlur-
|
|
3
|
-
import { n as componentDefinition, t as Glow_default } from "../../Glow-
|
|
2
|
+
import "../../computeBlur-C3oX720H.js";
|
|
3
|
+
import { n as componentDefinition, t as Glow_default } from "../../Glow-BwaPYDRZ.js";
|
|
4
4
|
export { componentDefinition, Glow_default as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/ProgressiveBlur/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAwC,MAAM,iBAAiB,CAAA;AAM1F,OAAO,EAAC,cAAc,EAAC,MAAM,qCAAqC,CAAA;AAClE,OAAO,EAAC,iBAAiB,EAAC,MAAM,qCAAqC,CAAA;AAErE,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3C,MAAM,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAA;IAC/C,OAAO,EAAE,MAAM,CAAA;CAClB;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/ProgressiveBlur/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAwC,MAAM,iBAAiB,CAAA;AAM1F,OAAO,EAAC,cAAc,EAAC,MAAM,qCAAqC,CAAA;AAClE,OAAO,EAAC,iBAAiB,EAAC,MAAM,qCAAqC,CAAA;AAErE,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3C,MAAM,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAA;IAC/C,OAAO,EAAE,MAAM,CAAA;CAClB;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CAyPnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../alpha-C4ptedXe.js";
|
|
3
|
-
import "../../computeBlur-
|
|
4
|
-
import { n as componentDefinition, t as ProgressiveBlur_default } from "../../ProgressiveBlur-
|
|
3
|
+
import "../../computeBlur-C3oX720H.js";
|
|
4
|
+
import { n as componentDefinition, t as ProgressiveBlur_default } from "../../ProgressiveBlur-B8xwWyTM.js";
|
|
5
5
|
export { componentDefinition, ProgressiveBlur_default as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/TiltShift/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAwC,MAAM,iBAAiB,CAAA;AAM1F,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAC,MAAM,qCAAqC,CAAA;AAErF,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3C,MAAM,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAA;CAClD;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/TiltShift/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAwC,MAAM,iBAAiB,CAAA;AAM1F,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAC,MAAM,qCAAqC,CAAA;AAErF,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3C,MAAM,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAA;CAClD;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CA2QnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../alpha-C4ptedXe.js";
|
|
3
|
-
import "../../computeBlur-
|
|
4
|
-
import { n as componentDefinition, t as TiltShift_default } from "../../TiltShift-
|
|
3
|
+
import "../../computeBlur-C3oX720H.js";
|
|
4
|
+
import { n as componentDefinition, t as TiltShift_default } from "../../TiltShift-CI3FlfYk.js";
|
|
5
5
|
export { componentDefinition, TiltShift_default as default };
|
package/dist/core/types.d.ts
CHANGED
|
@@ -9,6 +9,26 @@ export interface UniformDefinition {
|
|
|
9
9
|
compileTime?: boolean;
|
|
10
10
|
compileTimeWhen?: (previousValue: any, newValue: any) => boolean;
|
|
11
11
|
_lastCompiledValue?: any;
|
|
12
|
+
/**
|
|
13
|
+
* Present when a driver resolves to a GPU-side TSL expression (e.g. mouse driver).
|
|
14
|
+
* Returns the current CPU-side scalar value so compute shaders can read it without
|
|
15
|
+
* needing to evaluate the GPU expression. Updated every frame via driver state.
|
|
16
|
+
*/
|
|
17
|
+
getCpuValue?: () => number;
|
|
18
|
+
/**
|
|
19
|
+
* Present when a prop-map driver is active. Gives compute shaders access to the
|
|
20
|
+
* source texture and remapping uniforms so they can sample per-pixel values via
|
|
21
|
+
* textureLoad rather than relying on the fragment-only screenUV.
|
|
22
|
+
*/
|
|
23
|
+
mapComputeInfo?: {
|
|
24
|
+
sourceTexture: any;
|
|
25
|
+
channel: MapChannel;
|
|
26
|
+
inputMin: any;
|
|
27
|
+
inputMax: any;
|
|
28
|
+
outputMin: any;
|
|
29
|
+
outputMax: any;
|
|
30
|
+
curve: any;
|
|
31
|
+
};
|
|
12
32
|
}
|
|
13
33
|
/**
|
|
14
34
|
* Defines types of masks that can be applied to components
|
package/dist/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAC/C,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,iCAAiC,CAAA;AAGpE,YAAY,EAAC,eAAe,EAAC,CAAA;AAE7B,MAAM,WAAW,iBAAiB;IAC9B,OAAO,EAAE,GAAG,CAAA;IACZ,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAA;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,eAAe,CAAC,EAAE,CAAC,aAAa,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,KAAK,OAAO,CAAA;IAChE,kBAAkB,CAAC,EAAE,GAAG,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAC/C,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,iCAAiC,CAAA;AAGpE,YAAY,EAAC,eAAe,EAAC,CAAA;AAE7B,MAAM,WAAW,iBAAiB;IAC9B,OAAO,EAAE,GAAG,CAAA;IACZ,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAA;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,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BAAmB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc;IAE1E;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;;OAIG;IACH,YAAY,CAAC,EAAE;QACX,sEAAsE;QACtE,OAAO,EAAE,MAAM,CAAA;QACf,2FAA2F;QAC3F,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,mDAAmD;QACnD,QAAQ,CAAC,EAAE;YACP,GAAG,EAAE,MAAM,CAAA;YACX,KAAK,EAAE,MAAM,CAAA;SAChB,CAAA;KACJ,CAAA;IAED;;OAEG;IACH,KAAK,EAAE;SACF,CAAC,IAAI,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACnC,CAAA;IAED;;OAEG;IACH,YAAY,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAA;IAElD;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,iBAAiB,GAAG,IAAI,CAAA;IAEtE;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAChE"}
|
package/dist/js/createShader.js
CHANGED
|
@@ -41,7 +41,7 @@ async function createShader(canvas, preset, options) {
|
|
|
41
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.97", 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
|
@@ -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.97", disableTelemetry, isPreview);
|
|
93
93
|
if (telemetryCollectorRef.current) telemetryCollectorRef.current.start();
|
|
94
94
|
telemetryStartTimeoutRef.current = null;
|
|
95
95
|
} else telemetryStartTimeoutRef.current = window.setTimeout(checkRendering, 500);
|
|
@@ -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.97";
|
|
71
71
|
telemetryCollector = startTelemetry(rendererInstance, version, props.disableTelemetry, props.isPreview);
|
|
72
72
|
if (telemetryCollector) {
|
|
73
73
|
telemetryCollector.start();
|
package/dist/svelte/index.js
CHANGED
|
@@ -20546,7 +20546,7 @@ function Shader($$anchor, $$props) {
|
|
|
20546
20546
|
const checkRendering = () => {
|
|
20547
20547
|
if (!rendererInstance) return;
|
|
20548
20548
|
if (rendererInstance.getPerformanceStats().fps > 0) {
|
|
20549
|
-
telemetryCollector = startTelemetry(rendererInstance, "2.5.
|
|
20549
|
+
telemetryCollector = startTelemetry(rendererInstance, "2.5.97", disableTelemetry(), isPreview());
|
|
20550
20550
|
if (telemetryCollector) telemetryCollector.start();
|
|
20551
20551
|
telemetryStartTimeout = null;
|
|
20552
20552
|
} 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.97", props.disableTelemetry, props.isPreview);
|
|
64
64
|
if (telemetryCollector) telemetryCollector.start();
|
|
65
65
|
telemetryStartTimeout = null;
|
|
66
66
|
} else telemetryStartTimeout = setTimeout(checkRendering, 500);
|