shadertown 0.1.0 → 0.2.0
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/README.md +20 -0
- package/dist/export.d.ts.map +1 -1
- package/dist/export.js +55 -5
- package/dist/export.js.map +1 -1
- package/dist/generated/sources.d.ts +41 -0
- package/dist/generated/sources.d.ts.map +1 -1
- package/dist/generated/sources.js +41 -0
- package/dist/generated/sources.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +8 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +23 -1
- package/dist/react.js.map +1 -1
- package/dist/registry.d.ts +1050 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +642 -0
- package/dist/registry.js.map +1 -1
- package/dist/renderer.d.ts +15 -1
- package/dist/renderer.d.ts.map +1 -1
- package/dist/renderer.js +127 -0
- package/dist/renderer.js.map +1 -1
- package/dist/source.d.ts +56 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +191 -0
- package/dist/source.js.map +1 -0
- package/dist/stage.d.ts +13 -1
- package/dist/stage.d.ts.map +1 -1
- package/dist/stage.js +5 -1
- package/dist/stage.js.map +1 -1
- package/dist/types.d.ts +21 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/registry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAoC,UAAU,EAAE,MAAM,YAAY,CAAC;AA6F7F,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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I,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAE1E;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,UAAU,CAE/D;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAEvD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAExD;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,CAIxE;AAED,iDAAiD;AACjD,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,UAAU,IAAI,MAAM,cAAc,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;AAEpF,kEAAkE;AAClE,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,UAAU,IAAI,OAAO,CACtD,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,GAAG,QAAQ,GAAG,QAAQ,EAAE,MAAM,CAAC,CAChF,CAAC"}
|
package/dist/registry.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { shaderKinds } from "./generated/sources.js";
|
|
1
2
|
/**
|
|
2
3
|
* Controls that behave identically in every shader. Each entry is spread into
|
|
3
4
|
* a shader's control map and then overridden where that shader wants a
|
|
@@ -59,6 +60,17 @@ const base = {
|
|
|
59
60
|
hint: "Darkening towards the edges of the frame.",
|
|
60
61
|
},
|
|
61
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* The subset of `base` that still means something to a shader with no clock of
|
|
65
|
+
* its own. An image effect has no speed to set and no field to scale, and a
|
|
66
|
+
* slider that does nothing is worse than a missing one.
|
|
67
|
+
*/
|
|
68
|
+
const still = {
|
|
69
|
+
intensity: base.intensity,
|
|
70
|
+
vibrancy: base.vibrancy,
|
|
71
|
+
grain: base.grain,
|
|
72
|
+
vignette: base.vignette,
|
|
73
|
+
};
|
|
62
74
|
const warp = {
|
|
63
75
|
slot: "warp",
|
|
64
76
|
label: "Warp",
|
|
@@ -1056,6 +1068,612 @@ export const shaderRegistry = {
|
|
|
1056
1068
|
colorC: color("Light", "#c9f6ff", "The caustic web itself."),
|
|
1057
1069
|
},
|
|
1058
1070
|
},
|
|
1071
|
+
glass: {
|
|
1072
|
+
name: "Glass",
|
|
1073
|
+
tagline: "A refracting, frosted sheet over the layer behind it",
|
|
1074
|
+
description: "A drifting height field read as a surface: its slope bends the layer underneath, spreads the red and blue ends apart, and catches light along the steep ground. Frost blurs along an axis the height rotates, so the sheet grains up instead of banding. Point it at an image, a video, or another shadertown shader.",
|
|
1075
|
+
family: "optical",
|
|
1076
|
+
tags: ["glass", "refraction", "overlay"],
|
|
1077
|
+
cost: "medium",
|
|
1078
|
+
defaultSource: "neon-grid",
|
|
1079
|
+
controls: {
|
|
1080
|
+
...base,
|
|
1081
|
+
speed: { ...base.speed, default: 0.35, max: 2 },
|
|
1082
|
+
scale: { ...base.scale, default: 1 },
|
|
1083
|
+
intensity: { ...base.intensity, default: 1 },
|
|
1084
|
+
grain: { ...base.grain, default: 0.02 },
|
|
1085
|
+
vignette: { ...base.vignette, default: 0.2 },
|
|
1086
|
+
warp: { ...warp, label: "Refraction", default: 0.8, max: 2.5, hint: "How far the sheet bends what is behind it." },
|
|
1087
|
+
frost: {
|
|
1088
|
+
slot: "a",
|
|
1089
|
+
label: "Frost",
|
|
1090
|
+
min: 0,
|
|
1091
|
+
max: 1,
|
|
1092
|
+
step: 0.01,
|
|
1093
|
+
default: 0.35,
|
|
1094
|
+
hint: "Blur radius. Past about 0.6 the layer below stops being readable.",
|
|
1095
|
+
},
|
|
1096
|
+
dispersion: {
|
|
1097
|
+
slot: "b",
|
|
1098
|
+
label: "Dispersion",
|
|
1099
|
+
min: 0,
|
|
1100
|
+
max: 1,
|
|
1101
|
+
step: 0.01,
|
|
1102
|
+
default: 0.25,
|
|
1103
|
+
hint: "Colour fringing where the sheet is steepest, as in real glass.",
|
|
1104
|
+
},
|
|
1105
|
+
edge: {
|
|
1106
|
+
slot: "c",
|
|
1107
|
+
label: "Edge light",
|
|
1108
|
+
min: 0,
|
|
1109
|
+
max: 2,
|
|
1110
|
+
step: 0.01,
|
|
1111
|
+
default: 0.6,
|
|
1112
|
+
hint: "Highlight along the ridges. This is what makes it read as thick.",
|
|
1113
|
+
},
|
|
1114
|
+
tint: {
|
|
1115
|
+
slot: "d",
|
|
1116
|
+
label: "Tint",
|
|
1117
|
+
min: 0,
|
|
1118
|
+
max: 1,
|
|
1119
|
+
step: 0.01,
|
|
1120
|
+
default: 0.15,
|
|
1121
|
+
hint: "Pulls the whole sheet towards the palette. 0 leaves it colourless.",
|
|
1122
|
+
},
|
|
1123
|
+
},
|
|
1124
|
+
colors: {
|
|
1125
|
+
colorA: color("Shadow", "#0b1220", "The tint in the thick parts."),
|
|
1126
|
+
colorB: color("Body", "#3b82f6", "The main colour of the pane."),
|
|
1127
|
+
colorC: color("Highlight", "#e0f2fe", "Light caught on the ridges."),
|
|
1128
|
+
},
|
|
1129
|
+
},
|
|
1130
|
+
lens: {
|
|
1131
|
+
name: "Lens",
|
|
1132
|
+
tagline: "Barrel distortion, colour fringing and soft corners",
|
|
1133
|
+
description: "A camera lens rather than a filter: one radial distortion constant per colour channel, so straight lines bow outwards, the fringing is invisible in the middle and worst in the corners, and the corners lose both light and sharpness. Set distortion below zero for the pincushion a long lens gives you instead.",
|
|
1134
|
+
family: "optical",
|
|
1135
|
+
tags: ["camera", "distortion", "retro"],
|
|
1136
|
+
cost: "medium",
|
|
1137
|
+
defaultSource: "neon-grid",
|
|
1138
|
+
controls: {
|
|
1139
|
+
...still,
|
|
1140
|
+
vignette: { ...still.vignette, default: 0.15 },
|
|
1141
|
+
warp: {
|
|
1142
|
+
...warp,
|
|
1143
|
+
label: "Distortion",
|
|
1144
|
+
min: -1,
|
|
1145
|
+
max: 2,
|
|
1146
|
+
default: 0.5,
|
|
1147
|
+
hint: "Above zero bows outwards (barrel), below zero pulls inwards (pincushion).",
|
|
1148
|
+
},
|
|
1149
|
+
softness: {
|
|
1150
|
+
slot: "a",
|
|
1151
|
+
label: "Corner softness",
|
|
1152
|
+
min: 0,
|
|
1153
|
+
max: 1,
|
|
1154
|
+
step: 0.01,
|
|
1155
|
+
default: 0.35,
|
|
1156
|
+
hint: "How far off the focal plane the corners sit.",
|
|
1157
|
+
},
|
|
1158
|
+
fringing: {
|
|
1159
|
+
slot: "b",
|
|
1160
|
+
label: "Fringing",
|
|
1161
|
+
min: 0,
|
|
1162
|
+
max: 1,
|
|
1163
|
+
step: 0.01,
|
|
1164
|
+
default: 0.4,
|
|
1165
|
+
hint: "How far apart the red and blue ends are bent.",
|
|
1166
|
+
},
|
|
1167
|
+
zoom: {
|
|
1168
|
+
slot: "c",
|
|
1169
|
+
label: "Zoom",
|
|
1170
|
+
min: 0.5,
|
|
1171
|
+
max: 1.5,
|
|
1172
|
+
step: 0.01,
|
|
1173
|
+
default: 1,
|
|
1174
|
+
hint: "Below 1 pulls back and shows the black outside the frame.",
|
|
1175
|
+
},
|
|
1176
|
+
falloff: {
|
|
1177
|
+
slot: "d",
|
|
1178
|
+
label: "Corner falloff",
|
|
1179
|
+
min: 0,
|
|
1180
|
+
max: 1,
|
|
1181
|
+
step: 0.01,
|
|
1182
|
+
default: 0.4,
|
|
1183
|
+
hint: "Light lost towards the corners, as distortion spreads it thinner.",
|
|
1184
|
+
},
|
|
1185
|
+
},
|
|
1186
|
+
colors: {
|
|
1187
|
+
colorA: color("Shadow", "#05060a", "Unused by the optics; feeds grain and post."),
|
|
1188
|
+
colorB: color("Mid", "#334155", "Unused by the optics; feeds grain and post."),
|
|
1189
|
+
colorC: color("Light", "#e2e8f0", "Unused by the optics; feeds grain and post."),
|
|
1190
|
+
},
|
|
1191
|
+
},
|
|
1192
|
+
bloom: {
|
|
1193
|
+
name: "Bloom",
|
|
1194
|
+
tagline: "Light bleeding out of the bright parts of the layer below",
|
|
1195
|
+
description: "A threshold picks out what is already bright, and a wide spiral spreads it. Each tap is thresholded on its own rather than blurring first, so a dark neighbour never dims a highlight. Streak stretches the spiral sideways into the flare an anamorphic lens puts on every point of light.",
|
|
1196
|
+
family: "optical",
|
|
1197
|
+
tags: ["glow", "light", "hero"],
|
|
1198
|
+
cost: "heavy",
|
|
1199
|
+
defaultSource: "starfield",
|
|
1200
|
+
controls: {
|
|
1201
|
+
...still,
|
|
1202
|
+
vignette: { ...still.vignette, default: 0.1 },
|
|
1203
|
+
warp: {
|
|
1204
|
+
...warp,
|
|
1205
|
+
label: "Streak",
|
|
1206
|
+
min: 0,
|
|
1207
|
+
max: 1,
|
|
1208
|
+
default: 0.15,
|
|
1209
|
+
hint: "Stretches the halo sideways. Small values read as a lens, large as a smear.",
|
|
1210
|
+
},
|
|
1211
|
+
threshold: {
|
|
1212
|
+
slot: "a",
|
|
1213
|
+
label: "Threshold",
|
|
1214
|
+
min: 0,
|
|
1215
|
+
max: 1,
|
|
1216
|
+
step: 0.01,
|
|
1217
|
+
default: 0.55,
|
|
1218
|
+
hint: "How bright a pixel has to be before it blooms at all.",
|
|
1219
|
+
},
|
|
1220
|
+
radius: {
|
|
1221
|
+
slot: "b",
|
|
1222
|
+
label: "Radius",
|
|
1223
|
+
min: 0,
|
|
1224
|
+
max: 1,
|
|
1225
|
+
step: 0.01,
|
|
1226
|
+
default: 0.5,
|
|
1227
|
+
hint: "How far the light carries. Wide radii need bright, sparse sources.",
|
|
1228
|
+
},
|
|
1229
|
+
amount: {
|
|
1230
|
+
slot: "c",
|
|
1231
|
+
label: "Amount",
|
|
1232
|
+
min: 0,
|
|
1233
|
+
max: 3,
|
|
1234
|
+
step: 0.01,
|
|
1235
|
+
default: 1.2,
|
|
1236
|
+
hint: "How much of the halo is added back on top.",
|
|
1237
|
+
},
|
|
1238
|
+
tint: {
|
|
1239
|
+
slot: "d",
|
|
1240
|
+
label: "Tint",
|
|
1241
|
+
min: 0,
|
|
1242
|
+
max: 1,
|
|
1243
|
+
step: 0.01,
|
|
1244
|
+
default: 0.3,
|
|
1245
|
+
hint: "Colours the halo from the palette. Real coatings are rarely neutral.",
|
|
1246
|
+
},
|
|
1247
|
+
},
|
|
1248
|
+
colors: {
|
|
1249
|
+
colorA: color("Cool", "#1e3a8a", "The halo around dimmer light."),
|
|
1250
|
+
colorB: color("Warm", "#f59e0b", "The halo at mid brightness."),
|
|
1251
|
+
colorC: color("Core", "#fff7ed", "The halo around the brightest points."),
|
|
1252
|
+
},
|
|
1253
|
+
},
|
|
1254
|
+
shockwave: {
|
|
1255
|
+
name: "Shockwave",
|
|
1256
|
+
tagline: "Expanding rings that shove the layer aside as they pass",
|
|
1257
|
+
description: "Three gaussian bands, staggered in phase and spending their force as they grow. The displacement is signed by which side of the crest a pixel is on, so the front compresses ahead of itself and rarefies behind — which is what makes it read as a wave rather than a glowing ring. Turn pointer tracking on and it starts wherever the cursor is.",
|
|
1258
|
+
family: "distortion",
|
|
1259
|
+
tags: ["impact", "pulse", "interactive"],
|
|
1260
|
+
cost: "medium",
|
|
1261
|
+
defaultSource: "truchet",
|
|
1262
|
+
controls: {
|
|
1263
|
+
...base,
|
|
1264
|
+
speed: { ...base.speed, default: 0.8 },
|
|
1265
|
+
grain: { ...base.grain, default: 0.02 },
|
|
1266
|
+
vignette: { ...base.vignette, default: 0.15 },
|
|
1267
|
+
warp: {
|
|
1268
|
+
...warp,
|
|
1269
|
+
label: "Force",
|
|
1270
|
+
min: 0,
|
|
1271
|
+
max: 2,
|
|
1272
|
+
default: 0.9,
|
|
1273
|
+
hint: "How far the front shoves what it passes over.",
|
|
1274
|
+
},
|
|
1275
|
+
reach: {
|
|
1276
|
+
slot: "a",
|
|
1277
|
+
label: "Reach",
|
|
1278
|
+
min: 0.1,
|
|
1279
|
+
max: 2,
|
|
1280
|
+
step: 0.01,
|
|
1281
|
+
default: 1,
|
|
1282
|
+
hint: "How far a ring travels before it is spent.",
|
|
1283
|
+
},
|
|
1284
|
+
width: {
|
|
1285
|
+
slot: "b",
|
|
1286
|
+
label: "Width",
|
|
1287
|
+
min: 0,
|
|
1288
|
+
max: 1,
|
|
1289
|
+
step: 0.01,
|
|
1290
|
+
default: 0.35,
|
|
1291
|
+
hint: "Thickness of the front. Thin is a crack, thick is a swell.",
|
|
1292
|
+
},
|
|
1293
|
+
decay: {
|
|
1294
|
+
slot: "c",
|
|
1295
|
+
label: "Decay",
|
|
1296
|
+
min: 0.1,
|
|
1297
|
+
max: 4,
|
|
1298
|
+
step: 0.01,
|
|
1299
|
+
default: 1.5,
|
|
1300
|
+
hint: "How quickly a ring loses force. High values die close to the centre.",
|
|
1301
|
+
},
|
|
1302
|
+
fringing: {
|
|
1303
|
+
slot: "d",
|
|
1304
|
+
label: "Fringing",
|
|
1305
|
+
min: 0,
|
|
1306
|
+
max: 1,
|
|
1307
|
+
step: 0.01,
|
|
1308
|
+
default: 0.4,
|
|
1309
|
+
hint: "Colour separation across the crest.",
|
|
1310
|
+
},
|
|
1311
|
+
},
|
|
1312
|
+
colors: {
|
|
1313
|
+
colorA: color("Trough", "#0f172a", "Unused by the wave; feeds the crest ramp."),
|
|
1314
|
+
colorB: color("Body", "#0ea5e9", "Unused by the wave; feeds the crest ramp."),
|
|
1315
|
+
colorC: color("Crest", "#f0f9ff", "The light on the front itself."),
|
|
1316
|
+
},
|
|
1317
|
+
},
|
|
1318
|
+
swirl: {
|
|
1319
|
+
name: "Swirl",
|
|
1320
|
+
tagline: "A vortex that winds the layer around a point",
|
|
1321
|
+
description: "Rotation that falls off with distance, so the middle turns and the edges stay put. Falloff decides the whole character: near 1 it is a gentle whirlpool, near 4 a tight knot in still water. The colour channels wind by slightly different angles, which smears them along the direction of travel and sells the spin.",
|
|
1322
|
+
family: "distortion",
|
|
1323
|
+
tags: ["vortex", "twist", "interactive"],
|
|
1324
|
+
cost: "light",
|
|
1325
|
+
defaultSource: "voronoi",
|
|
1326
|
+
controls: {
|
|
1327
|
+
...base,
|
|
1328
|
+
speed: { ...base.speed, default: 1 },
|
|
1329
|
+
grain: { ...base.grain, default: 0.02 },
|
|
1330
|
+
vignette: { ...base.vignette, default: 0.15 },
|
|
1331
|
+
warp: {
|
|
1332
|
+
...warp,
|
|
1333
|
+
label: "Twist",
|
|
1334
|
+
min: 0,
|
|
1335
|
+
max: 3,
|
|
1336
|
+
default: 1.2,
|
|
1337
|
+
hint: "Turns at the centre. Past about 2 the middle stops being readable.",
|
|
1338
|
+
},
|
|
1339
|
+
radius: {
|
|
1340
|
+
slot: "a",
|
|
1341
|
+
label: "Radius",
|
|
1342
|
+
min: 0.02,
|
|
1343
|
+
max: 1.2,
|
|
1344
|
+
step: 0.01,
|
|
1345
|
+
default: 0.55,
|
|
1346
|
+
hint: "How far the vortex reaches before the layer is untouched.",
|
|
1347
|
+
},
|
|
1348
|
+
falloff: {
|
|
1349
|
+
slot: "b",
|
|
1350
|
+
label: "Falloff",
|
|
1351
|
+
min: 0.1,
|
|
1352
|
+
max: 5,
|
|
1353
|
+
step: 0.01,
|
|
1354
|
+
default: 1.6,
|
|
1355
|
+
hint: "Shape of the edge. Low is a wide whirlpool, high is a tight knot.",
|
|
1356
|
+
},
|
|
1357
|
+
spin: {
|
|
1358
|
+
slot: "c",
|
|
1359
|
+
label: "Spin",
|
|
1360
|
+
min: -1,
|
|
1361
|
+
max: 1,
|
|
1362
|
+
step: 0.01,
|
|
1363
|
+
default: 0.15,
|
|
1364
|
+
hint: "Steady rotation over time. Negative winds the other way.",
|
|
1365
|
+
},
|
|
1366
|
+
smear: {
|
|
1367
|
+
slot: "d",
|
|
1368
|
+
label: "Smear",
|
|
1369
|
+
min: 0,
|
|
1370
|
+
max: 1,
|
|
1371
|
+
step: 0.01,
|
|
1372
|
+
default: 0.3,
|
|
1373
|
+
hint: "Colour trailing along the direction of travel.",
|
|
1374
|
+
},
|
|
1375
|
+
},
|
|
1376
|
+
colors: {
|
|
1377
|
+
colorA: color("Shadow", "#0b1120", "Unused by the vortex; feeds post."),
|
|
1378
|
+
colorB: color("Mid", "#6d28d9", "Unused by the vortex; feeds post."),
|
|
1379
|
+
colorC: color("Light", "#f5d0fe", "Unused by the vortex; feeds post."),
|
|
1380
|
+
},
|
|
1381
|
+
},
|
|
1382
|
+
flow: {
|
|
1383
|
+
name: "Flow",
|
|
1384
|
+
tagline: "The layer pushed around by a slow, turbulent field",
|
|
1385
|
+
description: "Two noise fields drive a displacement, then curl turns it from a drift into a circulation. Smearing runs along the flow rather than in a circle, so the result looks stirred instead of merely blurred. Turbulence trades broad lazy currents for stringy filaments.",
|
|
1386
|
+
family: "distortion",
|
|
1387
|
+
tags: ["liquid", "organic", "ambient"],
|
|
1388
|
+
cost: "heavy",
|
|
1389
|
+
defaultSource: "halftone",
|
|
1390
|
+
controls: {
|
|
1391
|
+
...base,
|
|
1392
|
+
speed: { ...base.speed, default: 0.5, max: 2 },
|
|
1393
|
+
scale: { ...base.scale, default: 1 },
|
|
1394
|
+
grain: { ...base.grain, default: 0.02 },
|
|
1395
|
+
vignette: { ...base.vignette, default: 0.2 },
|
|
1396
|
+
warp: {
|
|
1397
|
+
...warp,
|
|
1398
|
+
label: "Strength",
|
|
1399
|
+
min: 0,
|
|
1400
|
+
max: 2,
|
|
1401
|
+
default: 0.7,
|
|
1402
|
+
hint: "How far the field pushes the layer.",
|
|
1403
|
+
},
|
|
1404
|
+
turbulence: {
|
|
1405
|
+
slot: "a",
|
|
1406
|
+
label: "Turbulence",
|
|
1407
|
+
min: 0,
|
|
1408
|
+
max: 1,
|
|
1409
|
+
step: 0.01,
|
|
1410
|
+
default: 0.4,
|
|
1411
|
+
hint: "0 is broad lazy currents, 1 is sharp filaments.",
|
|
1412
|
+
},
|
|
1413
|
+
curl: {
|
|
1414
|
+
slot: "b",
|
|
1415
|
+
label: "Curl",
|
|
1416
|
+
min: 0,
|
|
1417
|
+
max: 1,
|
|
1418
|
+
step: 0.01,
|
|
1419
|
+
default: 0.75,
|
|
1420
|
+
hint: "Turns the drift into circulation. 0 pulls everything one way.",
|
|
1421
|
+
},
|
|
1422
|
+
smear: {
|
|
1423
|
+
slot: "c",
|
|
1424
|
+
label: "Smear",
|
|
1425
|
+
min: 0,
|
|
1426
|
+
max: 1,
|
|
1427
|
+
step: 0.01,
|
|
1428
|
+
default: 0.35,
|
|
1429
|
+
hint: "Blur along the flow, which is what reads as motion.",
|
|
1430
|
+
},
|
|
1431
|
+
tint: {
|
|
1432
|
+
slot: "d",
|
|
1433
|
+
label: "Tint",
|
|
1434
|
+
min: 0,
|
|
1435
|
+
max: 1,
|
|
1436
|
+
step: 0.01,
|
|
1437
|
+
default: 0.2,
|
|
1438
|
+
hint: "Colours the fast water from the palette.",
|
|
1439
|
+
},
|
|
1440
|
+
},
|
|
1441
|
+
colors: {
|
|
1442
|
+
colorA: color("Still", "#082f49", "Where the field is barely moving."),
|
|
1443
|
+
colorB: color("Current", "#0891b2", "Mid-speed water."),
|
|
1444
|
+
colorC: color("Race", "#a5f3fc", "The fastest part of the flow."),
|
|
1445
|
+
},
|
|
1446
|
+
},
|
|
1447
|
+
duotone: {
|
|
1448
|
+
name: "Duotone",
|
|
1449
|
+
tagline: "The layer's brightness read through your palette",
|
|
1450
|
+
description: "Luminance is set between a black and a white point, then contrasted about the midpoint, then used to walk the three-stop palette. In that order: a hard contrast applied first would clip before the range is set. Keep colour mixes the original chroma back, for when a busy photograph should not become a flat poster.",
|
|
1451
|
+
family: "image",
|
|
1452
|
+
tags: ["colour", "poster", "brand"],
|
|
1453
|
+
cost: "light",
|
|
1454
|
+
defaultSource: "julia",
|
|
1455
|
+
controls: {
|
|
1456
|
+
...still,
|
|
1457
|
+
grain: { ...still.grain, default: 0.02 },
|
|
1458
|
+
vignette: { ...still.vignette, default: 0.2 },
|
|
1459
|
+
black: {
|
|
1460
|
+
slot: "a",
|
|
1461
|
+
label: "Black point",
|
|
1462
|
+
min: 0,
|
|
1463
|
+
max: 0.6,
|
|
1464
|
+
step: 0.01,
|
|
1465
|
+
default: 0.05,
|
|
1466
|
+
hint: "Brightness that maps to the first colour. Raise it to crush shadows.",
|
|
1467
|
+
},
|
|
1468
|
+
white: {
|
|
1469
|
+
slot: "b",
|
|
1470
|
+
label: "White point",
|
|
1471
|
+
min: 0.4,
|
|
1472
|
+
max: 1,
|
|
1473
|
+
step: 0.01,
|
|
1474
|
+
default: 0.9,
|
|
1475
|
+
hint: "Brightness that maps to the last colour. Lower it to blow highlights.",
|
|
1476
|
+
},
|
|
1477
|
+
contrast: {
|
|
1478
|
+
slot: "c",
|
|
1479
|
+
label: "Contrast",
|
|
1480
|
+
min: 0.2,
|
|
1481
|
+
max: 3,
|
|
1482
|
+
step: 0.01,
|
|
1483
|
+
default: 1.2,
|
|
1484
|
+
hint: "Steepness of the ramp between the two points.",
|
|
1485
|
+
},
|
|
1486
|
+
keep: {
|
|
1487
|
+
slot: "d",
|
|
1488
|
+
label: "Keep colour",
|
|
1489
|
+
min: 0,
|
|
1490
|
+
max: 1,
|
|
1491
|
+
step: 0.01,
|
|
1492
|
+
default: 0,
|
|
1493
|
+
hint: "Mixes the original chroma back over the mapped tone.",
|
|
1494
|
+
},
|
|
1495
|
+
},
|
|
1496
|
+
colors: {
|
|
1497
|
+
colorA: color("Shadow", "#170b3b", "The darkest tone in the layer."),
|
|
1498
|
+
colorB: color("Mid", "#c2255c", "Everything in the middle."),
|
|
1499
|
+
colorC: color("Light", "#ffd166", "The brightest tone in the layer."),
|
|
1500
|
+
},
|
|
1501
|
+
},
|
|
1502
|
+
edges: {
|
|
1503
|
+
name: "Edges",
|
|
1504
|
+
tagline: "The layer reduced to its outlines",
|
|
1505
|
+
description: "A Sobel kernel over luminance, with the step widened past a single texel — a sub-texel step would just sample the same texel three times, and widening it is what turns a hairline into a drawn line. Fill decides how much of the original shows under the ink, from a clean line drawing to a traced photograph.",
|
|
1506
|
+
family: "image",
|
|
1507
|
+
tags: ["outline", "line art", "technical"],
|
|
1508
|
+
cost: "medium",
|
|
1509
|
+
defaultSource: "truchet",
|
|
1510
|
+
controls: {
|
|
1511
|
+
...still,
|
|
1512
|
+
grain: { ...still.grain, default: 0.01 },
|
|
1513
|
+
vignette: { ...still.vignette, default: 0.2 },
|
|
1514
|
+
thickness: {
|
|
1515
|
+
slot: "a",
|
|
1516
|
+
label: "Thickness",
|
|
1517
|
+
min: 0.5,
|
|
1518
|
+
max: 6,
|
|
1519
|
+
step: 0.1,
|
|
1520
|
+
default: 1.5,
|
|
1521
|
+
hint: "How far apart the kernel taps sit, in source texels.",
|
|
1522
|
+
},
|
|
1523
|
+
threshold: {
|
|
1524
|
+
slot: "b",
|
|
1525
|
+
label: "Threshold",
|
|
1526
|
+
min: 0,
|
|
1527
|
+
max: 1,
|
|
1528
|
+
step: 0.01,
|
|
1529
|
+
default: 0.15,
|
|
1530
|
+
hint: "How steep a gradient has to be to count as an edge.",
|
|
1531
|
+
},
|
|
1532
|
+
fill: {
|
|
1533
|
+
slot: "c",
|
|
1534
|
+
label: "Fill",
|
|
1535
|
+
min: 0,
|
|
1536
|
+
max: 1,
|
|
1537
|
+
step: 0.01,
|
|
1538
|
+
default: 0,
|
|
1539
|
+
hint: "How much of the original shows under the lines.",
|
|
1540
|
+
},
|
|
1541
|
+
glow: {
|
|
1542
|
+
slot: "d",
|
|
1543
|
+
label: "Glow",
|
|
1544
|
+
min: 0,
|
|
1545
|
+
max: 2,
|
|
1546
|
+
step: 0.01,
|
|
1547
|
+
default: 0.4,
|
|
1548
|
+
hint: "Bleed off the line, which reads as ink rather than aliasing.",
|
|
1549
|
+
},
|
|
1550
|
+
},
|
|
1551
|
+
colors: {
|
|
1552
|
+
colorA: color("Paper", "#0a0a0f", "The ground the lines are drawn on."),
|
|
1553
|
+
colorB: color("Mid", "#334155", "Unused by the trace; feeds the ramp."),
|
|
1554
|
+
colorC: color("Ink", "#67e8f9", "The lines themselves."),
|
|
1555
|
+
},
|
|
1556
|
+
},
|
|
1557
|
+
mosaic: {
|
|
1558
|
+
name: "Mosaic",
|
|
1559
|
+
tagline: "The layer rebuilt out of tiles",
|
|
1560
|
+
description: "One tap at each tile's centre, not an average of it — the hard colour is the point, and averaging would only reinvent a blur. Posterising after sampling is what makes it look assembled from a limited set rather than merely coarse. Roundness grows a dot whose size follows the tile's brightness, the way a printed screen does.",
|
|
1561
|
+
family: "image",
|
|
1562
|
+
tags: ["pixelate", "print", "retro"],
|
|
1563
|
+
cost: "light",
|
|
1564
|
+
defaultSource: "aurora",
|
|
1565
|
+
controls: {
|
|
1566
|
+
...still,
|
|
1567
|
+
grain: { ...still.grain, default: 0 },
|
|
1568
|
+
vignette: { ...still.vignette, default: 0.2 },
|
|
1569
|
+
tiles: {
|
|
1570
|
+
slot: "a",
|
|
1571
|
+
label: "Tiles",
|
|
1572
|
+
min: 4,
|
|
1573
|
+
max: 160,
|
|
1574
|
+
step: 1,
|
|
1575
|
+
default: 42,
|
|
1576
|
+
hint: "Tiles across the short axis. They stay square on any canvas.",
|
|
1577
|
+
},
|
|
1578
|
+
roundness: {
|
|
1579
|
+
slot: "b",
|
|
1580
|
+
label: "Roundness",
|
|
1581
|
+
min: 0,
|
|
1582
|
+
max: 1,
|
|
1583
|
+
step: 0.01,
|
|
1584
|
+
default: 0,
|
|
1585
|
+
hint: "0 is a solid tile, 1 is a dot that shrinks as the tile darkens.",
|
|
1586
|
+
},
|
|
1587
|
+
gap: {
|
|
1588
|
+
slot: "c",
|
|
1589
|
+
label: "Gap",
|
|
1590
|
+
min: 0,
|
|
1591
|
+
max: 0.45,
|
|
1592
|
+
step: 0.01,
|
|
1593
|
+
default: 0.02,
|
|
1594
|
+
hint: "Ground left showing between tiles.",
|
|
1595
|
+
},
|
|
1596
|
+
steps: {
|
|
1597
|
+
slot: "d",
|
|
1598
|
+
label: "Colour steps",
|
|
1599
|
+
min: 2,
|
|
1600
|
+
max: 32,
|
|
1601
|
+
step: 1,
|
|
1602
|
+
default: 12,
|
|
1603
|
+
hint: "Levels each channel is quantised to. Low values band on purpose.",
|
|
1604
|
+
},
|
|
1605
|
+
},
|
|
1606
|
+
colors: {
|
|
1607
|
+
colorA: color("Grout", "#08080c", "What shows in the gaps between tiles."),
|
|
1608
|
+
colorB: color("Mid", "#475569", "Unused by the tiling; feeds post."),
|
|
1609
|
+
colorC: color("Light", "#e2e8f0", "Unused by the tiling; feeds post."),
|
|
1610
|
+
},
|
|
1611
|
+
},
|
|
1612
|
+
reveal: {
|
|
1613
|
+
name: "Reveal",
|
|
1614
|
+
tagline: "The layer wiped in over a colour ground",
|
|
1615
|
+
description: "A threshold cutting through a field: noise dissolves, a rotated ramp wipes, and shape slides between the two. At speed 0 the progress control is a scrubber you can drive from your own code — bind it to a scroll position or a load event. Above 0 it loops on its own, which is what makes it worth looking at on a card.",
|
|
1616
|
+
family: "transition",
|
|
1617
|
+
tags: ["wipe", "dissolve", "entrance"],
|
|
1618
|
+
cost: "light",
|
|
1619
|
+
defaultSource: "mesh-gradient",
|
|
1620
|
+
controls: {
|
|
1621
|
+
...base,
|
|
1622
|
+
speed: { ...base.speed, default: 0.6, max: 2 },
|
|
1623
|
+
scale: { ...base.scale, default: 1 },
|
|
1624
|
+
grain: { ...base.grain, default: 0.02 },
|
|
1625
|
+
vignette: { ...base.vignette, default: 0.2 },
|
|
1626
|
+
warp: {
|
|
1627
|
+
...warp,
|
|
1628
|
+
label: "Edge glow",
|
|
1629
|
+
min: 0,
|
|
1630
|
+
max: 2,
|
|
1631
|
+
default: 0.6,
|
|
1632
|
+
hint: "Light riding the boundary, the way a burn does.",
|
|
1633
|
+
},
|
|
1634
|
+
progress: {
|
|
1635
|
+
slot: "a",
|
|
1636
|
+
label: "Progress",
|
|
1637
|
+
min: 0,
|
|
1638
|
+
max: 1,
|
|
1639
|
+
step: 0.01,
|
|
1640
|
+
default: 0,
|
|
1641
|
+
hint: "Position of the wipe. Set speed to 0 and drive this yourself.",
|
|
1642
|
+
},
|
|
1643
|
+
shape: {
|
|
1644
|
+
slot: "b",
|
|
1645
|
+
label: "Shape",
|
|
1646
|
+
min: 0,
|
|
1647
|
+
max: 1,
|
|
1648
|
+
step: 0.01,
|
|
1649
|
+
default: 0.35,
|
|
1650
|
+
hint: "0 dissolves through noise, 1 wipes along a straight edge.",
|
|
1651
|
+
},
|
|
1652
|
+
angle: {
|
|
1653
|
+
slot: "c",
|
|
1654
|
+
label: "Angle",
|
|
1655
|
+
min: 0,
|
|
1656
|
+
max: 1,
|
|
1657
|
+
step: 0.01,
|
|
1658
|
+
default: 0,
|
|
1659
|
+
hint: "Direction of the wipe, as a full turn from 0 to 1.",
|
|
1660
|
+
},
|
|
1661
|
+
softness: {
|
|
1662
|
+
slot: "d",
|
|
1663
|
+
label: "Softness",
|
|
1664
|
+
min: 0.001,
|
|
1665
|
+
max: 0.4,
|
|
1666
|
+
step: 0.001,
|
|
1667
|
+
default: 0.08,
|
|
1668
|
+
hint: "Width of the boundary band. Small is a hard cut.",
|
|
1669
|
+
},
|
|
1670
|
+
},
|
|
1671
|
+
colors: {
|
|
1672
|
+
colorA: color("Ground", "#0a0a12", "The colour the layer wipes in over."),
|
|
1673
|
+
colorB: color("Mid", "#4c1d95", "The middle of the ground ramp."),
|
|
1674
|
+
colorC: color("Edge", "#fbcfe8", "The light on the boundary itself."),
|
|
1675
|
+
},
|
|
1676
|
+
},
|
|
1059
1677
|
};
|
|
1060
1678
|
export const shaderNames = Object.keys(shaderRegistry);
|
|
1061
1679
|
export function getShader(name) {
|
|
@@ -1064,4 +1682,28 @@ export function getShader(name) {
|
|
|
1064
1682
|
export function isShaderName(value) {
|
|
1065
1683
|
return Object.hasOwn(shaderRegistry, value);
|
|
1066
1684
|
}
|
|
1685
|
+
/**
|
|
1686
|
+
* Whether a shader invents its picture or reads one.
|
|
1687
|
+
*
|
|
1688
|
+
* Comes from the build, which reads it off the folder the WGSL lives in, so it
|
|
1689
|
+
* cannot disagree with the bindings the shader actually declares.
|
|
1690
|
+
*/
|
|
1691
|
+
export function shaderKind(name) {
|
|
1692
|
+
return shaderKinds[name];
|
|
1693
|
+
}
|
|
1694
|
+
export function isSourceShader(name) {
|
|
1695
|
+
return shaderKinds[name] === "source";
|
|
1696
|
+
}
|
|
1697
|
+
/**
|
|
1698
|
+
* The shader a source shader reads when the caller supplies nothing.
|
|
1699
|
+
*
|
|
1700
|
+
* Read through the wide `ShaderDefinition` type on purpose: only source shaders
|
|
1701
|
+
* carry `defaultSource`, so the narrowed literal union does not have the
|
|
1702
|
+
* property and every call site would otherwise need its own cast.
|
|
1703
|
+
*/
|
|
1704
|
+
export function defaultSourceOf(name) {
|
|
1705
|
+
const definition = shaderRegistry[name];
|
|
1706
|
+
const fallback = definition.defaultSource;
|
|
1707
|
+
return fallback && isShaderName(fallback) ? fallback : undefined;
|
|
1708
|
+
}
|
|
1067
1709
|
//# sourceMappingURL=registry.js.map
|