shaders 2.3.49 → 2.3.51
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/ConcentricSpin-CLTGx_sN.js +173 -0
- package/dist/core/StudioBackground-CFjfBnWp.js +337 -0
- package/dist/core/registry.js +120 -116
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/CRTScreen/index.js +1 -1
- package/dist/core/shaders/ConcentricSpin/index.d.ts +64 -0
- package/dist/core/shaders/ConcentricSpin/index.d.ts.map +1 -0
- package/dist/core/shaders/ConcentricSpin/index.js +5 -0
- package/dist/core/shaders/ContourLines/index.js +1 -1
- package/dist/core/shaders/CursorTrail/index.js +1 -1
- package/dist/core/shaders/DiffuseBlur/index.js +1 -1
- package/dist/core/shaders/Dither/index.js +1 -1
- package/dist/core/shaders/DotGrid/index.js +1 -1
- package/dist/core/shaders/Duotone/index.js +1 -1
- package/dist/core/shaders/FilmGrain/index.js +1 -1
- package/dist/core/shaders/FloatingParticles/index.js +1 -1
- package/dist/core/shaders/FlowField/index.js +1 -1
- package/dist/core/shaders/GlassTiles/index.js +1 -1
- package/dist/core/shaders/Glitch/index.js +1 -1
- package/dist/core/shaders/Glow/index.js +1 -1
- package/dist/core/shaders/Godrays/index.js +1 -1
- package/dist/core/shaders/Grayscale/index.js +1 -1
- package/dist/core/shaders/Grid/index.js +1 -1
- package/dist/core/shaders/GridDistortion/index.js +1 -1
- package/dist/core/shaders/Group/index.js +1 -1
- package/dist/core/shaders/Halftone/index.js +1 -1
- package/dist/core/shaders/HueShift/index.js +1 -1
- package/dist/core/shaders/ImageTexture/index.js +1 -1
- package/dist/core/shaders/Invert/index.js +1 -1
- package/dist/core/shaders/Kaleidoscope/index.js +1 -1
- package/dist/core/shaders/LensFlare/index.js +1 -1
- package/dist/core/shaders/LinearBlur/index.js +1 -1
- package/dist/core/shaders/LinearGradient/index.js +1 -1
- package/dist/core/shaders/Liquify/index.js +1 -1
- package/dist/core/shaders/Mirror/index.js +1 -1
- package/dist/core/shaders/Perspective/index.js +1 -1
- package/dist/core/shaders/Pixelate/index.js +1 -1
- package/dist/core/shaders/Plasma/index.js +1 -1
- package/dist/core/shaders/PolarCoordinates/index.js +1 -1
- package/dist/core/shaders/Posterize/index.js +1 -1
- package/dist/core/shaders/ProgressiveBlur/index.js +1 -1
- package/dist/core/shaders/RadialGradient/index.js +1 -1
- package/dist/core/shaders/RectangularCoordinates/index.js +1 -1
- package/dist/core/shaders/Ripples/index.js +1 -1
- package/dist/core/shaders/Saturation/index.js +1 -1
- package/dist/core/shaders/Sharpness/index.js +1 -1
- package/dist/core/shaders/Shatter/index.js +1 -1
- package/dist/core/shaders/SimplexNoise/index.js +1 -1
- package/dist/core/shaders/SineWave/index.js +1 -1
- package/dist/core/shaders/SolidColor/index.js +1 -1
- package/dist/core/shaders/Spherize/index.js +1 -1
- package/dist/core/shaders/Spiral/index.js +1 -1
- package/dist/core/shaders/Strands/index.js +1 -1
- package/dist/core/shaders/Stretch/index.js +1 -1
- package/dist/core/shaders/Stripes/index.js +1 -1
- package/dist/core/shaders/StudioBackground/index.d.ts +141 -0
- package/dist/core/shaders/StudioBackground/index.d.ts.map +1 -0
- package/dist/core/shaders/StudioBackground/index.js +4 -0
- package/dist/core/shaders/Swirl/index.js +1 -1
- package/dist/core/shaders/TiltShift/index.js +1 -1
- package/dist/core/shaders/Tint/index.js +1 -1
- package/dist/core/shaders/Tritone/index.js +1 -1
- package/dist/core/shaders/Twirl/index.js +1 -1
- package/dist/core/shaders/Vibrance/index.js +1 -1
- package/dist/core/shaders/VideoTexture/index.js +1 -1
- package/dist/core/shaders/WaveDistortion/index.js +1 -1
- package/dist/core/shaders/WebcamTexture/index.js +1 -1
- package/dist/core/shaders/ZoomBlur/index.js +1 -1
- package/dist/react/ConcentricSpin.js +164 -0
- package/dist/react/StudioBackground.js +164 -0
- package/dist/react/components/ConcentricSpin.d.ts +31 -0
- package/dist/react/components/ConcentricSpin.d.ts.map +1 -0
- package/dist/react/components/StudioBackground.d.ts +31 -0
- package/dist/react/components/StudioBackground.d.ts.map +1 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +3 -1
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +43 -0
- package/dist/registry.js +687 -0
- package/dist/solid/components/ConcentricSpin.d.ts +28 -0
- package/dist/solid/components/ConcentricSpin.d.ts.map +1 -0
- package/dist/solid/components/ConcentricSpin.js +168 -0
- package/dist/solid/components/StudioBackground.d.ts +28 -0
- package/dist/solid/components/StudioBackground.d.ts.map +1 -0
- package/dist/solid/components/StudioBackground.js +168 -0
- package/dist/solid/index.d.ts +2 -0
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.js +120 -116
- package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/solid/utils/generatePresetCode.js +43 -0
- package/dist/svelte/components/ConcentricSpin.svelte.d.ts +19 -0
- package/dist/svelte/components/StudioBackground.svelte.d.ts +19 -0
- package/dist/svelte/{generatePresetCode-Bw9A9k-k.js → generatePresetCode-TDa1I3YR.js} +43 -0
- package/dist/svelte/index.d.ts +2 -0
- package/dist/svelte/index.js +515 -255
- package/dist/svelte/utils/generatePresetCode.js +1 -1
- package/dist/vue/ConcentricSpin.js +3 -0
- package/dist/vue/ConcentricSpin.vue_vue_type_script_setup_true_lang.js +151 -0
- package/dist/vue/StudioBackground.js +3 -0
- package/dist/vue/StudioBackground.vue_vue_type_script_setup_true_lang.js +162 -0
- package/dist/vue/components/ConcentricSpin.vue.d.ts +54 -0
- package/dist/vue/components/ConcentricSpin.vue.d.ts.map +1 -0
- package/dist/vue/components/StudioBackground.vue.d.ts +54 -0
- package/dist/vue/components/StudioBackground.vue.d.ts.map +1 -0
- package/dist/vue/index.d.ts +2 -0
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +3 -1
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +43 -0
- package/package.json +17 -1
- /package/dist/core/{CRTScreen-BJJhBQ3D.js → CRTScreen-D6qh6DnD.js} +0 -0
- /package/dist/core/{ContourLines-NASMUR3G.js → ContourLines-Dc5J7iw5.js} +0 -0
- /package/dist/core/{CursorTrail-DT7Q3TzC.js → CursorTrail-COnyRZH9.js} +0 -0
- /package/dist/core/{DiffuseBlur-dJ8C3PKh.js → DiffuseBlur-DcV8M7hN.js} +0 -0
- /package/dist/core/{Dither-Bac0W21a.js → Dither-C-w0ugGX.js} +0 -0
- /package/dist/core/{DotGrid-Cedu_WEn.js → DotGrid-wXnfcjrM.js} +0 -0
- /package/dist/core/{Duotone-DL9vhoyo.js → Duotone-B8dYgrFR.js} +0 -0
- /package/dist/core/{FilmGrain-BzdJM5vN.js → FilmGrain-D_6m7GJ4.js} +0 -0
- /package/dist/core/{FloatingParticles-DoB1DI8t.js → FloatingParticles-YuuXeICf.js} +0 -0
- /package/dist/core/{FlowField-BZ-ZbMzR.js → FlowField-Dx2eqOcU.js} +0 -0
- /package/dist/core/{GlassTiles-BQL2Id5c.js → GlassTiles-hnt2pUQN.js} +0 -0
- /package/dist/core/{Glitch-DmF8pHjd.js → Glitch-DfPXeSlL.js} +0 -0
- /package/dist/core/{Glow-Bxpj34sE.js → Glow-CQv_dRPj.js} +0 -0
- /package/dist/core/{Godrays-DqB-88ds.js → Godrays-B_-HliEA.js} +0 -0
- /package/dist/core/{Grayscale-CAuZTuZN.js → Grayscale-DRFXhxr4.js} +0 -0
- /package/dist/core/{Grid-B6Hf5dZa.js → Grid-DKSUwEIe.js} +0 -0
- /package/dist/core/{GridDistortion-DmwIHrXF.js → GridDistortion-DahXljLX.js} +0 -0
- /package/dist/core/{Group-DYtNH5QD.js → Group-r9gMBd5y.js} +0 -0
- /package/dist/core/{Halftone-vy2WIxyN.js → Halftone-ZVjwkjaQ.js} +0 -0
- /package/dist/core/{HueShift-C4E-S49G.js → HueShift-gZlNBwNE.js} +0 -0
- /package/dist/core/{ImageTexture-B40GVvXK.js → ImageTexture-DuXMku_O.js} +0 -0
- /package/dist/core/{Invert-ec-nb8PE.js → Invert-gUjZNHF3.js} +0 -0
- /package/dist/core/{Kaleidoscope-BO3WUc5P.js → Kaleidoscope-COKZ0BDb.js} +0 -0
- /package/dist/core/{LensFlare-BoaXy9ZE.js → LensFlare-D6jy4M7G.js} +0 -0
- /package/dist/core/{LinearBlur-BHaYZoXd.js → LinearBlur-CArDQIhs.js} +0 -0
- /package/dist/core/{LinearGradient-C8nueF-8.js → LinearGradient-BkB_3gVV.js} +0 -0
- /package/dist/core/{Liquify-JsuLWWkx.js → Liquify-BrIB9ajS.js} +0 -0
- /package/dist/core/{Mirror--f1QXEID.js → Mirror-BRPYfVAr.js} +0 -0
- /package/dist/core/{Perspective-Dyj4iJMR.js → Perspective-CglPLWTZ.js} +0 -0
- /package/dist/core/{Pixelate-CzXp_BwM.js → Pixelate-CwnuDc5L.js} +0 -0
- /package/dist/core/{Plasma-FfOwR9cP.js → Plasma-CuW-GOI_.js} +0 -0
- /package/dist/core/{PolarCoordinates-CfuvmwZm.js → PolarCoordinates-9AFXKnSC.js} +0 -0
- /package/dist/core/{Posterize-IUwDieMu.js → Posterize-DU2yrydV.js} +0 -0
- /package/dist/core/{ProgressiveBlur-BTGKywKM.js → ProgressiveBlur-BXv2mob_.js} +0 -0
- /package/dist/core/{RadialGradient-DbcPAwI7.js → RadialGradient-Dd21Be-_.js} +0 -0
- /package/dist/core/{RectangularCoordinates-OOpDHjTM.js → RectangularCoordinates-DAOGnX2p.js} +0 -0
- /package/dist/core/{Ripples-CGhzc9or.js → Ripples-Nk5is8WX.js} +0 -0
- /package/dist/core/{Saturation-ssiNVXIp.js → Saturation-KoiVB92Y.js} +0 -0
- /package/dist/core/{Sharpness-B-nN0G5P.js → Sharpness-CK-zaDVc.js} +0 -0
- /package/dist/core/{Shatter-CryQHkSZ.js → Shatter-EEzkIXGb.js} +0 -0
- /package/dist/core/{SimplexNoise-B-tDGmzX.js → SimplexNoise-DKov4Yho.js} +0 -0
- /package/dist/core/{SineWave-C6MpmU6E.js → SineWave-Cy0wWKUU.js} +0 -0
- /package/dist/core/{SolidColor-BjLy2eJx.js → SolidColor-P4OKglCC.js} +0 -0
- /package/dist/core/{Spherize-Mtl4w0Lc.js → Spherize-BLEvqakM.js} +0 -0
- /package/dist/core/{Spiral-Bl67ud0b.js → Spiral-DXuKs26n.js} +0 -0
- /package/dist/core/{Strands-BNxk94tR.js → Strands-DsdASoV4.js} +0 -0
- /package/dist/core/{Stretch-DROTOuvH.js → Stretch-By8f2wmJ.js} +0 -0
- /package/dist/core/{Stripes-IMsC1G-g.js → Stripes-D8HSlP1H.js} +0 -0
- /package/dist/core/{Swirl-C9xCY4TA.js → Swirl-BIFGxHL0.js} +0 -0
- /package/dist/core/{TiltShift-CFhc4M-Z.js → TiltShift-CLMFkzBs.js} +0 -0
- /package/dist/core/{Tint-DS1FvtQc.js → Tint-NQjiXLGu.js} +0 -0
- /package/dist/core/{Tritone-CesYYNTz.js → Tritone-67eoddBF.js} +0 -0
- /package/dist/core/{Twirl-8C-m04yw.js → Twirl-ZaYAMqmq.js} +0 -0
- /package/dist/core/{Vibrance-Cbr-9ds2.js → Vibrance-DbSUuK_4.js} +0 -0
- /package/dist/core/{VideoTexture-DKnQrDkq.js → VideoTexture-lHzoN3G9.js} +0 -0
- /package/dist/core/{WaveDistortion-D-TGqE0a.js → WaveDistortion-CB6xTndT.js} +0 -0
- /package/dist/core/{WebcamTexture-C3EtpWf2.js → WebcamTexture-BJUvpMmV.js} +0 -0
- /package/dist/core/{ZoomBlur-DmMiy4FJ.js → ZoomBlur-BCClC8fw.js} +0 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { t as applyEdgeHandling } from "./edges-Bd7GP4s2.js";
|
|
2
|
+
import { o as transformEdges, s as transformPosition } from "./transformations-CC_c-QAT.js";
|
|
3
|
+
import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
|
|
4
|
+
import { Fn, convertToTexture, cos, float, floor, fract, mix, mod, screenUV, sin, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
5
|
+
const componentDefinition = {
|
|
6
|
+
name: "ConcentricSpin",
|
|
7
|
+
category: "Distortions",
|
|
8
|
+
description: "Concentric rings that each rotate the underlying image by different amounts",
|
|
9
|
+
requiresRTT: true,
|
|
10
|
+
requiresChild: true,
|
|
11
|
+
props: {
|
|
12
|
+
intensity: {
|
|
13
|
+
default: 20,
|
|
14
|
+
description: "Maximum rotation angle per ring",
|
|
15
|
+
ui: {
|
|
16
|
+
type: "range",
|
|
17
|
+
min: 0,
|
|
18
|
+
max: 100,
|
|
19
|
+
step: 1,
|
|
20
|
+
label: "Intensity",
|
|
21
|
+
group: "Effect"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
rings: {
|
|
25
|
+
default: 8,
|
|
26
|
+
description: "Number of concentric rings",
|
|
27
|
+
ui: {
|
|
28
|
+
type: "range",
|
|
29
|
+
min: 1,
|
|
30
|
+
max: 30,
|
|
31
|
+
step: 1,
|
|
32
|
+
label: "Rings",
|
|
33
|
+
group: "Effect"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
smoothness: {
|
|
37
|
+
default: .03,
|
|
38
|
+
description: "Softness of transitions between rings",
|
|
39
|
+
ui: {
|
|
40
|
+
type: "range",
|
|
41
|
+
min: 0,
|
|
42
|
+
max: 1,
|
|
43
|
+
step: .01,
|
|
44
|
+
label: "Smoothness",
|
|
45
|
+
group: "Effect"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
seed: {
|
|
49
|
+
default: 0,
|
|
50
|
+
description: "Randomization seed for per-ring rotation variation",
|
|
51
|
+
ui: {
|
|
52
|
+
type: "range",
|
|
53
|
+
min: 0,
|
|
54
|
+
max: 100,
|
|
55
|
+
step: 1,
|
|
56
|
+
label: "Seed",
|
|
57
|
+
group: "Effect"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
speed: {
|
|
61
|
+
default: .1,
|
|
62
|
+
description: "Speed of continuous ring rotation",
|
|
63
|
+
ui: {
|
|
64
|
+
type: "range",
|
|
65
|
+
min: -5,
|
|
66
|
+
max: 5,
|
|
67
|
+
step: .1,
|
|
68
|
+
label: "Speed",
|
|
69
|
+
group: "Animation"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
speedRandomness: {
|
|
73
|
+
default: .5,
|
|
74
|
+
description: "How much each ring varies in rotation speed and direction",
|
|
75
|
+
ui: {
|
|
76
|
+
type: "range",
|
|
77
|
+
min: 0,
|
|
78
|
+
max: 1,
|
|
79
|
+
step: .01,
|
|
80
|
+
label: "Speed Randomness",
|
|
81
|
+
group: "Animation"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
edges: {
|
|
85
|
+
default: "mirror",
|
|
86
|
+
description: "How to handle edges when distortion pushes content out of bounds",
|
|
87
|
+
transform: transformEdges,
|
|
88
|
+
ui: {
|
|
89
|
+
type: "select",
|
|
90
|
+
options: [
|
|
91
|
+
{
|
|
92
|
+
label: "Stretch",
|
|
93
|
+
value: "stretch"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
label: "Transparent",
|
|
97
|
+
value: "transparent"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: "Mirror",
|
|
101
|
+
value: "mirror"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
label: "Wrap",
|
|
105
|
+
value: "wrap"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
label: "Edges",
|
|
109
|
+
group: "Effect"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
center: {
|
|
113
|
+
default: {
|
|
114
|
+
x: .5,
|
|
115
|
+
y: .5
|
|
116
|
+
},
|
|
117
|
+
transform: transformPosition,
|
|
118
|
+
description: "Center point of the concentric rings",
|
|
119
|
+
ui: {
|
|
120
|
+
type: "position",
|
|
121
|
+
label: "Center Position",
|
|
122
|
+
group: "Position"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
fragmentNode: (params) => {
|
|
127
|
+
const { uniforms, childNode, onCleanup } = params;
|
|
128
|
+
if (!childNode) return vec4(0, 0, 0, 0);
|
|
129
|
+
const childTexture = convertToTexture(childNode);
|
|
130
|
+
onCleanup(() => {
|
|
131
|
+
if (childTexture?.renderTarget?.dispose) childTexture.renderTarget.dispose();
|
|
132
|
+
});
|
|
133
|
+
const center = vec2(uniforms.center.uniform.x, uniforms.center.uniform.y.oneMinus());
|
|
134
|
+
const maxAngle = uniforms.intensity.uniform.mul(.01745);
|
|
135
|
+
const rings = uniforms.rings.uniform;
|
|
136
|
+
const edgeSoftness = uniforms.smoothness.uniform;
|
|
137
|
+
const seed = uniforms.seed.uniform;
|
|
138
|
+
const speedRandomness = uniforms.speedRandomness.uniform;
|
|
139
|
+
const aspect = viewportSize.x.div(viewportSize.y);
|
|
140
|
+
const animTime = createAnimatedTime(params, uniforms.speed);
|
|
141
|
+
const hash = (x) => fract(sin(x.mul(12.9898)).mul(43758.5453)).sub(.5).mul(2);
|
|
142
|
+
return Fn(() => {
|
|
143
|
+
const uv$1 = screenUV;
|
|
144
|
+
const dx = uv$1.x.sub(center.x).mul(aspect);
|
|
145
|
+
const dy = uv$1.y.sub(center.y);
|
|
146
|
+
const ringCoord = vec2(dx, dy).length().mul(rings);
|
|
147
|
+
const ringIndex = floor(ringCoord);
|
|
148
|
+
const ringFrac = fract(ringCoord);
|
|
149
|
+
const seedOffset = seed.mul(.137);
|
|
150
|
+
const staticA = hash(ringIndex.add(seedOffset)).mul(maxAngle);
|
|
151
|
+
const staticB = hash(ringIndex.add(1).add(seedOffset)).mul(maxAngle);
|
|
152
|
+
const ringSpeedA = mix(float(1), hash(ringIndex.add(42.7)), speedRandomness);
|
|
153
|
+
const ringSpeedB = mix(float(1), hash(ringIndex.add(1).add(42.7)), speedRandomness);
|
|
154
|
+
const animA = animTime.mul(.25).mul(ringSpeedA);
|
|
155
|
+
const animB = animTime.mul(.25).mul(ringSpeedB);
|
|
156
|
+
const totalA = staticA.add(animA);
|
|
157
|
+
const totalB = staticB.add(animB);
|
|
158
|
+
const TWO_PI = float(Math.PI * 2);
|
|
159
|
+
const diff = mod(totalB.sub(totalA).add(Math.PI), TWO_PI).sub(Math.PI);
|
|
160
|
+
const halfEdge = edgeSoftness.mul(.5).add(.001);
|
|
161
|
+
const blend = smoothstep(float(.5).sub(halfEdge), float(.5).add(halfEdge), ringFrac);
|
|
162
|
+
const angle = totalA.add(diff.mul(blend));
|
|
163
|
+
const cosA = cos(angle);
|
|
164
|
+
const sinA = sin(angle);
|
|
165
|
+
const rotX = dx.mul(cosA).sub(dy.mul(sinA));
|
|
166
|
+
const rotY = dx.mul(sinA).add(dy.mul(cosA));
|
|
167
|
+
const distortedUV = vec2(rotX.div(aspect).add(center.x), rotY.add(center.y));
|
|
168
|
+
return applyEdgeHandling(distortedUV, childTexture.sample(distortedUV), childTexture, uniforms.edges.uniform);
|
|
169
|
+
})();
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
var ConcentricSpin_default = componentDefinition;
|
|
173
|
+
export { componentDefinition as n, ConcentricSpin_default as t };
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { r as transformColor, s as transformPosition } from "./transformations-CC_c-QAT.js";
|
|
2
|
+
import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
|
|
3
|
+
import { Fn, clamp, cos, exp, float, fract, mix, screenUV, sin, smoothstep, vec3, vec4, viewportSize } from "three/tsl";
|
|
4
|
+
const componentDefinition = {
|
|
5
|
+
name: "StudioBackground",
|
|
6
|
+
category: "Textures",
|
|
7
|
+
description: "Multi-light studio background with ambient motion.",
|
|
8
|
+
props: {
|
|
9
|
+
color: {
|
|
10
|
+
default: "#d8dbec",
|
|
11
|
+
transform: transformColor,
|
|
12
|
+
description: "Base studio surface color",
|
|
13
|
+
ui: {
|
|
14
|
+
type: "color",
|
|
15
|
+
label: "Surface Color",
|
|
16
|
+
group: "Colors"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
keyColor: {
|
|
20
|
+
default: "#d5e4ea",
|
|
21
|
+
transform: transformColor,
|
|
22
|
+
description: "Color of the overhead key light",
|
|
23
|
+
ui: {
|
|
24
|
+
type: "color",
|
|
25
|
+
label: "Key Color",
|
|
26
|
+
group: "Key Light"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
keyIntensity: {
|
|
30
|
+
default: 40,
|
|
31
|
+
description: "Intensity of the key light",
|
|
32
|
+
ui: {
|
|
33
|
+
type: "range",
|
|
34
|
+
min: 0,
|
|
35
|
+
max: 100,
|
|
36
|
+
step: 1,
|
|
37
|
+
label: "Intensity",
|
|
38
|
+
group: "Key Light"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
keySoftness: {
|
|
42
|
+
default: 50,
|
|
43
|
+
description: "How diffuse the key light is",
|
|
44
|
+
ui: {
|
|
45
|
+
type: "range",
|
|
46
|
+
min: 0,
|
|
47
|
+
max: 100,
|
|
48
|
+
step: 1,
|
|
49
|
+
label: "Softness",
|
|
50
|
+
group: "Key Light"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
fillColor: {
|
|
54
|
+
default: "#d5e4ea",
|
|
55
|
+
transform: transformColor,
|
|
56
|
+
description: "Color of the side fill lights",
|
|
57
|
+
ui: {
|
|
58
|
+
type: "color",
|
|
59
|
+
label: "Fill Color",
|
|
60
|
+
group: "Fill Lights"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
fillIntensity: {
|
|
64
|
+
default: 10,
|
|
65
|
+
description: "Intensity of the fill lights",
|
|
66
|
+
ui: {
|
|
67
|
+
type: "range",
|
|
68
|
+
min: 0,
|
|
69
|
+
max: 100,
|
|
70
|
+
step: 1,
|
|
71
|
+
label: "Intensity",
|
|
72
|
+
group: "Fill Lights"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
fillSoftness: {
|
|
76
|
+
default: 70,
|
|
77
|
+
description: "How diffuse the fill lights are",
|
|
78
|
+
ui: {
|
|
79
|
+
type: "range",
|
|
80
|
+
min: 0,
|
|
81
|
+
max: 100,
|
|
82
|
+
step: 1,
|
|
83
|
+
label: "Softness",
|
|
84
|
+
group: "Fill Lights"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
fillAngle: {
|
|
88
|
+
default: 70,
|
|
89
|
+
description: "How far apart the fill lights are from center",
|
|
90
|
+
ui: {
|
|
91
|
+
type: "range",
|
|
92
|
+
min: 0,
|
|
93
|
+
max: 100,
|
|
94
|
+
step: 1,
|
|
95
|
+
label: "Spread",
|
|
96
|
+
group: "Fill Lights"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
backColor: {
|
|
100
|
+
default: "#c8d4e8",
|
|
101
|
+
transform: transformColor,
|
|
102
|
+
description: "Color of the upward back wash",
|
|
103
|
+
ui: {
|
|
104
|
+
type: "color",
|
|
105
|
+
label: "Back Color",
|
|
106
|
+
group: "Back Light"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
backIntensity: {
|
|
110
|
+
default: 20,
|
|
111
|
+
description: "Intensity of the back wash",
|
|
112
|
+
ui: {
|
|
113
|
+
type: "range",
|
|
114
|
+
min: 0,
|
|
115
|
+
max: 100,
|
|
116
|
+
step: 1,
|
|
117
|
+
label: "Intensity",
|
|
118
|
+
group: "Back Light"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
backSoftness: {
|
|
122
|
+
default: 80,
|
|
123
|
+
description: "How diffuse the back wash is",
|
|
124
|
+
ui: {
|
|
125
|
+
type: "range",
|
|
126
|
+
min: 0,
|
|
127
|
+
max: 100,
|
|
128
|
+
step: 1,
|
|
129
|
+
label: "Softness",
|
|
130
|
+
group: "Back Light"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
brightness: {
|
|
134
|
+
default: 20,
|
|
135
|
+
description: "Overall ambient light level",
|
|
136
|
+
ui: {
|
|
137
|
+
type: "range",
|
|
138
|
+
min: 0,
|
|
139
|
+
max: 100,
|
|
140
|
+
step: 1,
|
|
141
|
+
label: "Ambient",
|
|
142
|
+
group: "Lighting"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
vignette: {
|
|
146
|
+
default: 0,
|
|
147
|
+
description: "Edge darkening",
|
|
148
|
+
ui: {
|
|
149
|
+
type: "range",
|
|
150
|
+
min: 0,
|
|
151
|
+
max: 100,
|
|
152
|
+
step: 1,
|
|
153
|
+
label: "Vignette",
|
|
154
|
+
group: "Lighting"
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
center: {
|
|
158
|
+
default: {
|
|
159
|
+
x: .5,
|
|
160
|
+
y: .8
|
|
161
|
+
},
|
|
162
|
+
transform: transformPosition,
|
|
163
|
+
description: "Where the spotlight meets the floor",
|
|
164
|
+
ui: {
|
|
165
|
+
type: "position",
|
|
166
|
+
label: "Stage Center",
|
|
167
|
+
group: "Scene"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
lightTarget: {
|
|
171
|
+
default: 100,
|
|
172
|
+
description: "How far toward the floor vs wall the spotlights aim",
|
|
173
|
+
ui: {
|
|
174
|
+
type: "range",
|
|
175
|
+
min: 0,
|
|
176
|
+
max: 100,
|
|
177
|
+
step: 1,
|
|
178
|
+
label: "Light Depth",
|
|
179
|
+
group: "Scene"
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
wallCurvature: {
|
|
183
|
+
default: 10,
|
|
184
|
+
description: "How rounded the cove is",
|
|
185
|
+
ui: {
|
|
186
|
+
type: "range",
|
|
187
|
+
min: 0,
|
|
188
|
+
max: 100,
|
|
189
|
+
step: 1,
|
|
190
|
+
label: "Wall Curvature",
|
|
191
|
+
group: "Scene"
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
ambientIntensity: {
|
|
195
|
+
default: 50,
|
|
196
|
+
description: "Intensity of drifting ambient lights",
|
|
197
|
+
ui: {
|
|
198
|
+
type: "range",
|
|
199
|
+
min: 0,
|
|
200
|
+
max: 100,
|
|
201
|
+
step: 1,
|
|
202
|
+
label: "Ambient Detail",
|
|
203
|
+
group: "Environment"
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
ambientSpeed: {
|
|
207
|
+
default: 2,
|
|
208
|
+
description: "Drift speed",
|
|
209
|
+
ui: {
|
|
210
|
+
type: "range",
|
|
211
|
+
min: -5,
|
|
212
|
+
max: 5,
|
|
213
|
+
step: .1,
|
|
214
|
+
label: "Speed",
|
|
215
|
+
group: "Environment"
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
seed: {
|
|
219
|
+
default: 0,
|
|
220
|
+
description: "Seed for ambient pattern",
|
|
221
|
+
ui: {
|
|
222
|
+
type: "range",
|
|
223
|
+
min: 0,
|
|
224
|
+
max: 100,
|
|
225
|
+
step: 1,
|
|
226
|
+
label: "Seed",
|
|
227
|
+
group: "Environment"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
fragmentNode: (params) => {
|
|
232
|
+
const { uniforms } = params;
|
|
233
|
+
const surfaceColor = uniforms.color.uniform;
|
|
234
|
+
const brightness = uniforms.brightness.uniform.mul(.02);
|
|
235
|
+
const keyColor = uniforms.keyColor.uniform;
|
|
236
|
+
const keyInt = uniforms.keyIntensity.uniform.mul(.015);
|
|
237
|
+
const fillColor = uniforms.fillColor.uniform;
|
|
238
|
+
const fillInt = uniforms.fillIntensity.uniform.mul(.015);
|
|
239
|
+
const fillOffset = uniforms.fillAngle.uniform.mul(.005);
|
|
240
|
+
const backColor = uniforms.backColor.uniform;
|
|
241
|
+
const backInt = uniforms.backIntensity.uniform.mul(.015);
|
|
242
|
+
const centerX = uniforms.center.uniform.x;
|
|
243
|
+
const centerY = uniforms.center.uniform.y.oneMinus();
|
|
244
|
+
const lightTarget = uniforms.lightTarget.uniform.mul(.01);
|
|
245
|
+
const curvature = uniforms.wallCurvature.uniform.mul(.01);
|
|
246
|
+
const vignetteStrength = uniforms.vignette.uniform.mul(.025);
|
|
247
|
+
const ambIntensity = uniforms.ambientIntensity.uniform.mul(.012);
|
|
248
|
+
const seed = uniforms.seed.uniform;
|
|
249
|
+
const aspect = viewportSize.x.div(viewportSize.y);
|
|
250
|
+
const animTime = createAnimatedTime(params, uniforms.ambientSpeed);
|
|
251
|
+
const keyDecay = mix(float(5), float(.8), uniforms.keySoftness.uniform.mul(.01));
|
|
252
|
+
const fillDecay = mix(float(5), float(.8), uniforms.fillSoftness.uniform.mul(.01));
|
|
253
|
+
const backDecay = mix(float(5), float(.8), uniforms.backSoftness.uniform.mul(.01));
|
|
254
|
+
const hash01 = (x) => fract(sin(x.mul(12.9898)).mul(43758.5453));
|
|
255
|
+
const ambLights = Array.from({ length: 4 }, (_, i) => {
|
|
256
|
+
const s = seed.add(float(i * 73.1));
|
|
257
|
+
const sizeVal = hash01(s.add(311)).mul(.12).add(.1);
|
|
258
|
+
return {
|
|
259
|
+
radiusX: hash01(s).mul(.5).add(.2),
|
|
260
|
+
radiusY: hash01(s.add(37)).mul(.25).add(.1),
|
|
261
|
+
freqX: hash01(s.add(91)).mul(.3).add(.1),
|
|
262
|
+
freqY: hash01(s.add(143)).mul(.25).add(.08),
|
|
263
|
+
phaseX: hash01(s.add(200)).mul(Math.PI * 2),
|
|
264
|
+
phaseY: hash01(s.add(257)).mul(Math.PI * 2),
|
|
265
|
+
sizeSq: sizeVal.mul(sizeVal)
|
|
266
|
+
};
|
|
267
|
+
});
|
|
268
|
+
return Fn(() => {
|
|
269
|
+
const uv$1 = screenUV;
|
|
270
|
+
const transitionWidth = mix(float(.015), float(.15), curvature);
|
|
271
|
+
const isFloor = smoothstep(centerY.sub(transitionWidth), centerY.add(transitionWidth), uv$1.y);
|
|
272
|
+
const notFloor = float(1).sub(isFloor);
|
|
273
|
+
const wallNormY = clamp(uv$1.y.div(centerY), 0, 1);
|
|
274
|
+
const wallNormY2 = wallNormY.mul(wallNormY);
|
|
275
|
+
const floorNormY = clamp(uv$1.y.sub(centerY).div(float(1).sub(centerY)), 0, 1);
|
|
276
|
+
const uvXCentered = uv$1.x.sub(centerX).mul(aspect);
|
|
277
|
+
const coneWidth = mix(float(.05), float(.45), wallNormY2);
|
|
278
|
+
const wallFallY = float(1).sub(wallNormY).mul(1.2);
|
|
279
|
+
const wallFallY2 = wallFallY.mul(wallFallY);
|
|
280
|
+
const floorPoolY = centerY.add(float(1).sub(centerY).mul(.3));
|
|
281
|
+
const floorDy = uv$1.y.sub(floorPoolY).mul(4);
|
|
282
|
+
const floorDy2 = floorDy.mul(floorDy);
|
|
283
|
+
const ambient = mix(mix(float(.2), float(.4), wallNormY), mix(float(.38), float(.18), floorNormY), isFloor).mul(brightness);
|
|
284
|
+
const curveDist = uv$1.y.sub(centerY).div(transitionWidth.add(.001));
|
|
285
|
+
const curveGlow = exp(curveDist.mul(curveDist).mul(-.5)).mul(curvature).mul(brightness).mul(.1);
|
|
286
|
+
const neutralBase = ambient.add(curveGlow);
|
|
287
|
+
const lightAccum = vec3(neutralBase, neutralBase, neutralBase).toVar();
|
|
288
|
+
const wallBias = float(1).sub(lightTarget).mul(1.4).add(.3);
|
|
289
|
+
const floorBias = lightTarget.mul(1.4).add(.3);
|
|
290
|
+
const downSpot = (sourceX, decay) => {
|
|
291
|
+
const beamX = mix(sourceX, centerX, wallNormY2);
|
|
292
|
+
const wDx = uv$1.x.sub(beamX).mul(aspect).div(coneWidth);
|
|
293
|
+
const wall = exp(wDx.mul(wDx).add(wallFallY2).mul(-1).mul(decay)).mul(notFloor).mul(wallBias);
|
|
294
|
+
const poolX = mix(centerX, sourceX, float(.25));
|
|
295
|
+
const fDx = uv$1.x.sub(poolX).mul(aspect).mul(1.4);
|
|
296
|
+
const floor$1 = exp(fDx.mul(fDx).add(floorDy2).mul(-1).mul(decay.mul(1.5))).mul(isFloor).mul(floorBias);
|
|
297
|
+
return wall.add(floor$1);
|
|
298
|
+
};
|
|
299
|
+
const keyPat = downSpot(centerX, keyDecay).mul(keyInt);
|
|
300
|
+
lightAccum.assign(lightAccum.add(keyColor.rgb.mul(keyPat)));
|
|
301
|
+
const leftPat = downSpot(centerX.sub(fillOffset), fillDecay).mul(fillInt);
|
|
302
|
+
const rightPat = downSpot(centerX.add(fillOffset), fillDecay).mul(fillInt);
|
|
303
|
+
lightAccum.assign(lightAccum.add(fillColor.rgb.mul(leftPat.add(rightPat))));
|
|
304
|
+
const backBottomY = mix(float(1), centerY, float(.15));
|
|
305
|
+
const bfDx = uvXCentered.mul(.5);
|
|
306
|
+
const bfDy = uv$1.y.sub(backBottomY).mul(4);
|
|
307
|
+
const backFloor = exp(bfDx.mul(bfDx).add(bfDy.mul(bfDy)).mul(-1).mul(backDecay)).mul(isFloor);
|
|
308
|
+
const bwDx = uvXCentered.mul(.6);
|
|
309
|
+
const bwDy = centerY.sub(uv$1.y).mul(3);
|
|
310
|
+
const backWall = exp(bwDx.mul(bwDx).add(bwDy.mul(bwDy)).mul(-1).mul(backDecay.mul(.8))).mul(notFloor).mul(wallNormY2);
|
|
311
|
+
const backPat = backFloor.add(backWall).mul(backInt);
|
|
312
|
+
lightAccum.assign(lightAccum.add(backColor.rgb.mul(backPat)));
|
|
313
|
+
const bnDx = uvXCentered.mul(.7);
|
|
314
|
+
const bnDy = uv$1.y.sub(centerY).add(.02).mul(10);
|
|
315
|
+
const bounce = exp(bnDx.mul(bnDx).add(bnDy.mul(bnDy)).mul(-2.5)).mul(keyInt.mul(.12)).mul(notFloor);
|
|
316
|
+
lightAccum.assign(lightAccum.add(vec3(bounce, bounce, bounce)));
|
|
317
|
+
const ambGlowScale = ambIntensity.mul(.25);
|
|
318
|
+
for (let i = 0; i < 4; i++) {
|
|
319
|
+
const l = ambLights[i];
|
|
320
|
+
const lx = centerX.add(sin(animTime.mul(l.freqX).add(l.phaseX)).mul(l.radiusX));
|
|
321
|
+
const ly = centerY.sub(.2).add(cos(animTime.mul(l.freqY).add(l.phaseY)).mul(l.radiusY));
|
|
322
|
+
const dx = uv$1.x.sub(lx).mul(aspect);
|
|
323
|
+
const dy = uv$1.y.sub(ly);
|
|
324
|
+
const glow = exp(dx.mul(dx).add(dy.mul(dy)).div(l.sizeSq).mul(-.5)).mul(ambGlowScale);
|
|
325
|
+
lightAccum.assign(lightAccum.add(vec3(glow, glow, glow)));
|
|
326
|
+
}
|
|
327
|
+
const vigX = uv$1.x.sub(.5).mul(aspect);
|
|
328
|
+
const vigY = uv$1.y.sub(.5);
|
|
329
|
+
const vigD2 = vigX.mul(vigX).add(vigY.mul(vigY));
|
|
330
|
+
const vig = clamp(float(1).sub(vigD2.mul(vignetteStrength)), 0, 1);
|
|
331
|
+
lightAccum.assign(clamp(lightAccum, 0, 3));
|
|
332
|
+
return vec4(surfaceColor.rgb.mul(lightAccum).mul(vig).clamp(0, 1), float(1));
|
|
333
|
+
})();
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
var StudioBackground_default = componentDefinition;
|
|
337
|
+
export { componentDefinition as n, StudioBackground_default as t };
|