@clypra-studio/engine 0.1.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/TransitionDefinition-CC6oSTYB.d.cts +158 -0
- package/dist/TransitionDefinition-CC6oSTYB.d.ts +158 -0
- package/dist/chunk-4Y7ZSGHJ.js +2990 -0
- package/dist/chunk-4Y7ZSGHJ.js.map +1 -0
- package/dist/chunk-AUMNXFYQ.js +667 -0
- package/dist/chunk-AUMNXFYQ.js.map +1 -0
- package/dist/{chunk-CJRH4PAV.js → chunk-LGW5SSLZ.js} +292 -61
- package/dist/chunk-LGW5SSLZ.js.map +1 -0
- package/dist/{chunk-EVQAI3P3.js → chunk-S24UVNPZ.js} +5 -1
- package/dist/{chunk-EVQAI3P3.js.map → chunk-S24UVNPZ.js.map} +1 -1
- package/dist/{index-BWo6qV_z.d.cts → index-BP1N8Yg7.d.cts} +2 -2
- package/dist/{index-BWo6qV_z.d.ts → index-BP1N8Yg7.d.ts} +2 -2
- package/dist/index.cjs +3882 -1366
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +428 -3798
- package/dist/index.d.ts +428 -3798
- package/dist/index.js +1373 -1498
- package/dist/index.js.map +1 -1
- package/dist/textEffects/index.cjs.map +1 -1
- package/dist/textEffects/index.js +1 -1
- package/dist/transitions/index.cjs +2207 -3
- package/dist/transitions/index.cjs.map +1 -1
- package/dist/transitions/index.d.cts +54 -5
- package/dist/transitions/index.d.ts +54 -5
- package/dist/transitions/index.js +53 -3
- package/dist/v2/backends/index.cjs +246 -33
- package/dist/v2/backends/index.cjs.map +1 -1
- package/dist/v2/backends/index.d.cts +1 -1
- package/dist/v2/backends/index.d.ts +1 -1
- package/dist/v2/backends/index.js +1 -1
- package/dist/videoEffects/index.cjs +287 -62
- package/dist/videoEffects/index.cjs.map +1 -1
- package/dist/videoEffects/index.d.cts +31 -134
- package/dist/videoEffects/index.d.ts +31 -134
- package/dist/videoEffects/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-5JOAEDIQ.js +0 -446
- package/dist/chunk-5JOAEDIQ.js.map +0 -1
- package/dist/chunk-CJRH4PAV.js.map +0 -1
- package/dist/chunk-QMRMNH52.js +0 -811
- package/dist/chunk-QMRMNH52.js.map +0 -1
|
@@ -1,3 +1,55 @@
|
|
|
1
|
+
import { i as TransitionDefinition } from '../TransitionDefinition-CC6oSTYB.cjs';
|
|
2
|
+
import 'pixi.js';
|
|
3
|
+
|
|
4
|
+
declare const PushTransition: TransitionDefinition;
|
|
5
|
+
|
|
6
|
+
declare const IrisRevealTransition: TransitionDefinition;
|
|
7
|
+
|
|
8
|
+
declare const FoldTurnTransition: TransitionDefinition;
|
|
9
|
+
|
|
10
|
+
declare const ZoomTransition: TransitionDefinition;
|
|
11
|
+
|
|
12
|
+
declare const ChromaticPushTransition: TransitionDefinition;
|
|
13
|
+
|
|
14
|
+
declare const RefractionWarpTransition: TransitionDefinition;
|
|
15
|
+
|
|
16
|
+
declare const GlitchTransition: TransitionDefinition;
|
|
17
|
+
|
|
18
|
+
declare const StrobeCutTransition: TransitionDefinition;
|
|
19
|
+
|
|
20
|
+
declare const FrameHoldStutterTransition: TransitionDefinition;
|
|
21
|
+
|
|
22
|
+
declare const CrossDissolveTransition: TransitionDefinition;
|
|
23
|
+
|
|
24
|
+
declare const DirectionalDissolveTransition: TransitionDefinition;
|
|
25
|
+
|
|
26
|
+
declare const PixelateCollapseTransition: TransitionDefinition;
|
|
27
|
+
|
|
28
|
+
declare const LumaWipeTransition: TransitionDefinition;
|
|
29
|
+
|
|
30
|
+
declare const LightLeakSweepTransition: TransitionDefinition;
|
|
31
|
+
|
|
32
|
+
declare const FilmBurnWipeTransition: TransitionDefinition;
|
|
33
|
+
|
|
34
|
+
declare const DepthPushTransition: TransitionDefinition;
|
|
35
|
+
|
|
36
|
+
declare const RackFocusBlendTransition: TransitionDefinition;
|
|
37
|
+
|
|
38
|
+
declare const ParallaxLayerSplitTransition: TransitionDefinition;
|
|
39
|
+
|
|
40
|
+
declare const ShatterBurstTransition: TransitionDefinition;
|
|
41
|
+
|
|
42
|
+
declare const ElasticSnapCutTransition: TransitionDefinition;
|
|
43
|
+
|
|
44
|
+
declare const GravityDropTransition: TransitionDefinition;
|
|
45
|
+
|
|
46
|
+
declare const ALL_TRANSITIONS: TransitionDefinition[];
|
|
47
|
+
declare const transitionEffects: TransitionDefinition[];
|
|
48
|
+
declare const transitionEffectsById: {
|
|
49
|
+
[k: string]: TransitionDefinition;
|
|
50
|
+
};
|
|
51
|
+
declare function getTransitionEffect(id: string): TransitionDefinition;
|
|
52
|
+
|
|
1
53
|
/**
|
|
2
54
|
* Transition Types
|
|
3
55
|
* Type definitions for transition effects between video clips
|
|
@@ -26,6 +78,7 @@ interface TransitionPreset {
|
|
|
26
78
|
description: string;
|
|
27
79
|
tags: string[];
|
|
28
80
|
defaultDuration: number;
|
|
81
|
+
defaultDurationMs: number;
|
|
29
82
|
durationConstraints?: {
|
|
30
83
|
min: number;
|
|
31
84
|
max: number;
|
|
@@ -113,10 +166,6 @@ declare class TransitionRenderer {
|
|
|
113
166
|
*/
|
|
114
167
|
|
|
115
168
|
declare const TRANSITION_CATEGORIES: TransitionCategory[];
|
|
116
|
-
/**
|
|
117
|
-
* Professional Transition Preset Library
|
|
118
|
-
* Maps UI-friendly presets to engine TransitionRenderer types
|
|
119
|
-
*/
|
|
120
169
|
declare const TRANSITION_PRESETS: TransitionPreset[];
|
|
121
170
|
|
|
122
171
|
/**
|
|
@@ -167,4 +216,4 @@ declare function getTransitionsByTags(tags: string[]): TransitionPreset[];
|
|
|
167
216
|
*/
|
|
168
217
|
declare function getRecommendedDuration(presetId: string): number;
|
|
169
218
|
|
|
170
|
-
export { type AppliedTransition, type EasingFunction, TRANSITION_CATEGORIES, TRANSITION_PRESETS, type TransitionCategory, type TransitionParameters, type TransitionPreset, TransitionRenderer, type TransitionRenderer$1 as TransitionRendererType, getAllTransitionTags, getAllTransitions, getRecommendedDuration, getTransitionById, getTransitionByRenderer, getTransitionCategories, getTransitionCountByCategory, getTransitionsByCategory, getTransitionsByTags, searchTransitions };
|
|
219
|
+
export { ALL_TRANSITIONS, type AppliedTransition, ChromaticPushTransition, CrossDissolveTransition, DepthPushTransition, DirectionalDissolveTransition, type EasingFunction, ElasticSnapCutTransition, FilmBurnWipeTransition, FoldTurnTransition, FrameHoldStutterTransition, GlitchTransition, GravityDropTransition, IrisRevealTransition, LightLeakSweepTransition, LumaWipeTransition, ParallaxLayerSplitTransition, PixelateCollapseTransition, PushTransition, RackFocusBlendTransition, RefractionWarpTransition, ShatterBurstTransition, StrobeCutTransition, TRANSITION_CATEGORIES, TRANSITION_PRESETS, type TransitionCategory, type TransitionParameters, type TransitionPreset, TransitionRenderer, type TransitionRenderer$1 as TransitionRendererType, ZoomTransition, getAllTransitionTags, getAllTransitions, getRecommendedDuration, getTransitionById, getTransitionByRenderer, getTransitionCategories, getTransitionCountByCategory, getTransitionEffect, getTransitionsByCategory, getTransitionsByTags, searchTransitions, transitionEffects, transitionEffectsById };
|
|
@@ -1,3 +1,55 @@
|
|
|
1
|
+
import { i as TransitionDefinition } from '../TransitionDefinition-CC6oSTYB.js';
|
|
2
|
+
import 'pixi.js';
|
|
3
|
+
|
|
4
|
+
declare const PushTransition: TransitionDefinition;
|
|
5
|
+
|
|
6
|
+
declare const IrisRevealTransition: TransitionDefinition;
|
|
7
|
+
|
|
8
|
+
declare const FoldTurnTransition: TransitionDefinition;
|
|
9
|
+
|
|
10
|
+
declare const ZoomTransition: TransitionDefinition;
|
|
11
|
+
|
|
12
|
+
declare const ChromaticPushTransition: TransitionDefinition;
|
|
13
|
+
|
|
14
|
+
declare const RefractionWarpTransition: TransitionDefinition;
|
|
15
|
+
|
|
16
|
+
declare const GlitchTransition: TransitionDefinition;
|
|
17
|
+
|
|
18
|
+
declare const StrobeCutTransition: TransitionDefinition;
|
|
19
|
+
|
|
20
|
+
declare const FrameHoldStutterTransition: TransitionDefinition;
|
|
21
|
+
|
|
22
|
+
declare const CrossDissolveTransition: TransitionDefinition;
|
|
23
|
+
|
|
24
|
+
declare const DirectionalDissolveTransition: TransitionDefinition;
|
|
25
|
+
|
|
26
|
+
declare const PixelateCollapseTransition: TransitionDefinition;
|
|
27
|
+
|
|
28
|
+
declare const LumaWipeTransition: TransitionDefinition;
|
|
29
|
+
|
|
30
|
+
declare const LightLeakSweepTransition: TransitionDefinition;
|
|
31
|
+
|
|
32
|
+
declare const FilmBurnWipeTransition: TransitionDefinition;
|
|
33
|
+
|
|
34
|
+
declare const DepthPushTransition: TransitionDefinition;
|
|
35
|
+
|
|
36
|
+
declare const RackFocusBlendTransition: TransitionDefinition;
|
|
37
|
+
|
|
38
|
+
declare const ParallaxLayerSplitTransition: TransitionDefinition;
|
|
39
|
+
|
|
40
|
+
declare const ShatterBurstTransition: TransitionDefinition;
|
|
41
|
+
|
|
42
|
+
declare const ElasticSnapCutTransition: TransitionDefinition;
|
|
43
|
+
|
|
44
|
+
declare const GravityDropTransition: TransitionDefinition;
|
|
45
|
+
|
|
46
|
+
declare const ALL_TRANSITIONS: TransitionDefinition[];
|
|
47
|
+
declare const transitionEffects: TransitionDefinition[];
|
|
48
|
+
declare const transitionEffectsById: {
|
|
49
|
+
[k: string]: TransitionDefinition;
|
|
50
|
+
};
|
|
51
|
+
declare function getTransitionEffect(id: string): TransitionDefinition;
|
|
52
|
+
|
|
1
53
|
/**
|
|
2
54
|
* Transition Types
|
|
3
55
|
* Type definitions for transition effects between video clips
|
|
@@ -26,6 +78,7 @@ interface TransitionPreset {
|
|
|
26
78
|
description: string;
|
|
27
79
|
tags: string[];
|
|
28
80
|
defaultDuration: number;
|
|
81
|
+
defaultDurationMs: number;
|
|
29
82
|
durationConstraints?: {
|
|
30
83
|
min: number;
|
|
31
84
|
max: number;
|
|
@@ -113,10 +166,6 @@ declare class TransitionRenderer {
|
|
|
113
166
|
*/
|
|
114
167
|
|
|
115
168
|
declare const TRANSITION_CATEGORIES: TransitionCategory[];
|
|
116
|
-
/**
|
|
117
|
-
* Professional Transition Preset Library
|
|
118
|
-
* Maps UI-friendly presets to engine TransitionRenderer types
|
|
119
|
-
*/
|
|
120
169
|
declare const TRANSITION_PRESETS: TransitionPreset[];
|
|
121
170
|
|
|
122
171
|
/**
|
|
@@ -167,4 +216,4 @@ declare function getTransitionsByTags(tags: string[]): TransitionPreset[];
|
|
|
167
216
|
*/
|
|
168
217
|
declare function getRecommendedDuration(presetId: string): number;
|
|
169
218
|
|
|
170
|
-
export { type AppliedTransition, type EasingFunction, TRANSITION_CATEGORIES, TRANSITION_PRESETS, type TransitionCategory, type TransitionParameters, type TransitionPreset, TransitionRenderer, type TransitionRenderer$1 as TransitionRendererType, getAllTransitionTags, getAllTransitions, getRecommendedDuration, getTransitionById, getTransitionByRenderer, getTransitionCategories, getTransitionCountByCategory, getTransitionsByCategory, getTransitionsByTags, searchTransitions };
|
|
219
|
+
export { ALL_TRANSITIONS, type AppliedTransition, ChromaticPushTransition, CrossDissolveTransition, DepthPushTransition, DirectionalDissolveTransition, type EasingFunction, ElasticSnapCutTransition, FilmBurnWipeTransition, FoldTurnTransition, FrameHoldStutterTransition, GlitchTransition, GravityDropTransition, IrisRevealTransition, LightLeakSweepTransition, LumaWipeTransition, ParallaxLayerSplitTransition, PixelateCollapseTransition, PushTransition, RackFocusBlendTransition, RefractionWarpTransition, ShatterBurstTransition, StrobeCutTransition, TRANSITION_CATEGORIES, TRANSITION_PRESETS, type TransitionCategory, type TransitionParameters, type TransitionPreset, TransitionRenderer, type TransitionRenderer$1 as TransitionRendererType, ZoomTransition, getAllTransitionTags, getAllTransitions, getRecommendedDuration, getTransitionById, getTransitionByRenderer, getTransitionCategories, getTransitionCountByCategory, getTransitionEffect, getTransitionsByCategory, getTransitionsByTags, searchTransitions, transitionEffects, transitionEffectsById };
|
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
|
+
ALL_TRANSITIONS,
|
|
3
|
+
ChromaticPushTransition,
|
|
4
|
+
CrossDissolveTransition,
|
|
5
|
+
DepthPushTransition,
|
|
6
|
+
DirectionalDissolveTransition,
|
|
7
|
+
ElasticSnapCutTransition,
|
|
8
|
+
FilmBurnWipeTransition,
|
|
9
|
+
FoldTurnTransition,
|
|
10
|
+
FrameHoldStutterTransition,
|
|
11
|
+
GlitchTransition,
|
|
12
|
+
GravityDropTransition,
|
|
13
|
+
IrisRevealTransition,
|
|
14
|
+
LightLeakSweepTransition,
|
|
15
|
+
LumaWipeTransition,
|
|
16
|
+
ParallaxLayerSplitTransition,
|
|
17
|
+
PixelateCollapseTransition,
|
|
18
|
+
PushTransition,
|
|
19
|
+
RackFocusBlendTransition,
|
|
20
|
+
RefractionWarpTransition,
|
|
21
|
+
ShatterBurstTransition,
|
|
22
|
+
StrobeCutTransition,
|
|
2
23
|
TRANSITION_CATEGORIES,
|
|
3
24
|
TRANSITION_PRESETS,
|
|
4
25
|
TransitionRenderer,
|
|
26
|
+
ZoomTransition,
|
|
5
27
|
getAllTransitionTags,
|
|
6
28
|
getAllTransitions,
|
|
7
29
|
getRecommendedDuration,
|
|
@@ -9,15 +31,40 @@ import {
|
|
|
9
31
|
getTransitionByRenderer,
|
|
10
32
|
getTransitionCategories,
|
|
11
33
|
getTransitionCountByCategory,
|
|
34
|
+
getTransitionEffect,
|
|
12
35
|
getTransitionsByCategory,
|
|
13
36
|
getTransitionsByTags,
|
|
14
|
-
searchTransitions
|
|
15
|
-
|
|
37
|
+
searchTransitions,
|
|
38
|
+
transitionEffects,
|
|
39
|
+
transitionEffectsById
|
|
40
|
+
} from "../chunk-4Y7ZSGHJ.js";
|
|
16
41
|
import "../chunk-PZ5AY32C.js";
|
|
17
42
|
export {
|
|
43
|
+
ALL_TRANSITIONS,
|
|
44
|
+
ChromaticPushTransition,
|
|
45
|
+
CrossDissolveTransition,
|
|
46
|
+
DepthPushTransition,
|
|
47
|
+
DirectionalDissolveTransition,
|
|
48
|
+
ElasticSnapCutTransition,
|
|
49
|
+
FilmBurnWipeTransition,
|
|
50
|
+
FoldTurnTransition,
|
|
51
|
+
FrameHoldStutterTransition,
|
|
52
|
+
GlitchTransition,
|
|
53
|
+
GravityDropTransition,
|
|
54
|
+
IrisRevealTransition,
|
|
55
|
+
LightLeakSweepTransition,
|
|
56
|
+
LumaWipeTransition,
|
|
57
|
+
ParallaxLayerSplitTransition,
|
|
58
|
+
PixelateCollapseTransition,
|
|
59
|
+
PushTransition,
|
|
60
|
+
RackFocusBlendTransition,
|
|
61
|
+
RefractionWarpTransition,
|
|
62
|
+
ShatterBurstTransition,
|
|
63
|
+
StrobeCutTransition,
|
|
18
64
|
TRANSITION_CATEGORIES,
|
|
19
65
|
TRANSITION_PRESETS,
|
|
20
66
|
TransitionRenderer,
|
|
67
|
+
ZoomTransition,
|
|
21
68
|
getAllTransitionTags,
|
|
22
69
|
getAllTransitions,
|
|
23
70
|
getRecommendedDuration,
|
|
@@ -25,8 +72,11 @@ export {
|
|
|
25
72
|
getTransitionByRenderer,
|
|
26
73
|
getTransitionCategories,
|
|
27
74
|
getTransitionCountByCategory,
|
|
75
|
+
getTransitionEffect,
|
|
28
76
|
getTransitionsByCategory,
|
|
29
77
|
getTransitionsByTags,
|
|
30
|
-
searchTransitions
|
|
78
|
+
searchTransitions,
|
|
79
|
+
transitionEffects,
|
|
80
|
+
transitionEffectsById
|
|
31
81
|
};
|
|
32
82
|
//# sourceMappingURL=index.js.map
|
|
@@ -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
|
|
80
|
+
uniform vec3 uTemperatureColor; // warm or cool color
|
|
79
81
|
uniform float uTemperatureWeight; // 0.0 to 1.0
|
|
80
|
-
uniform vec3
|
|
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; //
|
|
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
|
-
|
|
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
|
|
91
|
-
return color *
|
|
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
|
-
|
|
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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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 =
|
|
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
|
|
143
|
-
|
|
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
|
|
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
|
|
174
|
-
const
|
|
175
|
-
const
|
|
176
|
-
const
|
|
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
|
|
204
|
-
const
|
|
205
|
-
const
|
|
206
|
-
const
|
|
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
|
|