shaders 2.5.102 → 2.5.103
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/Halftone-XFa7by1s.js +287 -0
- package/dist/core/index.js +2 -2
- package/dist/core/registry.js +2 -2
- package/dist/core/{shaderRegistry-B6D8HKv7.js → shaderRegistry-BWuH2me2.js} +1 -1
- package/dist/core/shaders/Halftone/index.d.ts +76 -4
- package/dist/core/shaders/Halftone/index.d.ts.map +1 -1
- package/dist/core/shaders/Halftone/index.js +2 -1
- package/dist/js/createShader.js +1 -1
- package/dist/js/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/js/utils/generatePresetCode.js +12 -1
- package/dist/react/Shader.js +1 -1
- package/dist/react/components/Halftone.d.ts +7 -2
- package/dist/react/components/Halftone.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +12 -1
- package/dist/registry.js +368 -16
- package/dist/solid/components/Halftone.d.ts +7 -2
- package/dist/solid/components/Halftone.d.ts.map +1 -1
- package/dist/solid/engine/Shader.js +1 -1
- package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/solid/utils/generatePresetCode.js +12 -1
- package/dist/svelte/components/Halftone.svelte.d.ts +6 -1
- package/dist/svelte/{generatePresetCode-BygAdFRo.js → generatePresetCode-psTzYsW3.js} +12 -1
- package/dist/svelte/index.js +2 -2
- package/dist/svelte/source/components/Halftone.svelte +6 -1
- package/dist/svelte/utils/generatePresetCode.js +1 -1
- package/dist/vue/Halftone.vue_vue_type_script_setup_true_lang.js +13 -2
- package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/vue/components/Halftone.vue.d.ts +6 -1
- package/dist/vue/components/Halftone.vue.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +12 -1
- package/package.json +1 -1
- package/dist/core/Halftone-BVL2oy37.js +0 -67
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { a as transformColor, r as transformAngle } from "./transformations-B5lM6fYX.js";
|
|
2
|
+
import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
|
|
3
|
+
import { convertToTexture, cos, dot, float, fract, length, max, mix, radians, screenUV, sin, smoothstep, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
4
|
+
var transformStyle = (value) => {
|
|
5
|
+
return value === "cmyk" ? 1 : 0;
|
|
6
|
+
};
|
|
7
|
+
const componentDefinition = {
|
|
8
|
+
name: "Halftone",
|
|
9
|
+
category: "Stylize",
|
|
10
|
+
description: "Halftone dot pattern effect for printing aesthetics",
|
|
11
|
+
requiresRTT: true,
|
|
12
|
+
requiresChild: true,
|
|
13
|
+
props: {
|
|
14
|
+
style: {
|
|
15
|
+
default: "classic",
|
|
16
|
+
transform: transformStyle,
|
|
17
|
+
compileTime: true,
|
|
18
|
+
description: "Halftone rendering style",
|
|
19
|
+
ui: {
|
|
20
|
+
type: "select",
|
|
21
|
+
options: [{
|
|
22
|
+
label: "Simple",
|
|
23
|
+
value: "classic"
|
|
24
|
+
}, {
|
|
25
|
+
label: "CMYK Print",
|
|
26
|
+
value: "cmyk"
|
|
27
|
+
}],
|
|
28
|
+
label: "Style",
|
|
29
|
+
group: "Effect"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
frequency: {
|
|
33
|
+
default: 100,
|
|
34
|
+
description: "Frequency of the halftone dots",
|
|
35
|
+
ui: {
|
|
36
|
+
type: ["range", "map"],
|
|
37
|
+
min: 10,
|
|
38
|
+
max: 300,
|
|
39
|
+
step: 1,
|
|
40
|
+
label: "Frequency",
|
|
41
|
+
group: "Effect"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
angle: {
|
|
45
|
+
default: 45,
|
|
46
|
+
transform: transformAngle,
|
|
47
|
+
description: "Rotation angle of the pattern (in degrees)",
|
|
48
|
+
ui: {
|
|
49
|
+
type: ["range", "map"],
|
|
50
|
+
min: 0,
|
|
51
|
+
max: 360,
|
|
52
|
+
step: 1,
|
|
53
|
+
label: "Angle",
|
|
54
|
+
group: "Effect",
|
|
55
|
+
condition: { style: "classic" }
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
cyanAngle: {
|
|
59
|
+
default: 15,
|
|
60
|
+
transform: transformAngle,
|
|
61
|
+
description: "Screen angle for the cyan plate (in degrees)",
|
|
62
|
+
ui: {
|
|
63
|
+
type: ["range", "map"],
|
|
64
|
+
min: 0,
|
|
65
|
+
max: 360,
|
|
66
|
+
step: 1,
|
|
67
|
+
label: "Cyan Angle",
|
|
68
|
+
group: "Plate Angles",
|
|
69
|
+
condition: { style: "cmyk" }
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
magentaAngle: {
|
|
73
|
+
default: 75,
|
|
74
|
+
transform: transformAngle,
|
|
75
|
+
description: "Screen angle for the magenta plate (in degrees)",
|
|
76
|
+
ui: {
|
|
77
|
+
type: ["range", "map"],
|
|
78
|
+
min: 0,
|
|
79
|
+
max: 360,
|
|
80
|
+
step: 1,
|
|
81
|
+
label: "Magenta Angle",
|
|
82
|
+
group: "Plate Angles",
|
|
83
|
+
condition: { style: "cmyk" }
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
yellowAngle: {
|
|
87
|
+
default: 0,
|
|
88
|
+
transform: transformAngle,
|
|
89
|
+
description: "Screen angle for the yellow plate (in degrees)",
|
|
90
|
+
ui: {
|
|
91
|
+
type: ["range", "map"],
|
|
92
|
+
min: 0,
|
|
93
|
+
max: 360,
|
|
94
|
+
step: 1,
|
|
95
|
+
label: "Yellow Angle",
|
|
96
|
+
group: "Plate Angles",
|
|
97
|
+
condition: { style: "cmyk" }
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
blackAngle: {
|
|
101
|
+
default: 45,
|
|
102
|
+
transform: transformAngle,
|
|
103
|
+
description: "Screen angle for the black plate (in degrees)",
|
|
104
|
+
ui: {
|
|
105
|
+
type: ["range", "map"],
|
|
106
|
+
min: 0,
|
|
107
|
+
max: 360,
|
|
108
|
+
step: 1,
|
|
109
|
+
label: "Black Angle",
|
|
110
|
+
group: "Plate Angles",
|
|
111
|
+
condition: { style: "cmyk" }
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
misprint: {
|
|
115
|
+
default: 0,
|
|
116
|
+
description: "Simulated mis-registration between plates. Plates are offset around the misprint angle, producing colour fringing at the edges of inked regions.",
|
|
117
|
+
ui: {
|
|
118
|
+
type: ["range", "map"],
|
|
119
|
+
min: 0,
|
|
120
|
+
max: .01,
|
|
121
|
+
step: 5e-4,
|
|
122
|
+
label: "Misprint",
|
|
123
|
+
group: "Effect",
|
|
124
|
+
condition: { style: "cmyk" }
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
misprintAngle: {
|
|
128
|
+
default: 0,
|
|
129
|
+
transform: transformAngle,
|
|
130
|
+
description: "Direction the plates drift apart. Rotating this rotates the colour-fringing pattern.",
|
|
131
|
+
ui: {
|
|
132
|
+
type: ["range", "map"],
|
|
133
|
+
min: 0,
|
|
134
|
+
max: 360,
|
|
135
|
+
step: 1,
|
|
136
|
+
label: "Misprint Angle",
|
|
137
|
+
group: "Effect",
|
|
138
|
+
condition: { style: "cmyk" }
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
paperColor: {
|
|
142
|
+
default: "#ffffff",
|
|
143
|
+
transform: transformColor,
|
|
144
|
+
description: "Paper/substrate color shown where no ink lands",
|
|
145
|
+
ui: {
|
|
146
|
+
type: "color",
|
|
147
|
+
label: "Paper",
|
|
148
|
+
group: "Inks",
|
|
149
|
+
condition: { style: "cmyk" }
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
cyanColor: {
|
|
153
|
+
default: "#00ffff",
|
|
154
|
+
transform: transformColor,
|
|
155
|
+
description: "Cyan ink color",
|
|
156
|
+
ui: {
|
|
157
|
+
type: "color",
|
|
158
|
+
label: "Cyan",
|
|
159
|
+
group: "Inks",
|
|
160
|
+
condition: { style: "cmyk" }
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
magentaColor: {
|
|
164
|
+
default: "#ff00ff",
|
|
165
|
+
transform: transformColor,
|
|
166
|
+
description: "Magenta ink color",
|
|
167
|
+
ui: {
|
|
168
|
+
type: "color",
|
|
169
|
+
label: "Magenta",
|
|
170
|
+
group: "Inks",
|
|
171
|
+
condition: { style: "cmyk" }
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
yellowColor: {
|
|
175
|
+
default: "#ffff00",
|
|
176
|
+
transform: transformColor,
|
|
177
|
+
description: "Yellow ink color",
|
|
178
|
+
ui: {
|
|
179
|
+
type: "color",
|
|
180
|
+
label: "Yellow",
|
|
181
|
+
group: "Inks",
|
|
182
|
+
condition: { style: "cmyk" }
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
blackColor: {
|
|
186
|
+
default: "#000000",
|
|
187
|
+
transform: transformColor,
|
|
188
|
+
description: "Black (key) ink color",
|
|
189
|
+
ui: {
|
|
190
|
+
type: "color",
|
|
191
|
+
label: "Black",
|
|
192
|
+
group: "Inks",
|
|
193
|
+
condition: { style: "cmyk" }
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
fragmentNode: ({ uniforms, childNode, onCleanup }) => {
|
|
198
|
+
if (!childNode) return vec4(0);
|
|
199
|
+
const frequency = uniforms.frequency.uniform;
|
|
200
|
+
const smoothness = float(.1);
|
|
201
|
+
const aspect = viewportSize.x.div(viewportSize.y);
|
|
202
|
+
const aspectUV = vec2(screenUV.x.mul(aspect), screenUV.y);
|
|
203
|
+
const rotateUV = (uv$1, angleRad) => {
|
|
204
|
+
const c$1 = cos(angleRad);
|
|
205
|
+
const s = sin(angleRad);
|
|
206
|
+
return vec2(dot(uv$1, vec2(c$1, s.negate())), dot(uv$1, vec2(s, c$1)));
|
|
207
|
+
};
|
|
208
|
+
const dotMask = (rotatedUV, intensity) => {
|
|
209
|
+
const dist = length(fract(rotatedUV.mul(frequency)).sub(.5));
|
|
210
|
+
const size = intensity.mul(.75).sub(smoothness);
|
|
211
|
+
return smoothstep(size.sub(smoothness), size.add(smoothness), dist).oneMinus();
|
|
212
|
+
};
|
|
213
|
+
if (uniforms.style.uniform.value === 0) {
|
|
214
|
+
const gridUV = fract(rotateUV(aspectUV, radians(uniforms.angle.uniform)).mul(frequency)).sub(.5);
|
|
215
|
+
const dotSize = dot(childNode.rgb, vec3(.299, .587, .114)).mul(.7).add(.15);
|
|
216
|
+
const dist = length(gridUV);
|
|
217
|
+
const dotPattern = smoothstep(dotSize.sub(smoothness), dotSize.add(smoothness), dist).oneMinus();
|
|
218
|
+
return vec4(childNode.rgb.mul(dotPattern), childNode.a.mul(dotPattern));
|
|
219
|
+
}
|
|
220
|
+
const childTexture = convertToTexture(childNode);
|
|
221
|
+
onCleanup(() => {
|
|
222
|
+
if (childTexture?.renderTarget?.dispose) childTexture.renderTarget.dispose();
|
|
223
|
+
});
|
|
224
|
+
const misprint = uniforms.misprint.uniform;
|
|
225
|
+
const misprintAngleRad = radians(uniforms.misprintAngle.uniform);
|
|
226
|
+
const cAngleRad = radians(uniforms.cyanAngle.uniform);
|
|
227
|
+
const mAngleRad = radians(uniforms.magentaAngle.uniform);
|
|
228
|
+
const yAngleRad = radians(uniforms.yellowAngle.uniform);
|
|
229
|
+
const kAngleRad = radians(uniforms.blackAngle.uniform);
|
|
230
|
+
const plateOffset = (offsetAngleRad) => {
|
|
231
|
+
return vec2(cos(offsetAngleRad).mul(misprint), sin(offsetAngleRad).mul(misprint).div(aspect));
|
|
232
|
+
};
|
|
233
|
+
const cSampleUV = screenUV.add(plateOffset(misprintAngleRad));
|
|
234
|
+
const mSampleUV = screenUV.add(plateOffset(misprintAngleRad.add(radians(float(90)))));
|
|
235
|
+
const ySampleUV = screenUV.add(plateOffset(misprintAngleRad.add(radians(float(180)))));
|
|
236
|
+
const kSampleUV = screenUV.add(plateOffset(misprintAngleRad.add(radians(float(270)))));
|
|
237
|
+
const cSample = unpremultiplyAlpha(childTexture.sample(cSampleUV));
|
|
238
|
+
const mSample = unpremultiplyAlpha(childTexture.sample(mSampleUV));
|
|
239
|
+
const ySample = unpremultiplyAlpha(childTexture.sample(ySampleUV));
|
|
240
|
+
const kSample = unpremultiplyAlpha(childTexture.sample(kSampleUV));
|
|
241
|
+
const centerSample = unpremultiplyAlpha(childTexture.sample(screenUV));
|
|
242
|
+
const channelK = (s) => float(1).sub(max(max(s.r, s.g), s.b));
|
|
243
|
+
const channelC = (s) => {
|
|
244
|
+
const k$1 = channelK(s);
|
|
245
|
+
const invK = float(1).sub(k$1).max(float(1e-4));
|
|
246
|
+
return float(1).sub(s.r).sub(k$1).div(invK);
|
|
247
|
+
};
|
|
248
|
+
const channelM = (s) => {
|
|
249
|
+
const k$1 = channelK(s);
|
|
250
|
+
const invK = float(1).sub(k$1).max(float(1e-4));
|
|
251
|
+
return float(1).sub(s.g).sub(k$1).div(invK);
|
|
252
|
+
};
|
|
253
|
+
const channelY = (s) => {
|
|
254
|
+
const k$1 = channelK(s);
|
|
255
|
+
const invK = float(1).sub(k$1).max(float(1e-4));
|
|
256
|
+
return float(1).sub(s.b).sub(k$1).div(invK);
|
|
257
|
+
};
|
|
258
|
+
const c = channelC(cSample);
|
|
259
|
+
const m = channelM(mSample);
|
|
260
|
+
const y = channelY(ySample);
|
|
261
|
+
const k = channelK(kSample);
|
|
262
|
+
const cUV = rotateUV(aspectUV, cAngleRad);
|
|
263
|
+
const mUV = rotateUV(aspectUV, mAngleRad);
|
|
264
|
+
const yUV = rotateUV(aspectUV, yAngleRad);
|
|
265
|
+
const kUV = rotateUV(aspectUV, kAngleRad);
|
|
266
|
+
const cInk = dotMask(cUV, c);
|
|
267
|
+
const mInk = dotMask(mUV, m);
|
|
268
|
+
const yInk = dotMask(yUV, y);
|
|
269
|
+
const kInk = dotMask(kUV, k);
|
|
270
|
+
const paper = uniforms.paperColor.uniform;
|
|
271
|
+
const cyanCol = uniforms.cyanColor.uniform;
|
|
272
|
+
const magentaCol = uniforms.magentaColor.uniform;
|
|
273
|
+
const yellowCol = uniforms.yellowColor.uniform;
|
|
274
|
+
const blackCol = uniforms.blackColor.uniform;
|
|
275
|
+
const transmission = (inkColor, inkMask) => {
|
|
276
|
+
return mix(vec3(1, 1, 1), inkColor.rgb, inkMask.mul(inkColor.a));
|
|
277
|
+
};
|
|
278
|
+
let printed = paper.rgb;
|
|
279
|
+
printed = printed.mul(transmission(cyanCol, cInk));
|
|
280
|
+
printed = printed.mul(transmission(magentaCol, mInk));
|
|
281
|
+
printed = printed.mul(transmission(yellowCol, yInk));
|
|
282
|
+
printed = printed.mul(transmission(blackCol, kInk));
|
|
283
|
+
return vec4(printed, centerSample.a);
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
var Halftone_default = componentDefinition;
|
|
287
|
+
export { componentDefinition as n, Halftone_default as t };
|
package/dist/core/index.js
CHANGED
|
@@ -52,7 +52,7 @@ import "./Grayscale-lYKBBkGY.js";
|
|
|
52
52
|
import "./Grid-BJ-nxN3i.js";
|
|
53
53
|
import "./GridDistortion-DtaRNrTZ.js";
|
|
54
54
|
import "./Group-DpozigtX.js";
|
|
55
|
-
import "./Halftone-
|
|
55
|
+
import "./Halftone-XFa7by1s.js";
|
|
56
56
|
import "./HexGrid-D-EmQ4kI.js";
|
|
57
57
|
import "./HueShift-D9K0ynaS.js";
|
|
58
58
|
import "./ImageTexture-CArkZMfh.js";
|
|
@@ -110,7 +110,7 @@ import "./WaveDistortion--Y-m667K.js";
|
|
|
110
110
|
import "./Weave-CtyohvHz.js";
|
|
111
111
|
import "./WebcamTexture-XBDo2kgN.js";
|
|
112
112
|
import "./ZoomBlur-BwkhsFRE.js";
|
|
113
|
-
import { t as getAllShaders } from "./shaderRegistry-
|
|
113
|
+
import { t as getAllShaders } from "./shaderRegistry-BWuH2me2.js";
|
|
114
114
|
import { Material, Mesh, MeshBasicNodeMaterial, OrthographicCamera, PlaneGeometry, SRGBColorSpace, Scene, Vector2, WebGPURenderer } from "three/webgpu";
|
|
115
115
|
import { WebGLRenderer } from "three";
|
|
116
116
|
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
|
@@ -52,7 +52,7 @@ import "./Grayscale-lYKBBkGY.js";
|
|
|
52
52
|
import "./Grid-BJ-nxN3i.js";
|
|
53
53
|
import "./GridDistortion-DtaRNrTZ.js";
|
|
54
54
|
import "./Group-DpozigtX.js";
|
|
55
|
-
import "./Halftone-
|
|
55
|
+
import "./Halftone-XFa7by1s.js";
|
|
56
56
|
import "./HexGrid-D-EmQ4kI.js";
|
|
57
57
|
import "./HueShift-D9K0ynaS.js";
|
|
58
58
|
import "./ImageTexture-CArkZMfh.js";
|
|
@@ -110,5 +110,5 @@ import "./WaveDistortion--Y-m667K.js";
|
|
|
110
110
|
import "./Weave-CtyohvHz.js";
|
|
111
111
|
import "./WebcamTexture-XBDo2kgN.js";
|
|
112
112
|
import "./ZoomBlur-BwkhsFRE.js";
|
|
113
|
-
import { a as shaderRegistry, i as getShadersByCategory, n as getShaderByName, r as getShaderCategories, t as getAllShaders } from "./shaderRegistry-
|
|
113
|
+
import { a as shaderRegistry, i as getShadersByCategory, n as getShaderByName, r as getShaderCategories, t as getAllShaders } from "./shaderRegistry-BWuH2me2.js";
|
|
114
114
|
export { getAllShaders, getShaderByName, getShaderCategories, getShadersByCategory, shaderRegistry };
|
|
@@ -45,7 +45,7 @@ import { n as componentDefinition$43 } from "./Grayscale-lYKBBkGY.js";
|
|
|
45
45
|
import { n as componentDefinition$44 } from "./Grid-BJ-nxN3i.js";
|
|
46
46
|
import { n as componentDefinition$45 } from "./GridDistortion-DtaRNrTZ.js";
|
|
47
47
|
import { n as componentDefinition$46 } from "./Group-DpozigtX.js";
|
|
48
|
-
import { n as componentDefinition$47 } from "./Halftone-
|
|
48
|
+
import { n as componentDefinition$47 } from "./Halftone-XFa7by1s.js";
|
|
49
49
|
import { n as componentDefinition$48 } from "./HexGrid-D-EmQ4kI.js";
|
|
50
50
|
import { n as componentDefinition$49 } from "./HueShift-D9K0ynaS.js";
|
|
51
51
|
import { n as componentDefinition$50 } from "./ImageTexture-CArkZMfh.js";
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { ComponentDefinition } from '../../types';
|
|
2
|
-
import { transformAngle } from '../../utilities/transformations';
|
|
2
|
+
import { transformAngle, transformColor } from '../../utilities/transformations';
|
|
3
3
|
|
|
4
4
|
export interface ComponentProps {
|
|
5
|
+
/**
|
|
6
|
+
* Halftone rendering style
|
|
7
|
+
*
|
|
8
|
+
* Accepts one of: `"classic"`, `"cmyk"`.
|
|
9
|
+
* @default "classic"
|
|
10
|
+
*/
|
|
11
|
+
style: string;
|
|
5
12
|
/**
|
|
6
13
|
* Frequency of the halftone dots
|
|
7
14
|
*
|
|
@@ -15,11 +22,76 @@ export interface ComponentProps {
|
|
|
15
22
|
*/
|
|
16
23
|
angle: Parameters<typeof transformAngle>[0];
|
|
17
24
|
/**
|
|
18
|
-
*
|
|
25
|
+
* Screen angle for the cyan plate (in degrees)
|
|
26
|
+
*
|
|
27
|
+
* @default 15
|
|
28
|
+
*/
|
|
29
|
+
cyanAngle: Parameters<typeof transformAngle>[0];
|
|
30
|
+
/**
|
|
31
|
+
* Screen angle for the magenta plate (in degrees)
|
|
32
|
+
*
|
|
33
|
+
* @default 75
|
|
34
|
+
*/
|
|
35
|
+
magentaAngle: Parameters<typeof transformAngle>[0];
|
|
36
|
+
/**
|
|
37
|
+
* Screen angle for the yellow plate (in degrees)
|
|
38
|
+
*
|
|
39
|
+
* @default 0
|
|
40
|
+
*/
|
|
41
|
+
yellowAngle: Parameters<typeof transformAngle>[0];
|
|
42
|
+
/**
|
|
43
|
+
* Screen angle for the black plate (in degrees)
|
|
44
|
+
*
|
|
45
|
+
* @default 45
|
|
46
|
+
*/
|
|
47
|
+
blackAngle: Parameters<typeof transformAngle>[0];
|
|
48
|
+
/**
|
|
49
|
+
* Simulated mis-registration between plates. Plates are offset around the misprint angle, producing colour fringing at the edges of inked regions.
|
|
50
|
+
*
|
|
51
|
+
* @default 0
|
|
52
|
+
*/
|
|
53
|
+
misprint: number;
|
|
54
|
+
/**
|
|
55
|
+
* Direction the plates drift apart. Rotating this rotates the colour-fringing pattern.
|
|
56
|
+
*
|
|
57
|
+
* @default 0
|
|
58
|
+
*/
|
|
59
|
+
misprintAngle: Parameters<typeof transformAngle>[0];
|
|
60
|
+
/**
|
|
61
|
+
* Paper/substrate color shown where no ink lands
|
|
62
|
+
*
|
|
63
|
+
* Accepts hex strings (`#ff0000`), RGB objects (`{ r, g, b }`), or CSS color names (`limegreen`).
|
|
64
|
+
* @default "#ffffff"
|
|
65
|
+
*/
|
|
66
|
+
paperColor: Parameters<typeof transformColor>[0];
|
|
67
|
+
/**
|
|
68
|
+
* Cyan ink color
|
|
69
|
+
*
|
|
70
|
+
* Accepts hex strings (`#ff0000`), RGB objects (`{ r, g, b }`), or CSS color names (`limegreen`).
|
|
71
|
+
* @default "#00ffff"
|
|
72
|
+
*/
|
|
73
|
+
cyanColor: Parameters<typeof transformColor>[0];
|
|
74
|
+
/**
|
|
75
|
+
* Magenta ink color
|
|
76
|
+
*
|
|
77
|
+
* Accepts hex strings (`#ff0000`), RGB objects (`{ r, g, b }`), or CSS color names (`limegreen`).
|
|
78
|
+
* @default "#ff00ff"
|
|
79
|
+
*/
|
|
80
|
+
magentaColor: Parameters<typeof transformColor>[0];
|
|
81
|
+
/**
|
|
82
|
+
* Yellow ink color
|
|
83
|
+
*
|
|
84
|
+
* Accepts hex strings (`#ff0000`), RGB objects (`{ r, g, b }`), or CSS color names (`limegreen`).
|
|
85
|
+
* @default "#ffff00"
|
|
86
|
+
*/
|
|
87
|
+
yellowColor: Parameters<typeof transformColor>[0];
|
|
88
|
+
/**
|
|
89
|
+
* Black (key) ink color
|
|
19
90
|
*
|
|
20
|
-
*
|
|
91
|
+
* Accepts hex strings (`#ff0000`), RGB objects (`{ r, g, b }`), or CSS color names (`limegreen`).
|
|
92
|
+
* @default "#000000"
|
|
21
93
|
*/
|
|
22
|
-
|
|
94
|
+
blackColor: Parameters<typeof transformColor>[0];
|
|
23
95
|
}
|
|
24
96
|
export declare const componentDefinition: ComponentDefinition<ComponentProps>;
|
|
25
97
|
export default componentDefinition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/Halftone/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,iBAAiB,CAAA;AAIvE,OAAO,EAAC,cAAc,EAAC,MAAM,qCAAqC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/Halftone/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,iBAAiB,CAAA;AAIvE,OAAO,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,qCAAqC,CAAA;AAUlF,MAAM,WAAW,cAAc;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3C,SAAS,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAC/C,YAAY,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAClD,WAAW,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IACjD,UAAU,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAChD,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IACnD,UAAU,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAChD,SAAS,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAC/C,YAAY,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAClD,WAAW,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IACjD,UAAU,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;CACnD;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CAyUnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
|
-
import
|
|
2
|
+
import "../../alpha-C4ptedXe.js";
|
|
3
|
+
import { n as componentDefinition, t as Halftone_default } from "../../Halftone-XFa7by1s.js";
|
|
3
4
|
export { componentDefinition, Halftone_default as default };
|
package/dist/js/createShader.js
CHANGED
|
@@ -46,7 +46,7 @@ async function createShader(canvas, preset, options) {
|
|
|
46
46
|
if (isExternalUser()) {
|
|
47
47
|
const checkRendering = () => {
|
|
48
48
|
if (renderer.getPerformanceStats().fps > 0) {
|
|
49
|
-
telemetryCollector = startTelemetry(renderer, "2.5.
|
|
49
|
+
telemetryCollector = startTelemetry(renderer, "2.5.103", options?.disableTelemetry || false, false);
|
|
50
50
|
if (telemetryCollector) telemetryCollector.start();
|
|
51
51
|
telemetryStartTimeout = null;
|
|
52
52
|
} else telemetryStartTimeout = setTimeout(checkRendering, 500);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;
|
|
1
|
+
{"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;AA84CD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,CAoBlG;AAGD,eAAO,MAAM,mBAAmB,UA0G/B,CAAA"}
|
|
@@ -575,9 +575,20 @@ var shaderMetadata = {
|
|
|
575
575
|
"Halftone": {
|
|
576
576
|
"opacity": 1,
|
|
577
577
|
"blendMode": "normal",
|
|
578
|
+
"style": "classic",
|
|
578
579
|
"frequency": 100,
|
|
579
580
|
"angle": 45,
|
|
580
|
-
"
|
|
581
|
+
"cyanAngle": 15,
|
|
582
|
+
"magentaAngle": 75,
|
|
583
|
+
"yellowAngle": 0,
|
|
584
|
+
"blackAngle": 45,
|
|
585
|
+
"misprint": 0,
|
|
586
|
+
"misprintAngle": 0,
|
|
587
|
+
"paperColor": "#ffffff",
|
|
588
|
+
"cyanColor": "#00ffff",
|
|
589
|
+
"magentaColor": "#ff00ff",
|
|
590
|
+
"yellowColor": "#ffff00",
|
|
591
|
+
"blackColor": "#000000"
|
|
581
592
|
},
|
|
582
593
|
"HexGrid": {
|
|
583
594
|
"opacity": 1,
|
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.103", disableTelemetry, isPreview);
|
|
93
93
|
if (telemetryCollectorRef.current) telemetryCollectorRef.current.start();
|
|
94
94
|
telemetryStartTimeoutRef.current = null;
|
|
95
95
|
} else telemetryStartTimeoutRef.current = window.setTimeout(checkRendering, 500);
|
|
@@ -22,10 +22,15 @@ interface BaseShaderProps {
|
|
|
22
22
|
* Component-specific props that merge base props with shader-specific props
|
|
23
23
|
* Note: ComponentProps are made optional since they have defaults from the shader definition
|
|
24
24
|
*/
|
|
25
|
-
type ShaderComponentProps = BaseShaderProps & Partial<Omit<ComponentProps, 'frequency' | 'angle' | '
|
|
25
|
+
type ShaderComponentProps = BaseShaderProps & Partial<Omit<ComponentProps, 'frequency' | 'angle' | 'cyanAngle' | 'magentaAngle' | 'yellowAngle' | 'blackAngle' | 'misprint' | 'misprintAngle'>> & {
|
|
26
26
|
frequency?: ComponentProps['frequency'] | PropDriver;
|
|
27
27
|
angle?: ComponentProps['angle'] | PropDriver;
|
|
28
|
-
|
|
28
|
+
cyanAngle?: ComponentProps['cyanAngle'] | PropDriver;
|
|
29
|
+
magentaAngle?: ComponentProps['magentaAngle'] | PropDriver;
|
|
30
|
+
yellowAngle?: ComponentProps['yellowAngle'] | PropDriver;
|
|
31
|
+
blackAngle?: ComponentProps['blackAngle'] | PropDriver;
|
|
32
|
+
misprint?: ComponentProps['misprint'] | PropDriver;
|
|
33
|
+
misprintAngle?: ComponentProps['misprintAngle'] | PropDriver;
|
|
29
34
|
};
|
|
30
35
|
/**
|
|
31
36
|
* The main React wrapper component for Shader shader nodes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Halftone.d.ts","sourceRoot":"","sources":["../../src/components/Halftone.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAC;AAEvF,OAAO,EAGH,KAAK,SAAS,EAId,KAAK,UAAU,EACf,KAAK,eAAe,EACvB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGjF,YAAY,EAAE,cAAc,EAAE,CAAC;AAY/B;;GAEG;AACH,UAAU,eAAe;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACrC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACxB;AAOD;;;GAGG;AACH,KAAK,oBAAoB,GAAG,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,GAAG,OAAO,GAAG,YAAY,CAAC,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"Halftone.d.ts","sourceRoot":"","sources":["../../src/components/Halftone.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAC;AAEvF,OAAO,EAGH,KAAK,SAAS,EAId,KAAK,UAAU,EACf,KAAK,eAAe,EACvB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGjF,YAAY,EAAE,cAAc,EAAE,CAAC;AAY/B;;GAEG;AACH,UAAU,eAAe;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACrC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACxB;AAOD;;;GAGG;AACH,KAAK,oBAAoB,GAAG,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,GAAG,OAAO,GAAG,WAAW,GAAG,cAAc,GAAG,aAAa,GAAG,YAAY,GAAG,UAAU,GAAG,eAAe,CAAC,CAAC,GAAG;IAChM,SAAS,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG,UAAU,CAAC;IACrD,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC;IAC7C,SAAS,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG,UAAU,CAAC;IACrD,YAAY,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,UAAU,CAAC;IAC3D,WAAW,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,GAAG,UAAU,CAAC;IACzD,UAAU,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;IACvD,QAAQ,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;IACnD,aAAa,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC;CAC9D,CAAC;AAwDF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAmO1D,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;
|
|
1
|
+
{"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;AAi6CD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,CAiFlG;AAGD,eAAO,MAAM,mBAAmB,UA0G/B,CAAA"}
|
|
@@ -587,9 +587,20 @@ var shaderMetadata = {
|
|
|
587
587
|
"Halftone": {
|
|
588
588
|
"opacity": 1,
|
|
589
589
|
"blendMode": "normal",
|
|
590
|
+
"style": "classic",
|
|
590
591
|
"frequency": 100,
|
|
591
592
|
"angle": 45,
|
|
592
|
-
"
|
|
593
|
+
"cyanAngle": 15,
|
|
594
|
+
"magentaAngle": 75,
|
|
595
|
+
"yellowAngle": 0,
|
|
596
|
+
"blackAngle": 45,
|
|
597
|
+
"misprint": 0,
|
|
598
|
+
"misprintAngle": 0,
|
|
599
|
+
"paperColor": "#ffffff",
|
|
600
|
+
"cyanColor": "#00ffff",
|
|
601
|
+
"magentaColor": "#ff00ff",
|
|
602
|
+
"yellowColor": "#ffff00",
|
|
603
|
+
"blackColor": "#000000"
|
|
593
604
|
},
|
|
594
605
|
"HexGrid": {
|
|
595
606
|
"opacity": 1,
|