@clypra-studio/engine 0.1.2 → 1.0.1

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.
Files changed (44) hide show
  1. package/dist/TransitionDefinition-CQoSb4ZB.d.cts +158 -0
  2. package/dist/TransitionDefinition-CQoSb4ZB.d.ts +158 -0
  3. package/dist/{chunk-CJRH4PAV.js → chunk-2VGI6ZB7.js} +289 -63
  4. package/dist/chunk-2VGI6ZB7.js.map +1 -0
  5. package/dist/chunk-4PKBLJ34.js +667 -0
  6. package/dist/chunk-4PKBLJ34.js.map +1 -0
  7. package/dist/chunk-FIJBB3MH.js +2990 -0
  8. package/dist/chunk-FIJBB3MH.js.map +1 -0
  9. package/dist/{chunk-EVQAI3P3.js → chunk-S24UVNPZ.js} +5 -1
  10. package/dist/{chunk-EVQAI3P3.js.map → chunk-S24UVNPZ.js.map} +1 -1
  11. package/dist/{index-BWo6qV_z.d.cts → index-Da47I6aX.d.cts} +5 -5
  12. package/dist/{index-BWo6qV_z.d.ts → index-Da47I6aX.d.ts} +5 -5
  13. package/dist/index.cjs +3906 -1371
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +437 -3807
  16. package/dist/index.d.ts +437 -3807
  17. package/dist/index.js +1310 -1411
  18. package/dist/index.js.map +1 -1
  19. package/dist/textEffects/index.cjs.map +1 -1
  20. package/dist/textEffects/index.js +1 -1
  21. package/dist/transitions/index.cjs +2207 -3
  22. package/dist/transitions/index.cjs.map +1 -1
  23. package/dist/transitions/index.d.cts +58 -9
  24. package/dist/transitions/index.d.ts +58 -9
  25. package/dist/transitions/index.js +53 -3
  26. package/dist/v2/backends/index.cjs +246 -33
  27. package/dist/v2/backends/index.cjs.map +1 -1
  28. package/dist/v2/backends/index.d.cts +1 -1
  29. package/dist/v2/backends/index.d.ts +1 -1
  30. package/dist/v2/backends/index.js +1 -1
  31. package/dist/v2/contract/index.d.cts +12 -12
  32. package/dist/v2/contract/index.d.ts +12 -12
  33. package/dist/videoEffects/index.cjs +284 -64
  34. package/dist/videoEffects/index.cjs.map +1 -1
  35. package/dist/videoEffects/index.d.cts +34 -138
  36. package/dist/videoEffects/index.d.ts +34 -138
  37. package/dist/videoEffects/index.js +1 -1
  38. package/package.json +12 -12
  39. package/LICENSE +0 -9
  40. package/dist/chunk-5JOAEDIQ.js +0 -446
  41. package/dist/chunk-5JOAEDIQ.js.map +0 -1
  42. package/dist/chunk-CJRH4PAV.js.map +0 -1
  43. package/dist/chunk-QMRMNH52.js +0 -811
  44. package/dist/chunk-QMRMNH52.js.map +0 -1
@@ -71,24 +71,73 @@ var ADJUSTMENTS_FRAGMENT_SHADER = `
71
71
  out vec4 finalColor;
72
72
 
73
73
  uniform sampler2D uTexture;
74
+
75
+ // \u2500\u2500 Existing uniforms \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
74
76
  uniform float uExposure; // -1.0 to 1.0
75
77
  uniform float uBrightness; // -1.0 to 1.0
76
78
  uniform float uContrast; // -1.0 to 1.0
77
79
  uniform float uSaturation; // -1.0 to 1.0
78
- uniform vec3 uTemperatureColor; // HSL temperature color
80
+ uniform vec3 uTemperatureColor; // warm or cool color
79
81
  uniform float uTemperatureWeight; // 0.0 to 1.0
80
- uniform vec3 uTintColor; // tint color
82
+ uniform vec3 uTintColor; // magenta or green color
81
83
  uniform float uTintWeight; // 0.0 to 1.0
82
84
  uniform float uSepia; // 0.0 to 1.0
83
85
  uniform float uGrayscale; // 0.0 to 1.0
84
- uniform float uHueRotate; // Radians (0.0 to 2*PI)
86
+ uniform float uHueRotate; // radians
85
87
  uniform float uVignette; // 0.0 to 1.0
86
88
  uniform float uInvert; // 0.0 to 1.0
87
89
 
88
- vec3 hueRotate(vec3 color, float angle) {
90
+ // \u2500\u2500 NEW: Lift \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
91
+ uniform float uLift; // -0.2 to 0.2; positive = faded/matte, negative = crushed
92
+
93
+ // \u2500\u2500 NEW: Split-toning \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
94
+ uniform vec3 uShadowTint; // multiplicative color for shadows (neutral = vec3(1))
95
+ uniform float uShadowTintStrength;
96
+ uniform vec3 uHighlightTint; // multiplicative color for highlights (neutral = vec3(1))
97
+ uniform float uHighlightTintStrength;
98
+ uniform float uSplitBalance; // 0.0-1.0, luma split point
99
+
100
+ // \u2500\u2500 NEW: Film grain \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
101
+ uniform float uGrainIntensity; // 0.0 to 0.5
102
+ uniform float uGrainSize; // 0.1 to 5.0
103
+ uniform float uTime; // animated, incremented each frame
104
+
105
+ // \u2500\u2500 NEW: Channel-mix B&W \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
106
+ uniform vec3 uChannelMix; // R/G/B weights summing to ~1.0
107
+ uniform float uUseChannelMix; // 1.0 = active, 0.0 = off
108
+
109
+ // \u2500\u2500 NEW: Duotone \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
110
+ uniform vec3 uDuotoneDark; // color mapped to black/dark tones
111
+ uniform vec3 uDuotoneLight; // color mapped to white/light tones
112
+ uniform float uUseDuotone; // 1.0 = active, 0.0 = off
113
+
114
+ // \u2500\u2500 NEW: Vibrance \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
115
+ uniform float uVibranceAmount; // -1.0 to 1.0
116
+ uniform vec3 uVibranceProtectedHue; // reference color for skin-tone protection
117
+
118
+ // \u2500\u2500 NEW: Cross-process \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
119
+ uniform float uCrossProcessAmount; // 0.0 to 1.0
120
+
121
+ // \u2500\u2500 Helper functions \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
122
+ vec3 hueRotateColor(vec3 color, float angle) {
89
123
  vec3 k = vec3(0.57735, 0.57735, 0.57735);
90
- float cosAngle = cos(angle);
91
- return color * cosAngle + cross(k, color) * sin(angle) + k * dot(k, color) * (1.0 - cosAngle);
124
+ float c = cos(angle);
125
+ return color * c + cross(k, color) * sin(angle) + k * dot(k, color) * (1.0 - c);
126
+ }
127
+
128
+ vec3 rgb2hsv(vec3 c) {
129
+ vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
130
+ vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
131
+ vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
132
+ float d = q.x - min(q.w, q.y);
133
+ float e = 1.0e-10;
134
+ return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
135
+ }
136
+
137
+ vec3 hsv2rgb(vec3 c) {
138
+ vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
139
+ vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
140
+ return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
92
141
  }
93
142
 
94
143
  void main() {
@@ -104,44 +153,102 @@ var ADJUSTMENTS_FRAGMENT_SHADER = `
104
153
  // Brightness
105
154
  rgb = rgb + uBrightness;
106
155
 
156
+ // Lift \u2014 shift black point; applied before contrast so it interacts correctly with tonal range
157
+ if (uLift != 0.0) {
158
+ rgb = rgb + uLift * (1.0 - rgb);
159
+ }
160
+
107
161
  // Contrast
108
162
  rgb = (rgb - 0.5) * (1.0 + uContrast) + 0.5;
109
163
 
110
- // Saturation
164
+ // Saturation (flat, distinct from vibrance)
111
165
  float luma = dot(rgb, vec3(0.2126, 0.7152, 0.0722));
112
166
  rgb = mix(vec3(luma), rgb, 1.0 + uSaturation);
113
- rgb = mix(rgb, vec3(luma), uGrayscale);
167
+
168
+ // Grayscale
169
+ float lumaG = dot(rgb, vec3(0.2126, 0.7152, 0.0722));
170
+ rgb = mix(rgb, vec3(lumaG), uGrayscale);
114
171
 
115
172
  // Sepia
116
- vec3 sepiaColor = vec3(
117
- dot(rgb, vec3(0.393, 0.769, 0.189)),
118
- dot(rgb, vec3(0.349, 0.686, 0.168)),
119
- dot(rgb, vec3(0.272, 0.534, 0.131))
120
- );
121
- rgb = mix(rgb, sepiaColor, uSepia);
173
+ if (uSepia > 0.0) {
174
+ vec3 sep = vec3(
175
+ dot(rgb, vec3(0.393, 0.769, 0.189)),
176
+ dot(rgb, vec3(0.349, 0.686, 0.168)),
177
+ dot(rgb, vec3(0.272, 0.534, 0.131))
178
+ );
179
+ rgb = mix(rgb, sep, uSepia);
180
+ }
122
181
 
123
182
  // Hue Rotate
124
183
  if (uHueRotate != 0.0) {
125
- rgb = hueRotate(rgb, uHueRotate);
184
+ rgb = hueRotateColor(rgb, uHueRotate);
126
185
  }
127
186
 
128
- // Temperature soft-light blend
187
+ // Temperature \u2014 soft-light blend
129
188
  if (uTemperatureWeight > 0.0) {
130
189
  vec3 t = uTemperatureColor;
131
190
  rgb = mix(rgb, (1.0 - 2.0 * t) * rgb * rgb + 2.0 * t * rgb, uTemperatureWeight);
132
191
  }
133
192
 
134
- // Tint soft-light blend
193
+ // Tint \u2014 soft-light blend
135
194
  if (uTintWeight > 0.0) {
136
195
  vec3 t = uTintColor;
137
196
  rgb = mix(rgb, (1.0 - 2.0 * t) * rgb * rgb + 2.0 * t * rgb, uTintWeight);
138
197
  }
139
198
 
