}
)shader";
}
-
+
std::string get_simple_blend_color_func()
{
return
return
get_chroma_glsl()
-
+
+
-
+
R"shader(
vec4 chroma_key(vec4 c)
{
- switch (chroma_mode)
- {
- case 0: return c;
- case 1: return ChromaOnGreen(c.bgra).bgra;
- case 2: return ChromaOnBlue(c.bgra).bgra;
- }
-
- return c;
+ return ChromaOnCustomColor(c.bgra).bgra;
}
)shader";
}
uniform bool straighten_alpha;
uniform bool chroma;
- uniform int chroma_mode;
- uniform vec2 chroma_blend;
- uniform float chroma_spill;
+ uniform bool chroma_show_mask;
+ uniform float chroma_target_hue;
+ uniform float chroma_hue_width;
+ uniform float chroma_min_saturation;
+ uniform float chroma_min_brightness;
+ uniform float chroma_softness;
+ uniform float chroma_spill_suppress;
+ uniform float chroma_spill_suppress_saturation;
)shader"
+
color.rgb /= color.a + 0.0000001;
return color;
- }
+ }
void main()
{
if(levels)
color.rgb = LevelsControl(color.rgb, min_input, gamma, max_input, min_output, max_output);
if(csb)
- color.rgb = ContrastSaturationBrightness(color.rgb, brt, sat, con);
+ color.rgb = ContrastSaturationBrightness(color, brt, sat, con);
if(has_local_key)
color *= texture2D(local_key, gl_TexCoord[1].st).r;
if(has_layer_key)
delete p;
});
};
-
+
try
- {
+ {
g_blend_modes = glTextureBarrierNV ? blend_modes_wanted : false;
g_post_processing = straight_alpha_wanted;
existing_shader.reset(new shader(get_vertex(), get_fragment(g_blend_modes, g_post_processing)), deleter);
{
CASPAR_LOG_CURRENT_EXCEPTION();
CASPAR_LOG(warning) << "Failed to compile shader. Trying to compile without blend-modes.";
-
+
g_blend_modes = false;
existing_shader.reset(new shader(get_vertex(), get_fragment(g_blend_modes, g_post_processing)), deleter);
}