feat: blue
This commit is contained in:
1 parent
d799d2811a
commit
43d02c4468
2 files changed
+21
-7
No files matched your search
@@ -551,10 +551,17 @@ class LutImageProcessor {
|
||||
color.rgb = mix(vec3(gray), color.rgb, uSaturation);
|
||||
|
||||
// 6. 蓝色增强(Vibrance)
|
||||
float blueness = color.b - max(color.r, color.g);
|
||||
if (blueness > 0.0) {
|
||||
color.b += blueness * (uVibrance - 1.0) * 0.5;
|
||||
float baseBlue = color.b - (color.r + color.g) * 0.5;
|
||||
float blueMask = smoothstep(0.0, 0.2, baseBlue);
|
||||
float strength = (uVibrance - 1.0) * 0.5;
|
||||
if (strength > 0.0 && blueMask > 0.0) {
|
||||
vec3 densityCheck = vec3(0.3, 0.3, 0.0) * blueMask * strength;
|
||||
color.r -= densityCheck.r * color.r;
|
||||
color.g -= densityCheck.g * color.g;
|
||||
color.b -= 0.05 * blueMask * strength;
|
||||
color.rgb = mix(color.rgb, color.rgb * color.rgb * (3.0 - 2.0 * color.rgb), blueMask * strength * 0.2);
|
||||
}
|
||||
color.rgb = max(vec3(0.0), color.rgb);
|
||||
|
||||
// 7. 褪色效果
|
||||
if (uFade > 0.0) {
|
||||
|
||||
@@ -207,11 +207,18 @@ object Shaders {
|
||||
float gray = dot(color.rgb, vec3(0.299, 0.587, 0.114));
|
||||
color.rgb = mix(vec3(gray), color.rgb, uSaturation);
|
||||
|
||||
// 6. 蓝色增强(Vibrance - 选择性增强蓝色,保护肤色)
|
||||
float blueness = color.b - max(color.r, color.g);
|
||||
if (blueness > 0.0) {
|
||||
color.b += blueness * (uVibrance - 1.0) * 0.5;
|
||||
// 6. 蓝色增强(Vibrance - 选择性增强蓝色)
|
||||
float baseBlue = color.b - (color.r + color.g) * 0.5;
|
||||
float blueMask = smoothstep(0.0, 0.2, baseBlue);
|
||||
float strength = (uVibrance - 1.0) * 0.5;
|
||||
if (strength > 0.0 && blueMask > 0.0) {
|
||||
vec3 densityCheck = vec3(0.3, 0.3, 0.0) * blueMask * strength;
|
||||
color.r -= densityCheck.r * color.r;
|
||||
color.g -= densityCheck.g * color.g;
|
||||
color.b -= 0.05 * blueMask * strength;
|
||||
color.rgb = mix(color.rgb, color.rgb * color.rgb * (3.0 - 2.0 * color.rgb), blueMask * strength * 0.2);
|
||||
}
|
||||
color.rgb = max(vec3(0.0), color.rgb);
|
||||
|
||||
// 7. 褪色效果(降低对比度 + 提升黑电平)
|
||||
if (uFade > 0.0) {
|
||||
|
||||
Reference in new issue
Block a user