199
+ // \u2500\u2500 NEW: Channel-mixed B&W \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
200
+ // Applied before duotone; mutually exclusive (both produce mono, duotone adds color back)
201
+ if (uUseChannelMix > 0.5) {
202
+ float mono = dot(rgb, uChannelMix);
203
+ rgb = vec3(mono);
204
+ }
205
+
206
+ // \u2500\u2500 NEW: Duotone \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
207
+ // Maps current luminance to a 2-color gradient; applied after channel-mix for correct mono base
208
+ if (uUseDuotone > 0.5) {
209
+ float duoLuma = dot(rgb, vec3(0.299, 0.587, 0.114));
210
+ rgb = mix(uDuotoneDark, uDuotoneLight, duoLuma);
211
+ }
212
+
213
+ // \u2500\u2500 NEW: Split-toning \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
214
+ if (uShadowTintStrength > 0.0 || uHighlightTintStrength > 0.0) {
215
+ float splitLuma = dot(rgb, vec3(0.299, 0.587, 0.114));
216
+ float shadowW = 1.0 - smoothstep(0.0, uSplitBalance, splitLuma);
217
+ float highlightW = smoothstep(uSplitBalance, 1.0, splitLuma);
218
+ rgb = mix(rgb, rgb * uShadowTint, shadowW * uShadowTintStrength);
219
+ rgb = mix(rgb, rgb * uHighlightTint, highlightW * uHighlightTintStrength);
220
+ }
221
+
222
+ // \u2500\u2500 NEW: Vibrance \u2014 hue-selective saturation \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
223
+ // Skipped when channel-mix or duotone have flattened color information
224
+ if (uVibranceAmount != 0.0 && uUseChannelMix < 0.5 && uUseDuotone < 0.5) {
225
+ vec3 hsv = rgb2hsv(clamp(rgb, 0.0, 1.0));
226
+ vec3 protHSV = rgb2hsv(uVibranceProtectedHue);
227
+ float hueDist = abs(hsv.x - protHSV.x);
228
+ hueDist = min(hueDist, 1.0 - hueDist); // wrap hue distance
229
+ float protection = smoothstep(0.0, 0.15, hueDist);
230
+ hsv.y = clamp(hsv.y + uVibranceAmount * protection, 0.0, 1.0);
231
+ rgb = hsv2rgb(hsv);
232
+ }
233
+
234
+ // \u2500\u2500 NEW: Cross-process \u2014 channel curve swap \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
235
+ if (uCrossProcessAmount > 0.0) {
236
+ float origR = rgb.r;
237
+ float origB = rgb.b;
238
+ rgb.r = mix(rgb.r, pow(max(origB, 0.001), 0.8), uCrossProcessAmount);
239
+ rgb.b = mix(rgb.b, pow(max(origR, 0.001), 1.2), uCrossProcessAmount);
240
+ }
241
+
242
+ // \u2500\u2500 NEW: Film grain \u2014 last before vignette \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
243
+ if (uGrainIntensity > 0.0) {
244
+ float grain = fract(sin(dot(vTextureCoord * uGrainSize + uTime, vec2(12.9898, 78.233))) * 43758.5453);
245
+ rgb += (grain - 0.5) * uGrainIntensity;
246
+ }
247
+
140
248
  // Vignette
141
249
  vec2 uv = vTextureCoord - 0.5;
142
- float dist = length(uv);
143
- float vignetteVal = smoothstep(0.45, 1.0, dist);
144
- rgb = mix(rgb, rgb * 0.0, vignetteVal * uVignette);
250
+ float vignetteVal = smoothstep(0.45, 1.0, length(uv));
251
+ rgb = mix(rgb, vec3(0.0), vignetteVal * uVignette);
145
252
 
146
253
  finalColor = vec4(rgb, texColor.a);
147
254
  }
@@ -152,10 +259,11 @@ var ColorAdjustmentsEffect = {
152
259
  id: "color-adjustments",
153
260
  name: "Color Adjustments",
154
261
  category: "light",
155
- description: "Adjust exposure, brightness, contrast, saturation, temperature, tint, sepia, grayscale, hue, invert, and vignette.",
156
- tags: ["color", "adjustments", "brightness", "contrast", "saturation", "temperature", "tint", "vignette"],
262
+ description: "Adjust exposure, brightness, contrast, saturation, temperature, tint, sepia, grayscale, hue, invert, vignette, lift, split-toning, grain, channel-mix, duotone, vibrance, and cross-process.",
263
+ tags: ["color", "adjustments", "brightness", "contrast", "saturation", "temperature", "tint", "vignette", "grain", "duotone", "vibrance"],
157
264
  thumbnail: "",
158
265
  params: [
266
+ // ── Existing ───────────────────────────────────────────────────────────
159
267
  { key: "exposure", label: "Exposure", type: "range", value: 0, min: -1, max: 1, step: 0.01 },
160
268
  { key: "brightness", label: "Brightness", type: "range", value: 0, min: -1, max: 1, step: 0.01 },
161
269
  { key: "contrast", label: "Contrast", type: "range", value: 0, min: -1, max: 1, step: 0.01 },
@@ -166,19 +274,51 @@ var ColorAdjustmentsEffect = {
166
274
  { key: "grayscale", label: "Grayscale", type: "range", value: 0, min: 0, max: 1, step: 0.01 },
167
275
  { key: "hueRotate", label: "Hue Rotate", type: "range", value: 0, min: 0, max: 6.28318, step: 0.01 },
168
276
  { key: "vignette", label: "Vignette", type: "range", value: 0, min: 0, max: 1, step: 0.01 },
169
- { key: "invert", label: "Invert", type: "range", value: 0, min: 0, max: 1, step: 0.01 }
277
+ { key: "invert", label: "Invert", type: "range", value: 0, min: 0, max: 1, step: 0.01 },
278
+ // ── NEW ────────────────────────────────────────────────────────────────
279
+ { key: "lift", label: "Lift", type: "range", value: 0, min: -0.5, max: 0.5, step: 0.01 },
280
+ { key: "shadowTintR", label: "Shadow Tint R", type: "range", value: 1, min: 0, max: 2, step: 0.01 },
281
+ { key: "shadowTintG", label: "Shadow Tint G", type: "range", value: 1, min: 0, max: 2, step: 0.01 },
282
+ { key: "shadowTintB", label: "Shadow Tint B", type: "range", value: 1, min: 0, max: 2, step: 0.01 },
283
+ { key: "shadowTintStrength", label: "Shadow Strength", type: "range", value: 0, min: 0, max: 1, step: 0.01 },
284
+ { key: "highlightTintR", label: "Hi Tint R", type: "range", value: 1, min: 0, max: 2, step: 0.01 },
285
+ { key: "highlightTintG", label: "Hi Tint G", type: "range", value: 1, min: 0, max: 2, step: 0.01 },
286
+ { key: "highlightTintB", label: "Hi Tint B", type: "range", value: 1, min: 0, max: 2, step: 0.01 },
287
+ { key: "highlightTintStrength", label: "Hi Strength", type: "range", value: 0, min: 0, max: 1, step: 0.01 },
288
+ { key: "splitBalance", label: "Split Balance", type: "range", value: 0.5, min: 0, max: 1, step: 0.01 },
289
+ { key: "grainIntensity", label: "Grain Intensity", type: "range", value: 0, min: 0, max: 0.5, step: 0.01 },
290
+ { key: "grainSize", label: "Grain Size", type: "range", value: 1, min: 0.1, max: 5, step: 0.1 },
291
+ { key: "channelMixR", label: "Channel Mix R", type: "range", value: 0, min: 0, max: 1, step: 0.01 },
292
+ { key: "channelMixG", label: "Channel Mix G", type: "range", value: 0, min: 0, max: 1, step: 0.01 },
293
+ { key: "channelMixB", label: "Channel Mix B", type: "range", value: 0, min: 0, max: 1, step: 0.01 },
294
+ { key: "useChannelMix", label: "Use Channel Mix", type: "range", value: 0, min: 0, max: 1, step: 1 },
295
+ { key: "duotoneDarkR", label: "Duo Dark R", type: "range", value: 0, min: 0, max: 1, step: 0.01 },
296
+ { key: "duotoneDarkG", label: "Duo Dark G", type: "range", value: 0, min: 0, max: 1, step: 0.01 },
297
+ { key: "duotoneDarkB", label: "Duo Dark B", type: "range", value: 0, min: 0, max: 1, step: 0.01 },
298
+ { key: "duotoneLightR", label: "Duo Light R", type: "range", value: 1, min: 0, max: 1, step: 0.01 },
299
+ { key: "duotoneLightG", label: "Duo Light G", type: "range", value: 1, min: 0, max: 1, step: 0.01 },
300
+ { key: "duotoneLightB", label: "Duo Light B", type: "range", value: 1, min: 0, max: 1, step: 0.01 },
301
+ { key: "useDuotone", label: "Use Duotone", type: "range", value: 0, min: 0, max: 1, step: 1 },
302
+ { key: "vibranceAmount", label: "Vibrance", type: "range", value: 0, min: -1, max: 1, step: 0.01 },
303
+ { key: "vibranceProtectedHueR", label: "Vib Protect R", type: "range", value: 0.91, min: 0, max: 1, step: 0.01 },
304
+ { key: "vibranceProtectedHueG", label: "Vib Protect G", type: "range", value: 0.69, min: 0, max: 1, step: 0.01 },
305
+ { key: "vibranceProtectedHueB", label: "Vib Protect B", type: "range", value: 0.55, min: 0, max: 1, step: 0.01 },
306
+ { key: "crossProcessAmount", label: "Cross Process", type: "range", value: 0, min: 0, max: 1, step: 0.01 }
170
307
  ],
171
308
  filterSpec: {
172
309
  create(params) {
173
- const tempWeight = Math.abs(params.temperature || 0);
174
- const tempColor = (params.temperature || 0) > 0 ? [1, 0.55, 0.16] : [0.16, 0.47, 1];
175
- const tintWeight = Math.abs(params.tint || 0);
176
- const tintColor = (params.tint || 0) > 0 ? [1, 0.16, 0.71] : [0.16, 1, 0.39];
310
+ const temperature = params.temperature || 0;
311
+ const tempWeight = Math.abs(temperature);
312
+ const tempColor = temperature > 0 ? [1, 0.55, 0.16] : [0.16, 0.47, 1];
313
+ const tint = params.tint || 0;
314
+ const tintWeight = Math.abs(tint);
315
+ const tintColor = tint > 0 ? [1, 0.16, 0.71] : [0.16, 1, 0.39];
177
316
  return import_pixi.Filter.from({
178
317
  gl: { vertex: ADJUSTMENTS_VERTEX_SHADER, fragment: ADJUSTMENTS_FRAGMENT_SHADER },
179
318
  clipToViewport: false,
180
319
  resources: {
181
320
  adjustmentsUniforms: {
321
+ // ── Existing ──────────────────────────────────────────────────
182
322
  uExposure: { value: params.exposure || 0, type: "f32" },
183
323
  uBrightness: { value: params.brightness || 0, type: "f32" },
184
324
  uContrast: { value: params.contrast || 0, type: "f32" },
@@ -191,7 +331,25 @@ var ColorAdjustmentsEffect = {
191
331
  uGrayscale: { value: params.grayscale || 0, type: "f32" },
192
332
  uHueRotate: { value: params.hueRotate || 0, type: "f32" },
193
333
  uVignette: { value: params.vignette || 0, type: "f32" },
194
- uInvert: { value: params.invert || 0, type: "f32" }
334
+ uInvert: { value: params.invert || 0, type: "f32" },
335
+ // ── NEW ───────────────────────────────────────────────────────
336
+ uLift: { value: params.lift || 0, type: "f32" },
337
+ uShadowTint: { value: [params.shadowTintR ?? 1, params.shadowTintG ?? 1, params.shadowTintB ?? 1], type: "vec3<f32>" },
338
+ uShadowTintStrength: { value: params.shadowTintStrength || 0, type: "f32" },
339
+ uHighlightTint: { value: [params.highlightTintR ?? 1, params.highlightTintG ?? 1, params.highlightTintB ?? 1], type: "vec3<f32>" },
340
+ uHighlightTintStrength: { value: params.highlightTintStrength || 0, type: "f32" },
341
+ uSplitBalance: { value: params.splitBalance ?? 0.5, type: "f32" },
342
+ uGrainIntensity: { value: params.grainIntensity || 0, type: "f32" },
343
+ uGrainSize: { value: params.grainSize ?? 1, type: "f32" },
344
+ uTime: { value: 0, type: "f32" },
345
+ uChannelMix: { value: [params.channelMixR ?? 0, params.channelMixG ?? 0, params.channelMixB ?? 0], type: "vec3<f32>" },
346
+ uUseChannelMix: { value: params.useChannelMix || 0, type: "f32" },
347
+ uDuotoneDark: { value: [params.duotoneDarkR ?? 0, params.duotoneDarkG ?? 0, params.duotoneDarkB ?? 0], type: "vec3<f32>" },
348
+ uDuotoneLight: { value: [params.duotoneLightR ?? 1, params.duotoneLightG ?? 1, params.duotoneLightB ?? 1], type: "vec3<f32>" },
349
+ uUseDuotone: { value: params.useDuotone || 0, type: "f32" },
350
+ uVibranceAmount: { value: params.vibranceAmount || 0, type: "f32" },
351
+ uVibranceProtectedHue: { value: [params.vibranceProtectedHueR ?? 0.91, params.vibranceProtectedHueG ?? 0.69, params.vibranceProtectedHueB ?? 0.55], type: "vec3<f32>" },
352
+ uCrossProcessAmount: { value: params.crossProcessAmount || 0, type: "f32" }
195
353
  }
196
354
  }
197
355
  });
@@ -200,10 +358,12 @@ var ColorAdjustmentsEffect = {
200
358
  const group = filter.resources?.adjustmentsUniforms;
201
359
  const uniforms = group?.uniforms;
202
360
  if (!uniforms) return;
203
- const tempWeight = Math.abs(params.temperature || 0);
204
- const tempColor = (params.temperature || 0) > 0 ? [1, 0.55, 0.16] : [0.16, 0.47, 1];
205
- const tintWeight = Math.abs(params.tint || 0);
206
- const tintColor = (params.tint || 0) > 0 ? [1, 0.16, 0.71] : [0.16, 1, 0.39];
361
+ const temperature = params.temperature || 0;
362
+ const tempWeight = Math.abs(temperature);
363
+ const tempColor = temperature > 0 ? [1, 0.55, 0.16] : [0.16, 0.47, 1];
364
+ const tint = params.tint || 0;
365
+ const tintWeight = Math.abs(tint);
366
+ const tintColor = tint > 0 ? [1, 0.16, 0.71] : [0.16, 1, 0.39];
207
367
  uniforms.uExposure = params.exposure || 0;
208
368
  uniforms.uBrightness = params.brightness || 0;
209
369
  uniforms.uContrast = params.contrast || 0;
@@ -217,6 +377,23 @@ var ColorAdjustmentsEffect = {
217
377
  uniforms.uHueRotate = params.hueRotate || 0;
218
378
  uniforms.uVignette = params.vignette || 0;
219
379
  uniforms.uInvert = params.invert || 0;
380
+ uniforms.uLift = params.lift || 0;
381
+ uniforms.uShadowTint = [params.shadowTintR ?? 1, params.shadowTintG ?? 1, params.shadowTintB ?? 1];
382
+ uniforms.uShadowTintStrength = params.shadowTintStrength || 0;
383
+ uniforms.uHighlightTint = [params.highlightTintR ?? 1, params.highlightTintG ?? 1, params.highlightTintB ?? 1];
384
+ uniforms.uHighlightTintStrength = params.highlightTintStrength || 0;
385
+ uniforms.uSplitBalance = params.splitBalance ?? 0.5;
386
+ uniforms.uGrainIntensity = params.grainIntensity || 0;
387
+ uniforms.uGrainSize = params.grainSize ?? 1;
388
+ uniforms.uTime = ((uniforms.uTime || 0) + 0.016) % 100;
389
+ uniforms.uChannelMix = [params.channelMixR ?? 0, params.channelMixG ?? 0, params.channelMixB ?? 0];
390
+ uniforms.uUseChannelMix = params.useChannelMix || 0;
391
+ uniforms.uDuotoneDark = [params.duotoneDarkR ?? 0, params.duotoneDarkG ?? 0, params.duotoneDarkB ?? 0];
392
+ uniforms.uDuotoneLight = [params.duotoneLightR ?? 1, params.duotoneLightG ?? 1, params.duotoneLightB ?? 1];
393
+ uniforms.uUseDuotone = params.useDuotone || 0;
394
+ uniforms.uVibranceAmount = params.vibranceAmount || 0;
395
+ uniforms.uVibranceProtectedHue = [params.vibranceProtectedHueR ?? 0.91, params.vibranceProtectedHueG ?? 0.69, params.vibranceProtectedHueB ?? 0.55];
396
+ uniforms.uCrossProcessAmount = params.crossProcessAmount || 0;
220
397
  group?.update?.();
221
398
  }
222
399
  }
@@ -232,6 +409,7 @@ function updateColorAdjustmentsFilter(filter, params) {
232
409
  }
233
410
  function normalizeColorAdjustmentsUniforms(uniforms) {
234
411
  return {
412
+ // ── Existing ────────────────────────────────────────────────────────────
235
413
  exposure: uniforms.exposure ?? 0,
236
414
  brightness: uniforms.brightness ?? 0,
237
415
  contrast: uniforms.contrast ?? 0,
@@ -242,7 +420,42 @@ function normalizeColorAdjustmentsUniforms(uniforms) {
242
420
  grayscale: uniforms.grayscale ?? 0,
243
421
  hueRotate: uniforms.hueRotate ?? 0,
244
422
  vignette: uniforms.vignette ?? 0,
245
- invert: uniforms.invert ?? 0
423
+ invert: uniforms.invert ?? 0,
424
+ // ── NEW: Lift ────────────────────────────────────────────────────────────
425
+ lift: uniforms.lift ?? 0,
426
+ // ── NEW: Split-toning ────────────────────────────────────────────────────
427
+ shadowTintR: uniforms.shadowTintR ?? 1,
428
+ shadowTintG: uniforms.shadowTintG ?? 1,
429
+ shadowTintB: uniforms.shadowTintB ?? 1,
430
+ shadowTintStrength: uniforms.shadowTintStrength ?? 0,
431
+ highlightTintR: uniforms.highlightTintR ?? 1,
432
+ highlightTintG: uniforms.highlightTintG ?? 1,
433
+ highlightTintB: uniforms.highlightTintB ?? 1,
434
+ highlightTintStrength: uniforms.highlightTintStrength ?? 0,
435
+ splitBalance: uniforms.splitBalance ?? 0.5,
436
+ // ── NEW: Film grain ──────────────────────────────────────────────────────
437
+ grainIntensity: uniforms.grainIntensity ?? 0,
438
+ grainSize: uniforms.grainSize ?? 1,
439
+ // ── NEW: Channel-mix B&W ─────────────────────────────────────────────────
440
+ channelMixR: uniforms.channelMixR ?? 0,
441
+ channelMixG: uniforms.channelMixG ?? 0,
442
+ channelMixB: uniforms.channelMixB ?? 0,
443
+ useChannelMix: uniforms.useChannelMix ?? 0,
444
+ // ── NEW: Duotone ─────────────────────────────────────────────────────────
445
+ duotoneDarkR: uniforms.duotoneDarkR ?? 0,
446
+ duotoneDarkG: uniforms.duotoneDarkG ?? 0,
447
+ duotoneDarkB: uniforms.duotoneDarkB ?? 0,
448
+ duotoneLightR: uniforms.duotoneLightR ?? 1,
449
+ duotoneLightG: uniforms.duotoneLightG ?? 1,
450
+ duotoneLightB: uniforms.duotoneLightB ?? 1,
451
+ useDuotone: uniforms.useDuotone ?? 0,
452
+ // ── NEW: Vibrance ────────────────────────────────────────────────────────
453
+ vibranceAmount: uniforms.vibranceAmount ?? 0,
454
+ vibranceProtectedHueR: uniforms.vibranceProtectedHueR ?? 0.91,
455
+ vibranceProtectedHueG: uniforms.vibranceProtectedHueG ?? 0.69,
456
+ vibranceProtectedHueB: uniforms.vibranceProtectedHueB ?? 0.55,
457
+ // ── NEW: Cross-process ───────────────────────────────────────────────────
458
+ crossProcessAmount: uniforms.crossProcessAmount ?? 0
246
459
  };
247
460
  }
248
461
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/v2/backends/index.ts","../../../src/v2/backends/PixiRenderBackend.ts","../../../src/effects/light/ColorAdjustmentsEffect.ts","../../../src/v2/backends/colorAdjustmentsFilter.ts"],"sourcesContent":["/**\n * @deprecated Use @clypra/runtime/renderer instead\n * ```ts\n * import { PixiRenderer } from \"@clypra/runtime/renderer\";\n * ```\n * This file will be removed in v3.0.0\n */\nexport { PixiRenderBackend } from \"./PixiRenderBackend.js\";\n","/**\n * @clypra/engine — Pipeline V2: Pixi Render Backend\n *\n * @deprecated Use @clypra/runtime/renderer instead\n * The runtime version (PixiRenderer) is more complete with better resource management.\n * This file will be removed in v3.0.0\n *\n * RenderBackend implementation using Pixi.js for GPU pass execution.\n */\n\nimport * as PIXI from \"pixi.js\";\nimport { AdjustmentFilter } from \"pixi-filters\";\nimport type { RenderBackend, CommandBuffer } from \"../runtime/types\";\nimport type { RenderPass } from \"../planner/types\";\nimport { createColorAdjustmentsFilter, updateColorAdjustmentsFilter, normalizeColorAdjustmentsUniforms } from \"./colorAdjustmentsFilter.js\";\n\nexport class PixiRenderBackend implements RenderBackend {\n private app: PIXI.Application | null = null;\n private initialized = false;\n private resources = new Map<string, PIXI.Texture>();\n private filters = new Map<string, PIXI.Filter>();\n private canvasElement?: HTMLCanvasElement;\n\n async init(canvasElement?: HTMLCanvasElement, width?: number, height?: number): Promise<void> {\n if (this.initialized) {\n throw new Error(\"PixiRenderBackend already initialized\");\n }\n\n this.canvasElement = canvasElement;\n\n const logicalWidth = width ?? canvasElement?.clientWidth ?? canvasElement?.width ?? 1920;\n const logicalHeight = height ?? canvasElement?.clientHeight ?? canvasElement?.height ?? 1080;\n\n this.app = new PIXI.Application();\n await this.app.init({\n canvas: canvasElement,\n width: logicalWidth,\n height: logicalHeight,\n backgroundColor: 0x0e0e12,\n antialias: true,\n preference: \"webgl\",\n resolution: typeof window !== \"undefined\" ? window.devicePixelRatio || 1 : 1,\n autoDensity: true,\n preserveDrawingBuffer: true,\n });\n\n this.initialized = true;\n }\n\n resize(width: number, height: number): void {\n if (!this.app) return;\n this.app.renderer.resize(width, height);\n }\n\n get logicalWidth(): number {\n return this.app?.renderer.width ?? 0;\n }\n\n get logicalHeight(): number {\n return this.app?.renderer.height ?? 0;\n }\n\n allocateResource(id: string, _type: \"texture\" | \"buffer\", width: number, height: number, _format: string): void {\n if (!this.initialized || !this.app) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n if (this.resources.has(id)) {\n throw new Error(`Resource \"${id}\" already allocated`);\n }\n this.resources.set(id, PIXI.RenderTexture.create({ width, height }));\n }\n\n releaseResource(id: string): void {\n if (!this.initialized) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n const texture = this.resources.get(id);\n if (!texture) {\n throw new Error(`Resource \"${id}\" not found for release`);\n }\n texture.destroy(true);\n this.resources.delete(id);\n }\n\n compileShader(shaderId: string, _sourceGLSLOrWGSL: string): void {\n if (!this.initialized) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n\n if (this.filters.has(shaderId)) return;\n\n let filter: PIXI.Filter;\n switch (shaderId) {\n case \"brightness\":\n filter = new AdjustmentFilter({ brightness: 1.0 });\n break;\n case \"contrast\":\n filter = new AdjustmentFilter({ contrast: 1.0 });\n break;\n case \"gaussian-blur-h\":\n case \"gaussian-blur-v\":\n filter = new PIXI.BlurFilter({ strength: 8, quality: 4 });\n break;\n case \"copy\":\n case \"blit-source\":\n filter = new AdjustmentFilter({ brightness: 1, contrast: 1, saturation: 1 });\n break;\n case \"color-adjustments\":\n // Per-pass instances are created in executePass; no shared cached filter.\n return;\n default:\n filter = new AdjustmentFilter({});\n }\n\n this.filters.set(shaderId, filter);\n }\n\n async submit(commandBuffer: CommandBuffer): Promise<void> {\n if (!this.initialized || !this.app) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n\n for (const { pass } of commandBuffer.passes) {\n await this.executePass(pass);\n }\n }\n\n private async executePass(pass: RenderPass): Promise<void> {\n if (!this.app) return;\n\n const inputTexture = pass.inputs.length > 0 ? this.resources.get(pass.inputs[0]) : null;\n const outputTexture = this.resources.get(pass.output);\n if (!outputTexture) {\n throw new Error(`Output resource not found: ${pass.output}`);\n }\n\n if (pass.shaderId === \"copy\" || pass.shaderId === \"blit-source\") {\n if (inputTexture) {\n this.blitTexture(inputTexture, outputTexture as PIXI.RenderTexture);\n }\n return;\n }\n\n if (!inputTexture) return;\n\n const target = outputTexture as PIXI.RenderTexture;\n const sprite = new PIXI.Sprite(inputTexture);\n sprite.width = target.width;\n sprite.height = target.height;\n\n let filter: PIXI.Filter | PIXI.Filter[];\n let disposeFilter = false;\n\n if (pass.shaderId === \"color-adjustments\") {\n filter = createColorAdjustmentsFilter(normalizeColorAdjustmentsUniforms(pass.uniforms));\n disposeFilter = true;\n } else {\n if (!this.filters.has(pass.shaderId)) {\n this.compileShader(pass.shaderId, \"\");\n }\n const cachedFilter = this.filters.get(pass.shaderId);\n if (!cachedFilter) {\n throw new Error(`Filter not compiled for shader: ${pass.shaderId}`);\n }\n filter = cachedFilter;\n this.applyUniforms(cachedFilter, pass.uniforms, pass.shaderId);\n }\n\n const filterArray = Array.isArray(filter) ? filter : [filter];\n sprite.filters = filterArray;\n this.app.renderer.render({ container: sprite, target, clear: true });\n sprite.filters = null;\n\n if (disposeFilter) {\n if (Array.isArray(filter)) {\n filter.forEach((f) => f.destroy());\n } else {\n filter.destroy();\n }\n }\n }\n\n private applyUniforms(filter: PIXI.Filter, uniforms: Readonly<Record<string, unknown>>, shaderId?: string): void {\n if (shaderId === \"color-adjustments\") {\n updateColorAdjustmentsFilter(filter, normalizeColorAdjustmentsUniforms(uniforms));\n return;\n }\n if (filter instanceof AdjustmentFilter) {\n if (uniforms.brightness !== undefined) {\n filter.brightness = 1.0 + Number(uniforms.brightness);\n }\n if (uniforms.contrast !== undefined) {\n filter.contrast = 1.0 + Number(uniforms.contrast);\n }\n } else if (filter instanceof PIXI.BlurFilter && uniforms.uBlurStrength !== undefined) {\n filter.strength = Number(uniforms.uBlurStrength);\n }\n }\n\n private blitTexture(source: PIXI.Texture, target: PIXI.RenderTexture): void {\n if (!this.app) return;\n const sprite = new PIXI.Sprite(source);\n this.app.renderer.render({ container: sprite, target });\n }\n\n /** Upload a source image into track/source render textures (contain-fit). */\n uploadSourceImage(sourceImage: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, resourceIds: readonly string[]): void {\n if (!this.app) return;\n\n const sourceTexture = PIXI.Texture.from(sourceImage);\n for (const resourceId of resourceIds) {\n const texture = this.resources.get(resourceId);\n if (!texture) continue;\n\n const blitSprite = new PIXI.Sprite(sourceTexture);\n const fitScale = Math.min(texture.width / sourceTexture.width, texture.height / sourceTexture.height);\n blitSprite.scale.set(fitScale);\n blitSprite.position.set((texture.width - sourceTexture.width * fitScale) / 2, (texture.height - sourceTexture.height * fitScale) / 2);\n this.app.renderer.render({ container: blitSprite, target: texture as PIXI.RenderTexture });\n }\n }\n\n /** Present a resource texture to the canvas screen. */\n present(resourceId: string): void {\n if (!this.app) return;\n const texture = this.resources.get(resourceId);\n if (!texture) return;\n\n const screenW = this.app.renderer.screen.width;\n const screenH = this.app.renderer.screen.height;\n const scale = Math.min(screenW / texture.width, screenH / texture.height);\n const sprite = new PIXI.Sprite(texture);\n sprite.scale.set(scale);\n sprite.position.set((screenW - texture.width * scale) / 2, (screenH - texture.height * scale) / 2);\n\n this.app.stage.removeChildren();\n this.app.stage.addChild(sprite);\n this.app.renderer.render(this.app.stage);\n }\n\n getResource(id: string): PIXI.Texture | undefined {\n return this.resources.get(id);\n }\n\n async readPixels(resourceId: string): Promise<Uint8Array> {\n if (!this.initialized || !this.app) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n const texture = this.resources.get(resourceId);\n if (!texture) {\n throw new Error(`Resource \"${resourceId}\" not found for readPixels`);\n }\n const pixels = this.app.renderer.extract.pixels(texture);\n return new Uint8Array(pixels.pixels);\n }\n\n clearResources(): void {\n for (const id of [...this.resources.keys()]) {\n this.releaseResource(id);\n }\n }\n\n destroy(): void {\n if (!this.initialized) return;\n\n for (const texture of this.resources.values()) {\n texture.destroy(true);\n }\n this.resources.clear();\n\n for (const filter of this.filters.values()) {\n filter.destroy();\n }\n this.filters.clear();\n\n if (this.app) {\n this.app.destroy(true);\n this.app = null;\n }\n\n this.initialized = false;\n this.canvasElement = undefined;\n }\n}\n","import { Filter } from 'pixi.js'\nimport type { PixiEffectDefinition, ParamValues } from '../../videoEffects/EffectDefinition'\n\n/** Pixi v8 default filter vertex — required for correct render-to-texture in MPG. */\nconst ADJUSTMENTS_VERTEX_SHADER = `\n in vec2 aPosition;\n out vec2 vTextureCoord;\n\n uniform vec4 uInputSize;\n uniform vec4 uOutputFrame;\n uniform vec4 uOutputTexture;\n\n vec4 filterVertexPosition( void )\n {\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0 * uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n return vec4(position, 0.0, 1.0);\n }\n\n vec2 filterTextureCoord( void )\n {\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n }\n`;\n\nconst ADJUSTMENTS_FRAGMENT_SHADER = `\n in vec2 vTextureCoord;\n out vec4 finalColor;\n\n uniform sampler2D uTexture;\n uniform float uExposure; // -1.0 to 1.0\n uniform float uBrightness; // -1.0 to 1.0\n uniform float uContrast; // -1.0 to 1.0\n uniform float uSaturation; // -1.0 to 1.0\n uniform vec3 uTemperatureColor; // HSL temperature color\n uniform float uTemperatureWeight; // 0.0 to 1.0\n uniform vec3 uTintColor; // tint color\n uniform float uTintWeight; // 0.0 to 1.0\n uniform float uSepia; // 0.0 to 1.0\n uniform float uGrayscale; // 0.0 to 1.0\n uniform float uHueRotate; // Radians (0.0 to 2*PI)\n uniform float uVignette; // 0.0 to 1.0\n uniform float uInvert; // 0.0 to 1.0\n\n vec3 hueRotate(vec3 color, float angle) {\n vec3 k = vec3(0.57735, 0.57735, 0.57735);\n float cosAngle = cos(angle);\n return color * cosAngle + cross(k, color) * sin(angle) + k * dot(k, color) * (1.0 - cosAngle);\n }\n\n void main() {\n vec4 texColor = texture(uTexture, vTextureCoord);\n vec3 rgb = texColor.rgb;\n\n // Invert\n rgb = mix(rgb, 1.0 - rgb, uInvert);\n\n // Exposure\n rgb = rgb * pow(2.0, uExposure);\n\n // Brightness\n rgb = rgb + uBrightness;\n\n // Contrast\n rgb = (rgb - 0.5) * (1.0 + uContrast) + 0.5;\n\n // Saturation\n float luma = dot(rgb, vec3(0.2126, 0.7152, 0.0722));\n rgb = mix(vec3(luma), rgb, 1.0 + uSaturation);\n rgb = mix(rgb, vec3(luma), uGrayscale);\n\n // Sepia\n vec3 sepiaColor = vec3(\n dot(rgb, vec3(0.393, 0.769, 0.189)),\n dot(rgb, vec3(0.349, 0.686, 0.168)),\n dot(rgb, vec3(0.272, 0.534, 0.131))\n );\n rgb = mix(rgb, sepiaColor, uSepia);\n\n // Hue Rotate\n if (uHueRotate != 0.0) {\n rgb = hueRotate(rgb, uHueRotate);\n }\n\n // Temperature soft-light blend\n if (uTemperatureWeight > 0.0) {\n vec3 t = uTemperatureColor;\n rgb = mix(rgb, (1.0 - 2.0 * t) * rgb * rgb + 2.0 * t * rgb, uTemperatureWeight);\n }\n\n // Tint soft-light blend\n if (uTintWeight > 0.0) {\n vec3 t = uTintColor;\n rgb = mix(rgb, (1.0 - 2.0 * t) * rgb * rgb + 2.0 * t * rgb, uTintWeight);\n }\n\n // Vignette\n vec2 uv = vTextureCoord - 0.5;\n float dist = length(uv);\n float vignetteVal = smoothstep(0.45, 1.0, dist);\n rgb = mix(rgb, rgb * 0.0, vignetteVal * uVignette);\n\n finalColor = vec4(rgb, texColor.a);\n }\n`;\n\nexport const ColorAdjustmentsEffect: PixiEffectDefinition = {\n backend: 'pixi',\n subtype: 'filter',\n id: 'color-adjustments',\n name: 'Color Adjustments',\n category: 'light',\n description: 'Adjust exposure, brightness, contrast, saturation, temperature, tint, sepia, grayscale, hue, invert, and vignette.',\n tags: ['color', 'adjustments', 'brightness', 'contrast', 'saturation', 'temperature', 'tint', 'vignette'],\n thumbnail: '',\n params: [\n { key: 'exposure', label: 'Exposure', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'brightness', label: 'Brightness', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'contrast', label: 'Contrast', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'saturation', label: 'Saturation', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'temperature', label: 'Temperature', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'tint', label: 'Tint', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'sepia', label: 'Sepia', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'grayscale', label: 'Grayscale', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'hueRotate', label: 'Hue Rotate', type: 'range', value: 0.0, min: 0.0, max: 6.28318, step: 0.01 },\n { key: 'vignette', label: 'Vignette', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'invert', label: 'Invert', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 }\n ],\n filterSpec: {\n create(params: ParamValues): Filter {\n const tempWeight = Math.abs(params.temperature as number || 0.0)\n const tempColor = (params.temperature as number || 0.0) > 0.0 ? [1.0, 0.55, 0.16] : [0.16, 0.47, 1.0]\n\n const tintWeight = Math.abs(params.tint as number || 0.0)\n const tintColor = (params.tint as number || 0.0) > 0.0 ? [1.0, 0.16, 0.71] : [0.16, 1.0, 0.39]\n\n return Filter.from({\n gl: { vertex: ADJUSTMENTS_VERTEX_SHADER, fragment: ADJUSTMENTS_FRAGMENT_SHADER },\n clipToViewport: false,\n resources: {\n adjustmentsUniforms: {\n uExposure: { value: params.exposure as number || 0.0, type: 'f32' },\n uBrightness: { value: params.brightness as number || 0.0, type: 'f32' },\n uContrast: { value: params.contrast as number || 0.0, type: 'f32' },\n uSaturation: { value: params.saturation as number || 0.0, type: 'f32' },\n uTemperatureColor: { value: tempColor, type: 'vec3<f32>' },\n uTemperatureWeight: { value: tempWeight, type: 'f32' },\n uTintColor: { value: tintColor, type: 'vec3<f32>' },\n uTintWeight: { value: tintWeight, type: 'f32' },\n uSepia: { value: params.sepia as number || 0.0, type: 'f32' },\n uGrayscale: { value: params.grayscale as number || 0.0, type: 'f32' },\n uHueRotate: { value: params.hueRotate as number || 0.0, type: 'f32' },\n uVignette: { value: params.vignette as number || 0.0, type: 'f32' },\n uInvert: { value: params.invert as number || 0.0, type: 'f32' }\n }\n }\n })\n },\n updateUniforms(filter: Filter, params: ParamValues): void {\n type UniformGroup = {\n uniforms?: Record<string, unknown>\n update?: () => void\n }\n const group = (filter as Filter & { resources?: { adjustmentsUniforms?: UniformGroup } }).resources\n ?.adjustmentsUniforms\n const uniforms = group?.uniforms\n if (!uniforms) return\n\n const tempWeight = Math.abs(params.temperature as number || 0.0)\n const tempColor = (params.temperature as number || 0.0) > 0.0 ? [1.0, 0.55, 0.16] : [0.16, 0.47, 1.0]\n\n const tintWeight = Math.abs(params.tint as number || 0.0)\n const tintColor = (params.tint as number || 0.0) > 0.0 ? [1.0, 0.16, 0.71] : [0.16, 1.0, 0.39]\n\n uniforms.uExposure = params.exposure as number || 0.0\n uniforms.uBrightness = params.brightness as number || 0.0\n uniforms.uContrast = params.contrast as number || 0.0\n uniforms.uSaturation = params.saturation as number || 0.0\n uniforms.uTemperatureColor = tempColor\n uniforms.uTemperatureWeight = tempWeight\n uniforms.uTintColor = tintColor\n uniforms.uTintWeight = tintWeight\n uniforms.uSepia = params.sepia as number || 0.0\n uniforms.uGrayscale = params.grayscale as number || 0.0\n uniforms.uHueRotate = params.hueRotate as number || 0.0\n uniforms.uVignette = params.vignette as number || 0.0\n uniforms.uInvert = params.invert as number || 0.0\n group?.update?.()\n }\n }\n}\n","/**\n * V2 MPG — shared Color Adjustments filter factory (used by PixiRenderBackend).\n */\n\nimport type { Filter } from \"pixi.js\";\nimport type { ParamValues } from \"../../videoEffects/EffectDefinition.js\";\nimport { ColorAdjustmentsEffect } from \"../../effects/light/ColorAdjustmentsEffect.js\";\n\nconst spec = ColorAdjustmentsEffect.filterSpec!;\n\nexport function createColorAdjustmentsFilter(params: Record<string, unknown> = {}): Filter | Filter[] {\n return spec.create(params as ParamValues);\n}\n\nexport function updateColorAdjustmentsFilter(filter: Filter, params: Record<string, unknown>): void {\n spec.updateUniforms(filter, params as ParamValues, 0);\n}\n\n/** Normalize partial uniforms into full ColorAdjustments param set */\nexport function normalizeColorAdjustmentsUniforms(uniforms: Readonly<Record<string, unknown>>): Record<string, unknown> {\n return {\n exposure: uniforms.exposure ?? 0,\n brightness: uniforms.brightness ?? 0,\n contrast: uniforms.contrast ?? 0,\n saturation: uniforms.saturation ?? 0,\n temperature: uniforms.temperature ?? 0,\n tint: uniforms.tint ?? 0,\n sepia: uniforms.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,IACzB;AAAA,EACF;AAAA,EAEA,UAAgB;AACd,QAAI,CAAC,KAAK,YAAa;AAEvB,eAAW,WAAW,KAAK,UAAU,OAAO,GAAG;AAC7C,cAAQ,QAAQ,IAAI;AAAA,IACtB;AACA,SAAK,UAAU,MAAM;AAErB,eAAW,UAAU,KAAK,QAAQ,OAAO,GAAG;AAC1C,aAAO,QAAQ;AAAA,IACjB;AACA,SAAK,QAAQ,MAAM;AAEnB,QAAI,KAAK,KAAK;AACZ,WAAK,IAAI,QAAQ,IAAI;AACrB,WAAK,MAAM;AAAA,IACb;AAEA,SAAK,cAAc;AACnB,SAAK,gBAAgB;AAAA,EACvB;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/v2/backends/index.ts","../../../src/v2/backends/PixiRenderBackend.ts","../../../src/effects/light/ColorAdjustmentsEffect.ts","../../../src/v2/backends/colorAdjustmentsFilter.ts"],"sourcesContent":["/**\n * @deprecated Use @clypra/runtime/renderer instead\n * ```ts\n * import { PixiRenderer } from \"@clypra/runtime/renderer\";\n * ```\n * This file will be removed in v3.0.0\n */\nexport { PixiRenderBackend } from \"./PixiRenderBackend.js\";\n","/**\n * @clypra-studio/engine — Pipeline V2: Pixi Render Backend\n *\n * @deprecated Use @clypra/runtime/renderer instead\n * The runtime version (PixiRenderer) is more complete with better resource management.\n * This file will be removed in v3.0.0\n *\n * RenderBackend implementation using Pixi.js for GPU pass execution.\n */\n\nimport * as PIXI from \"pixi.js\";\nimport { AdjustmentFilter } from \"pixi-filters\";\nimport type { RenderBackend, CommandBuffer } from \"../runtime/types\";\nimport type { RenderPass } from \"../planner/types\";\nimport { createColorAdjustmentsFilter, updateColorAdjustmentsFilter, normalizeColorAdjustmentsUniforms } from \"./colorAdjustmentsFilter.js\";\n\nexport class PixiRenderBackend implements RenderBackend {\n private app: PIXI.Application | null = null;\n private initialized = false;\n private resources = new Map<string, PIXI.Texture>();\n private filters = new Map<string, PIXI.Filter>();\n private canvasElement?: HTMLCanvasElement;\n\n async init(canvasElement?: HTMLCanvasElement, width?: number, height?: number): Promise<void> {\n if (this.initialized) {\n throw new Error(\"PixiRenderBackend already initialized\");\n }\n\n this.canvasElement = canvasElement;\n\n const logicalWidth = width ?? canvasElement?.clientWidth ?? canvasElement?.width ?? 1920;\n const logicalHeight = height ?? canvasElement?.clientHeight ?? canvasElement?.height ?? 1080;\n\n this.app = new PIXI.Application();\n await this.app.init({\n canvas: canvasElement,\n width: logicalWidth,\n height: logicalHeight,\n backgroundColor: 0x0e0e12,\n antialias: true,\n preference: \"webgl\",\n resolution: typeof window !== \"undefined\" ? window.devicePixelRatio || 1 : 1,\n autoDensity: true,\n preserveDrawingBuffer: true,\n });\n\n this.initialized = true;\n }\n\n resize(width: number, height: number): void {\n if (!this.app) return;\n this.app.renderer.resize(width, height);\n }\n\n get logicalWidth(): number {\n return this.app?.renderer.width ?? 0;\n }\n\n get logicalHeight(): number {\n return this.app?.renderer.height ?? 0;\n }\n\n allocateResource(id: string, _type: \"texture\" | \"buffer\", width: number, height: number, _format: string): void {\n if (!this.initialized || !this.app) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n if (this.resources.has(id)) {\n throw new Error(`Resource \"${id}\" already allocated`);\n }\n this.resources.set(id, PIXI.RenderTexture.create({ width, height }));\n }\n\n releaseResource(id: string): void {\n if (!this.initialized) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n const texture = this.resources.get(id);\n if (!texture) {\n throw new Error(`Resource \"${id}\" not found for release`);\n }\n texture.destroy(true);\n this.resources.delete(id);\n }\n\n compileShader(shaderId: string, _sourceGLSLOrWGSL: string): void {\n if (!this.initialized) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n\n if (this.filters.has(shaderId)) return;\n\n let filter: PIXI.Filter;\n switch (shaderId) {\n case \"brightness\":\n filter = new AdjustmentFilter({ brightness: 1.0 });\n break;\n case \"contrast\":\n filter = new AdjustmentFilter({ contrast: 1.0 });\n break;\n case \"gaussian-blur-h\":\n case \"gaussian-blur-v\":\n filter = new PIXI.BlurFilter({ strength: 8, quality: 4 });\n break;\n case \"copy\":\n case \"blit-source\":\n filter = new AdjustmentFilter({ brightness: 1, contrast: 1, saturation: 1 });\n break;\n case \"color-adjustments\":\n // Per-pass instances are created in executePass; no shared cached filter.\n return;\n default:\n filter = new AdjustmentFilter({});\n }\n\n this.filters.set(shaderId, filter);\n }\n\n async submit(commandBuffer: CommandBuffer): Promise<void> {\n if (!this.initialized || !this.app) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n\n for (const { pass } of commandBuffer.passes) {\n await this.executePass(pass);\n }\n }\n\n private async executePass(pass: RenderPass): Promise<void> {\n if (!this.app) return;\n\n const inputTexture = pass.inputs.length > 0 ? this.resources.get(pass.inputs[0]) : null;\n const outputTexture = this.resources.get(pass.output);\n if (!outputTexture) {\n throw new Error(`Output resource not found: ${pass.output}`);\n }\n\n if (pass.shaderId === \"copy\" || pass.shaderId === \"blit-source\") {\n if (inputTexture) {\n this.blitTexture(inputTexture, outputTexture as PIXI.RenderTexture);\n }\n return;\n }\n\n if (!inputTexture) return;\n\n const target = outputTexture as PIXI.RenderTexture;\n const sprite = new PIXI.Sprite(inputTexture);\n sprite.width = target.width;\n sprite.height = target.height;\n\n let filter: PIXI.Filter | PIXI.Filter[];\n let disposeFilter = false;\n\n if (pass.shaderId === \"color-adjustments\") {\n filter = createColorAdjustmentsFilter(normalizeColorAdjustmentsUniforms(pass.uniforms));\n disposeFilter = true;\n } else {\n if (!this.filters.has(pass.shaderId)) {\n this.compileShader(pass.shaderId, \"\");\n }\n const cachedFilter = this.filters.get(pass.shaderId);\n if (!cachedFilter) {\n throw new Error(`Filter not compiled for shader: ${pass.shaderId}`);\n }\n filter = cachedFilter;\n this.applyUniforms(cachedFilter, pass.uniforms, pass.shaderId);\n }\n\n const filterArray = Array.isArray(filter) ? filter : [filter];\n sprite.filters = filterArray;\n this.app.renderer.render({ container: sprite, target, clear: true });\n sprite.filters = null;\n\n if (disposeFilter) {\n if (Array.isArray(filter)) {\n filter.forEach((f) => f.destroy());\n } else {\n filter.destroy();\n }\n }\n }\n\n private applyUniforms(filter: PIXI.Filter, uniforms: Readonly<Record<string, unknown>>, shaderId?: string): void {\n if (shaderId === \"color-adjustments\") {\n updateColorAdjustmentsFilter(filter, normalizeColorAdjustmentsUniforms(uniforms));\n return;\n }\n if (filter instanceof AdjustmentFilter) {\n if (uniforms.brightness !== undefined) {\n filter.brightness = 1.0 + Number(uniforms.brightness);\n }\n if (uniforms.contrast !== undefined) {\n filter.contrast = 1.0 + Number(uniforms.contrast);\n }\n } else if (filter instanceof PIXI.BlurFilter && uniforms.uBlurStrength !== undefined) {\n filter.strength = Number(uniforms.uBlurStrength);\n }\n }\n\n private blitTexture(source: PIXI.Texture, target: PIXI.RenderTexture): void {\n if (!this.app) return;\n const sprite = new PIXI.Sprite(source);\n this.app.renderer.render({ container: sprite, target });\n }\n\n /** Upload a source image into track/source render textures (contain-fit). */\n uploadSourceImage(sourceImage: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, resourceIds: readonly string[]): void {\n if (!this.app) return;\n\n const sourceTexture = PIXI.Texture.from(sourceImage);\n for (const resourceId of resourceIds) {\n const texture = this.resources.get(resourceId);\n if (!texture) continue;\n\n const blitSprite = new PIXI.Sprite(sourceTexture);\n const fitScale = Math.min(texture.width / sourceTexture.width, texture.height / sourceTexture.height);\n blitSprite.scale.set(fitScale);\n blitSprite.position.set((texture.width - sourceTexture.width * fitScale) / 2, (texture.height - sourceTexture.height * fitScale) / 2);\n this.app.renderer.render({ container: blitSprite, target: texture as PIXI.RenderTexture });\n }\n }\n\n /** Present a resource texture to the canvas screen. */\n present(resourceId: string): void {\n if (!this.app) return;\n const texture = this.resources.get(resourceId);\n if (!texture) return;\n\n const screenW = this.app.renderer.screen.width;\n const screenH = this.app.renderer.screen.height;\n const scale = Math.min(screenW / texture.width, screenH / texture.height);\n const sprite = new PIXI.Sprite(texture);\n sprite.scale.set(scale);\n sprite.position.set((screenW - texture.width * scale) / 2, (screenH - texture.height * scale) / 2);\n\n this.app.stage.removeChildren();\n this.app.stage.addChild(sprite);\n this.app.renderer.render(this.app.stage);\n }\n\n getResource(id: string): PIXI.Texture | undefined {\n return this.resources.get(id);\n }\n\n async readPixels(resourceId: string): Promise<Uint8Array> {\n if (!this.initialized || !this.app) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n const texture = this.resources.get(resourceId);\n if (!texture) {\n throw new Error(`Resource \"${resourceId}\" not found for readPixels`);\n }\n const pixels = this.app.renderer.extract.pixels(texture);\n return new Uint8Array(pixels.pixels);\n }\n\n clearResources(): void {\n for (const id of [...this.resources.keys()]) {\n this.releaseResource(id);\n }\n }\n\n destroy(): void {\n if (!this.initialized) return;\n\n for (const texture of this.resources.values()) {\n texture.destroy(true);\n }\n this.resources.clear();\n\n for (const filter of this.filters.values()) {\n filter.destroy();\n }\n this.filters.clear();\n\n if (this.app) {\n this.app.destroy(true);\n this.app = null;\n }\n\n this.initialized = false;\n this.canvasElement = undefined;\n }\n}\n","import { Filter } from 'pixi.js'\nimport type { PixiEffectDefinition, ParamValues } from '../../videoEffects/EffectDefinition'\n\n/** Pixi v8 default filter vertex — required for correct render-to-texture in MPG. */\nconst ADJUSTMENTS_VERTEX_SHADER = `\n in vec2 aPosition;\n out vec2 vTextureCoord;\n\n uniform vec4 uInputSize;\n uniform vec4 uOutputFrame;\n uniform vec4 uOutputTexture;\n\n vec4 filterVertexPosition( void )\n {\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0 * uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n return vec4(position, 0.0, 1.0);\n }\n\n vec2 filterTextureCoord( void )\n {\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n }\n`;\n\nconst ADJUSTMENTS_FRAGMENT_SHADER = `\n in vec2 vTextureCoord;\n out vec4 finalColor;\n\n uniform sampler2D uTexture;\n\n // ── Existing uniforms ─────────────────────────────────────────────────────\n uniform float uExposure; // -1.0 to 1.0\n uniform float uBrightness; // -1.0 to 1.0\n uniform float uContrast; // -1.0 to 1.0\n uniform float uSaturation; // -1.0 to 1.0\n uniform vec3 uTemperatureColor; // warm or cool color\n uniform float uTemperatureWeight; // 0.0 to 1.0\n uniform vec3 uTintColor; // magenta or green color\n uniform float uTintWeight; // 0.0 to 1.0\n uniform float uSepia; // 0.0 to 1.0\n uniform float uGrayscale; // 0.0 to 1.0\n uniform float uHueRotate; // radians\n uniform float uVignette; // 0.0 to 1.0\n uniform float uInvert; // 0.0 to 1.0\n\n // ── NEW: Lift ─────────────────────────────────────────────────────────────\n uniform float uLift; // -0.2 to 0.2; positive = faded/matte, negative = crushed\n\n // ── NEW: Split-toning ─────────────────────────────────────────────────────\n uniform vec3 uShadowTint; // multiplicative color for shadows (neutral = vec3(1))\n uniform float uShadowTintStrength;\n uniform vec3 uHighlightTint; // multiplicative color for highlights (neutral = vec3(1))\n uniform float uHighlightTintStrength;\n uniform float uSplitBalance; // 0.0-1.0, luma split point\n\n // ── NEW: Film grain ───────────────────────────────────────────────────────\n uniform float uGrainIntensity; // 0.0 to 0.5\n uniform float uGrainSize; // 0.1 to 5.0\n uniform float uTime; // animated, incremented each frame\n\n // ── NEW: Channel-mix B&W ──────────────────────────────────────────────────\n uniform vec3 uChannelMix; // R/G/B weights summing to ~1.0\n uniform float uUseChannelMix; // 1.0 = active, 0.0 = off\n\n // ── NEW: Duotone ──────────────────────────────────────────────────────────\n uniform vec3 uDuotoneDark; // color mapped to black/dark tones\n uniform vec3 uDuotoneLight; // color mapped to white/light tones\n uniform float uUseDuotone; // 1.0 = active, 0.0 = off\n\n // ── NEW: Vibrance ─────────────────────────────────────────────────────────\n uniform float uVibranceAmount; // -1.0 to 1.0\n uniform vec3 uVibranceProtectedHue; // reference color for skin-tone protection\n\n // ── NEW: Cross-process ────────────────────────────────────────────────────\n uniform float uCrossProcessAmount; // 0.0 to 1.0\n\n // ── Helper functions ──────────────────────────────────────────────────────\n vec3 hueRotateColor(vec3 color, float angle) {\n vec3 k = vec3(0.57735, 0.57735, 0.57735);\n float c = cos(angle);\n return color * c + cross(k, color) * sin(angle) + k * dot(k, color) * (1.0 - c);\n }\n\n vec3 rgb2hsv(vec3 c) {\n vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\n vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\n float d = q.x - min(q.w, q.y);\n float e = 1.0e-10;\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\n }\n\n vec3 hsv2rgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n }\n\n void main() {\n vec4 texColor = texture(uTexture, vTextureCoord);\n vec3 rgb = texColor.rgb;\n\n // Invert\n rgb = mix(rgb, 1.0 - rgb, uInvert);\n\n // Exposure\n rgb = rgb * pow(2.0, uExposure);\n\n // Brightness\n rgb = rgb + uBrightness;\n\n // Lift — shift black point; applied before contrast so it interacts correctly with tonal range\n if (uLift != 0.0) {\n rgb = rgb + uLift * (1.0 - rgb);\n }\n\n // Contrast\n rgb = (rgb - 0.5) * (1.0 + uContrast) + 0.5;\n\n // Saturation (flat, distinct from vibrance)\n float luma = dot(rgb, vec3(0.2126, 0.7152, 0.0722));\n rgb = mix(vec3(luma), rgb, 1.0 + uSaturation);\n\n // Grayscale\n float lumaG = dot(rgb, vec3(0.2126, 0.7152, 0.0722));\n rgb = mix(rgb, vec3(lumaG), uGrayscale);\n\n // Sepia\n if (uSepia > 0.0) {\n vec3 sep = vec3(\n dot(rgb, vec3(0.393, 0.769, 0.189)),\n dot(rgb, vec3(0.349, 0.686, 0.168)),\n dot(rgb, vec3(0.272, 0.534, 0.131))\n );\n rgb = mix(rgb, sep, uSepia);\n }\n\n // Hue Rotate\n if (uHueRotate != 0.0) {\n rgb = hueRotateColor(rgb, uHueRotate);\n }\n\n // Temperature — soft-light blend\n if (uTemperatureWeight > 0.0) {\n vec3 t = uTemperatureColor;\n rgb = mix(rgb, (1.0 - 2.0 * t) * rgb * rgb + 2.0 * t * rgb, uTemperatureWeight);\n }\n\n // Tint — soft-light blend\n if (uTintWeight > 0.0) {\n vec3 t = uTintColor;\n rgb = mix(rgb, (1.0 - 2.0 * t) * rgb * rgb + 2.0 * t * rgb, uTintWeight);\n }\n\n // ── NEW: Channel-mixed B&W ─────────────────────────────────────────────\n // Applied before duotone; mutually exclusive (both produce mono, duotone adds color back)\n if (uUseChannelMix > 0.5) {\n float mono = dot(rgb, uChannelMix);\n rgb = vec3(mono);\n }\n\n // ── NEW: Duotone ───────────────────────────────────────────────────────\n // Maps current luminance to a 2-color gradient; applied after channel-mix for correct mono base\n if (uUseDuotone > 0.5) {\n float duoLuma = dot(rgb, vec3(0.299, 0.587, 0.114));\n rgb = mix(uDuotoneDark, uDuotoneLight, duoLuma);\n }\n\n // ── NEW: Split-toning ──────────────────────────────────────────────────\n if (uShadowTintStrength > 0.0 || uHighlightTintStrength > 0.0) {\n float splitLuma = dot(rgb, vec3(0.299, 0.587, 0.114));\n float shadowW = 1.0 - smoothstep(0.0, uSplitBalance, splitLuma);\n float highlightW = smoothstep(uSplitBalance, 1.0, splitLuma);\n rgb = mix(rgb, rgb * uShadowTint, shadowW * uShadowTintStrength);\n rgb = mix(rgb, rgb * uHighlightTint, highlightW * uHighlightTintStrength);\n }\n\n // ── NEW: Vibrance — hue-selective saturation ───────────────────────────\n // Skipped when channel-mix or duotone have flattened color information\n if (uVibranceAmount != 0.0 && uUseChannelMix < 0.5 && uUseDuotone < 0.5) {\n vec3 hsv = rgb2hsv(clamp(rgb, 0.0, 1.0));\n vec3 protHSV = rgb2hsv(uVibranceProtectedHue);\n float hueDist = abs(hsv.x - protHSV.x);\n hueDist = min(hueDist, 1.0 - hueDist); // wrap hue distance\n float protection = smoothstep(0.0, 0.15, hueDist);\n hsv.y = clamp(hsv.y + uVibranceAmount * protection, 0.0, 1.0);\n rgb = hsv2rgb(hsv);\n }\n\n // ── NEW: Cross-process — channel curve swap ────────────────────────────\n if (uCrossProcessAmount > 0.0) {\n float origR = rgb.r;\n float origB = rgb.b;\n rgb.r = mix(rgb.r, pow(max(origB, 0.001), 0.8), uCrossProcessAmount);\n rgb.b = mix(rgb.b, pow(max(origR, 0.001), 1.2), uCrossProcessAmount);\n }\n\n // ── NEW: Film grain — last before vignette ────────────────────────────\n if (uGrainIntensity > 0.0) {\n float grain = fract(sin(dot(vTextureCoord * uGrainSize + uTime, vec2(12.9898, 78.233))) * 43758.5453);\n rgb += (grain - 0.5) * uGrainIntensity;\n }\n\n // Vignette\n vec2 uv = vTextureCoord - 0.5;\n float vignetteVal = smoothstep(0.45, 1.0, length(uv));\n rgb = mix(rgb, vec3(0.0), vignetteVal * uVignette);\n\n finalColor = vec4(rgb, texColor.a);\n }\n`;\n\n/** Convert a hex color string (#RRGGBB) to a normalized [r, g, b] array. */\nexport function hexToRgb(hex: string): [number, number, number] {\n const clean = hex.replace('#', '').padEnd(6, '0')\n const r = parseInt(clean.substring(0, 2), 16) / 255\n const g = parseInt(clean.substring(2, 4), 16) / 255\n const b = parseInt(clean.substring(4, 6), 16) / 255\n return [isNaN(r) ? 1 : r, isNaN(g) ? 1 : g, isNaN(b) ? 1 : b]\n}\n\nexport const ColorAdjustmentsEffect: PixiEffectDefinition = {\n backend: 'pixi',\n subtype: 'filter',\n id: 'color-adjustments',\n name: 'Color Adjustments',\n category: 'light',\n description: 'Adjust exposure, brightness, contrast, saturation, temperature, tint, sepia, grayscale, hue, invert, vignette, lift, split-toning, grain, channel-mix, duotone, vibrance, and cross-process.',\n tags: ['color', 'adjustments', 'brightness', 'contrast', 'saturation', 'temperature', 'tint', 'vignette', 'grain', 'duotone', 'vibrance'],\n thumbnail: '',\n params: [\n // ── Existing ───────────────────────────────────────────────────────────\n { key: 'exposure', label: 'Exposure', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'brightness', label: 'Brightness', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'contrast', label: 'Contrast', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'saturation', label: 'Saturation', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'temperature', label: 'Temperature', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'tint', label: 'Tint', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'sepia', label: 'Sepia', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'grayscale', label: 'Grayscale', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'hueRotate', label: 'Hue Rotate', type: 'range', value: 0.0, min: 0.0, max: 6.28318, step: 0.01 },\n { key: 'vignette', label: 'Vignette', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'invert', label: 'Invert', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n // ── NEW ────────────────────────────────────────────────────────────────\n { key: 'lift', label: 'Lift', type: 'range', value: 0.0, min: -0.5, max: 0.5, step: 0.01 },\n { key: 'shadowTintR', label: 'Shadow Tint R', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'shadowTintG', label: 'Shadow Tint G', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'shadowTintB', label: 'Shadow Tint B', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'shadowTintStrength', label: 'Shadow Strength', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'highlightTintR', label: 'Hi Tint R', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'highlightTintG', label: 'Hi Tint G', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'highlightTintB', label: 'Hi Tint B', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'highlightTintStrength', label: 'Hi Strength', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'splitBalance', label: 'Split Balance', type: 'range', value: 0.5, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'grainIntensity', label: 'Grain Intensity', type: 'range', value: 0.0, min: 0.0, max: 0.5, step: 0.01 },\n { key: 'grainSize', label: 'Grain Size', type: 'range', value: 1.0, min: 0.1, max: 5.0, step: 0.1 },\n { key: 'channelMixR', label: 'Channel Mix R', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'channelMixG', label: 'Channel Mix G', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'channelMixB', label: 'Channel Mix B', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'useChannelMix', label: 'Use Channel Mix', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 1.0 },\n { key: 'duotoneDarkR', label: 'Duo Dark R', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneDarkG', label: 'Duo Dark G', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneDarkB', label: 'Duo Dark B', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneLightR', label: 'Duo Light R', type: 'range', value: 1.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneLightG', label: 'Duo Light G', type: 'range', value: 1.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneLightB', label: 'Duo Light B', type: 'range', value: 1.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'useDuotone', label: 'Use Duotone', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 1.0 },\n { key: 'vibranceAmount', label: 'Vibrance', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'vibranceProtectedHueR', label: 'Vib Protect R', type: 'range', value: 0.91, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'vibranceProtectedHueG', label: 'Vib Protect G', type: 'range', value: 0.69, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'vibranceProtectedHueB', label: 'Vib Protect B', type: 'range', value: 0.55, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'crossProcessAmount', label: 'Cross Process', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n ],\n filterSpec: {\n create(params: ParamValues): Filter {\n const temperature = params.temperature as number || 0.0\n const tempWeight = Math.abs(temperature)\n const tempColor = temperature > 0.0 ? [1.0, 0.55, 0.16] : [0.16, 0.47, 1.0]\n const tint = params.tint as number || 0.0\n const tintWeight = Math.abs(tint)\n const tintColor = tint > 0.0 ? [1.0, 0.16, 0.71] : [0.16, 1.0, 0.39]\n\n return Filter.from({\n gl: { vertex: ADJUSTMENTS_VERTEX_SHADER, fragment: ADJUSTMENTS_FRAGMENT_SHADER },\n clipToViewport: false,\n resources: {\n adjustmentsUniforms: {\n // ── Existing ──────────────────────────────────────────────────\n uExposure: { value: params.exposure as number || 0.0, type: 'f32' },\n uBrightness: { value: params.brightness as number || 0.0, type: 'f32' },\n uContrast: { value: params.contrast as number || 0.0, type: 'f32' },\n uSaturation: { value: params.saturation as number || 0.0, type: 'f32' },\n uTemperatureColor: { value: tempColor, type: 'vec3<f32>' },\n uTemperatureWeight: { value: tempWeight, type: 'f32' },\n uTintColor: { value: tintColor, type: 'vec3<f32>' },\n uTintWeight: { value: tintWeight, type: 'f32' },\n uSepia: { value: params.sepia as number || 0.0, type: 'f32' },\n uGrayscale: { value: params.grayscale as number || 0.0, type: 'f32' },\n uHueRotate: { value: params.hueRotate as number || 0.0, type: 'f32' },\n uVignette: { value: params.vignette as number || 0.0, type: 'f32' },\n uInvert: { value: params.invert as number || 0.0, type: 'f32' },\n // ── NEW ───────────────────────────────────────────────────────\n uLift: { value: params.lift as number || 0.0, type: 'f32' },\n uShadowTint: { value: [params.shadowTintR ?? 1.0, params.shadowTintG ?? 1.0, params.shadowTintB ?? 1.0], type: 'vec3<f32>' },\n uShadowTintStrength: { value: params.shadowTintStrength as number || 0.0, type: 'f32' },\n uHighlightTint: { value: [params.highlightTintR ?? 1.0, params.highlightTintG ?? 1.0, params.highlightTintB ?? 1.0], type: 'vec3<f32>' },\n uHighlightTintStrength: { value: params.highlightTintStrength as number|| 0.0, type: 'f32' },\n uSplitBalance: { value: params.splitBalance as number ?? 0.5, type: 'f32' },\n uGrainIntensity: { value: params.grainIntensity as number || 0.0, type: 'f32' },\n uGrainSize: { value: params.grainSize as number ?? 1.0, type: 'f32' },\n uTime: { value: 0.0, type: 'f32' },\n uChannelMix: { value: [params.channelMixR ?? 0.0, params.channelMixG ?? 0.0, params.channelMixB ?? 0.0], type: 'vec3<f32>' },\n uUseChannelMix: { value: params.useChannelMix as number || 0.0, type: 'f32' },\n uDuotoneDark: { value: [params.duotoneDarkR ?? 0.0, params.duotoneDarkG ?? 0.0, params.duotoneDarkB ?? 0.0], type: 'vec3<f32>' },\n uDuotoneLight: { value: [params.duotoneLightR ?? 1.0, params.duotoneLightG ?? 1.0, params.duotoneLightB ?? 1.0], type: 'vec3<f32>' },\n uUseDuotone: { value: params.useDuotone as number || 0.0, type: 'f32' },\n uVibranceAmount: { value: params.vibranceAmount as number || 0.0, type: 'f32' },\n uVibranceProtectedHue: { value: [params.vibranceProtectedHueR ?? 0.91, params.vibranceProtectedHueG ?? 0.69, params.vibranceProtectedHueB ?? 0.55], type: 'vec3<f32>' },\n uCrossProcessAmount: { value: params.crossProcessAmount as number || 0.0, type: 'f32' },\n }\n }\n })\n },\n\n updateUniforms(filter: Filter, params: ParamValues): void {\n type UniformGroup = { uniforms?: Record<string, unknown>; update?: () => void }\n const group = (filter as Filter & { resources?: { adjustmentsUniforms?: UniformGroup } }).resources?.adjustmentsUniforms\n const uniforms = group?.uniforms\n if (!uniforms) return\n\n const temperature = params.temperature as number || 0.0\n const tempWeight = Math.abs(temperature)\n const tempColor = temperature > 0.0 ? [1.0, 0.55, 0.16] : [0.16, 0.47, 1.0]\n const tint = params.tint as number || 0.0\n const tintWeight = Math.abs(tint)\n const tintColor = tint > 0.0 ? [1.0, 0.16, 0.71] : [0.16, 1.0, 0.39]\n\n // ── Existing ────────────────────────────────────────────────────────\n uniforms.uExposure = params.exposure as number || 0.0\n uniforms.uBrightness = params.brightness as number || 0.0\n uniforms.uContrast = params.contrast as number || 0.0\n uniforms.uSaturation = params.saturation as number || 0.0\n uniforms.uTemperatureColor = tempColor\n uniforms.uTemperatureWeight = tempWeight\n uniforms.uTintColor = tintColor\n uniforms.uTintWeight = tintWeight\n uniforms.uSepia = params.sepia as number || 0.0\n uniforms.uGrayscale = params.grayscale as number || 0.0\n uniforms.uHueRotate = params.hueRotate as number || 0.0\n uniforms.uVignette = params.vignette as number || 0.0\n uniforms.uInvert = params.invert as number || 0.0\n // ── NEW ──────────────────────────────────────────────────────────\n uniforms.uLift = params.lift as number || 0.0\n uniforms.uShadowTint = [params.shadowTintR ?? 1.0, params.shadowTintG ?? 1.0, params.shadowTintB ?? 1.0]\n uniforms.uShadowTintStrength = params.shadowTintStrength as number || 0.0\n uniforms.uHighlightTint = [params.highlightTintR ?? 1.0, params.highlightTintG ?? 1.0, params.highlightTintB ?? 1.0]\n uniforms.uHighlightTintStrength = params.highlightTintStrength as number || 0.0\n uniforms.uSplitBalance = params.splitBalance as number ?? 0.5\n uniforms.uGrainIntensity = params.grainIntensity as number || 0.0\n uniforms.uGrainSize = params.grainSize as number ?? 1.0\n uniforms.uTime = ((uniforms.uTime as number || 0.0) + 0.016) % 100.0\n uniforms.uChannelMix = [params.channelMixR ?? 0.0, params.channelMixG ?? 0.0, params.channelMixB ?? 0.0]\n uniforms.uUseChannelMix = params.useChannelMix as number || 0.0\n uniforms.uDuotoneDark = [params.duotoneDarkR ?? 0.0, params.duotoneDarkG ?? 0.0, params.duotoneDarkB ?? 0.0]\n uniforms.uDuotoneLight = [params.duotoneLightR ?? 1.0, params.duotoneLightG ?? 1.0, params.duotoneLightB ?? 1.0]\n uniforms.uUseDuotone = params.useDuotone as number || 0.0\n uniforms.uVibranceAmount = params.vibranceAmount as number || 0.0\n uniforms.uVibranceProtectedHue = [params.vibranceProtectedHueR ?? 0.91, params.vibranceProtectedHueG ?? 0.69, params.vibranceProtectedHueB ?? 0.55]\n uniforms.uCrossProcessAmount = params.crossProcessAmount as number || 0.0\n group?.update?.()\n }\n }\n}\n","/**\n * V2 MPG — shared Color Adjustments filter factory (used by PixiRenderBackend).\n */\n\nimport type { Filter } from \"pixi.js\";\nimport type { ParamValues } from \"../../videoEffects/EffectDefinition.js\";\nimport { ColorAdjustmentsEffect } from \"../../effects/light/ColorAdjustmentsEffect.js\";\n\nconst spec = ColorAdjustmentsEffect.filterSpec!;\n\nexport function createColorAdjustmentsFilter(params: Record<string, unknown> = {}): Filter | Filter[] {\n return spec.create(params as ParamValues);\n}\n\nexport function updateColorAdjustmentsFilter(filter: Filter, params: Record<string, unknown>): void {\n spec.updateUniforms(filter, params as ParamValues, 0);\n}\n\n/** Normalize partial uniforms into full ColorAdjustments param set */\nexport function normalizeColorAdjustmentsUniforms(uniforms: Readonly<Record<string, unknown>>): Record<string, unknown> {\n return {\n // ── Existing ────────────────────────────────────────────────────────────\n exposure: uniforms.exposure ?? 0,\n brightness: uniforms.brightness ?? 0,\n contrast: uniforms.contrast ?? 0,\n saturation: uniforms.saturation ?? 0,\n temperature: uniforms.temperature ?? 0,\n tint: uniforms.tint ?? 0,\n sepia: uniforms.sepia ?? 0,\n grayscale: uniforms.grayscale ?? 0,\n hueRotate: uniforms.hueRotate ?? 0,\n vignette: uniforms.vignette ?? 0,\n invert: uniforms.invert ?? 0,\n // ── NEW: Lift ────────────────────────────────────────────────────────────\n lift: uniforms.lift ?? 0,\n // ── NEW: Split-toning ────────────────────────────────────────────────────\n shadowTintR: uniforms.shadowTintR ?? 1.0,\n shadowTintG: uniforms.shadowTintG ?? 1.0,\n shadowTintB: uniforms.shadowTintB ?? 1.0,\n shadowTintStrength: uniforms.shadowTintStrength ?? 0,\n highlightTintR: uniforms.highlightTintR ?? 1.0,\n highlightTintG: uniforms.highlightTintG ?? 1.0,\n highlightTintB: uniforms.highlightTintB ?? 1.0,\n highlightTintStrength: uniforms.highlightTintStrength ?? 0,\n splitBalance: uniforms.splitBalance ?? 0.5,\n // ── NEW: Film grain ──────────────────────────────────────────────────────\n grainIntensity: uniforms.grainIntensity ?? 0,\n grainSize: uniforms.grainSize ?? 1.0,\n // ── NEW: Channel-mix B&W ─────────────────────────────────────────────────\n channelMixR: uniforms.channelMixR ?? 0,\n channelMixG: uniforms.channelMixG ?? 0,\n channelMixB: uniforms.channelMixB ?? 0,\n useChannelMix: uniforms.useChannelMix ?? 0,\n // ── NEW: Duotone ─────────────────────────────────────────────────────────\n duotoneDarkR: uniforms.duotoneDarkR ?? 0,\n duotoneDarkG: uniforms.duotoneDarkG ?? 0,\n duotoneDarkB: uniforms.duotoneDarkB ?? 0,\n duotoneLightR: uniforms.duotoneLightR ?? 1.0,\n duotoneLightG: uniforms.duotoneLightG ?? 1.0,\n duotoneLightB: uniforms.duotoneLightB ?? 1.0,\n useDuotone: uniforms.useDuotone ?? 0,\n // ── NEW: Vibrance ────────────────────────────────────────────────────────\n vibranceAmount: uniforms.vibranceAmount ?? 0,\n vibranceProtectedHueR: uniforms.vibranceProtectedHueR ?? 0.91,\n vibranceProtectedHueG: uniforms.vibranceProtectedHueG ?? 0.69,\n vibranceProtectedHueB: uniforms.vibranceProtectedHueB ?? 0.55,\n // ── NEW: Cross-process ───────────────────────────────────────────────────\n crossProcessAmount: uniforms.crossProcessAmount ?? 0,\n };\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACUA,WAAsB;AACtB,0BAAiC;;;ACXjC,kBAAuB;AAIvB,IAAM,4BAA4B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BlC,IAAM,8BAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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F;","names":[]}
@@ -1,3 +1,3 @@
1
- export { P as PixiRenderBackend } from '../../index-BWo6qV_z.cjs';
1
+ export { P as PixiRenderBackend } from '../../index-Da47I6aX.cjs';
2
2
  import 'pixi.js';
3
3
  import '@clypra-studio/types';
@@ -1,3 +1,3 @@
1
- export { P as PixiRenderBackend } from '../../index-BWo6qV_z.js';
1
+ export { P as PixiRenderBackend } from '../../index-Da47I6aX.js';
2
2
  import 'pixi.js';
3
3
  import '@clypra-studio/types';