Physical split: app/{audio,cli,codec,common,config,node,pluginSupport,
render,task,timeline,undo,tool,shaders} plus coreengine, version and
ui/icons+colorcoding move to a new top-level engine/ tree, built as
liboakengine.so (shared). The render backends (oakgl/oakvulkan) move
with it and link the engine library instead of embedding a static
render-core subset (libolive-rendercore is gone).
- oak-render-worker now links liboakengine instead of the whole
libolive-editor object set: 336MB -> 2.9MB, no Qt Widgets UI
- the editor links liboakengine for the engine and keeps only UI
objects in libolive-editor
- install/packaging: GNUInstallDirs libdir on Linux, bundle copy on
macOS, oakengine.dll staged for NSIS, AppImage validation entry
- fix backend lookup for the new layout: DynamicRenderer searched
../app but backends now live in engine/; a stale pre-split liboakgl
in the build tree got dlopened instead, re-initialized and later
destroyed the interposed engine statics (full-suite segfault at
DialogSequenceParameterTab, found via gdb watchpoint)
66 lines
2.3 KiB
GLSL
66 lines
2.3 KiB
GLSL
uniform sampler2D tex_in;
|
|
uniform int color_in;
|
|
uniform int method_in;
|
|
uniform bool preserve_luminance_input;
|
|
uniform vec3 luma_coeffs;
|
|
|
|
in vec2 ove_texcoord;
|
|
out vec4 frag_color;
|
|
|
|
#define AVERAGE 0
|
|
#define DOUBLE_RED_AVERAGE 1
|
|
#define DOUBLE_AVERAGE 2
|
|
#define BLUE_LIMIT 3
|
|
|
|
void main(void) {
|
|
vec4 original_col = texture(tex_in, ove_texcoord);
|
|
vec4 tex_col = original_col;
|
|
float color_average = 0.0;
|
|
|
|
if(color_in == 0) { // Green screen
|
|
switch (method_in) {
|
|
case AVERAGE:
|
|
color_average = dot(tex_col.rb, vec2(0.5)); // (tex_col.r + tex_col.b) / 2.0
|
|
tex_col.g = tex_col.g > color_average ? color_average: tex_col.g;
|
|
break;
|
|
case DOUBLE_RED_AVERAGE:
|
|
color_average = dot(tex_col.rb, vec2(2.0, 1.0) / 3.0); // (2.0 * tex_col.r + tex_col.b) / 3.0
|
|
tex_col.g = tex_col.g > color_average ? color_average : tex_col.g;
|
|
break;
|
|
case DOUBLE_AVERAGE:
|
|
color_average = dot(tex_col.br, vec2(2.0, 1.0) / 3.0); // (2.0 * tex_col.b + tex_col.r) / 3.0
|
|
tex_col.g = tex_col.g > color_average ? color_average : tex_col.g;
|
|
break;
|
|
case BLUE_LIMIT:
|
|
tex_col.g = tex_col.g > tex_col.b ? tex_col.b : tex_col.g;
|
|
break;
|
|
}
|
|
} else { // Blue screen
|
|
switch (method_in) {
|
|
case AVERAGE:
|
|
color_average = dot(tex_col.rg, vec2(0.5)); // (tex_col.r + tex_col.g) / 2.0
|
|
tex_col.b = tex_col.b > color_average ? color_average : tex_col.b;
|
|
break;
|
|
case DOUBLE_RED_AVERAGE:
|
|
color_average = dot(tex_col.rg, vec2(2.0, 1.0) / 3.0); // (2.0 * tex_col.r + tex_col.g) / 3.0
|
|
tex_col.b = tex_col.b > color_average ? color_average : tex_col.b;
|
|
break;
|
|
case DOUBLE_AVERAGE:
|
|
color_average = dot(tex_col.gr, vec2(2.0, 1.0) / 3.0); // (2.0 * tex_col.g+ tex_col.r) / 3.0
|
|
tex_col.b = tex_col.b > color_average ? color_average : tex_col.b;
|
|
break;
|
|
case BLUE_LIMIT:
|
|
tex_col.b = tex_col.b > tex_col.g ? tex_col.g : tex_col.b;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (preserve_luminance_input) {
|
|
vec4 diff = original_col - tex_col;
|
|
float luma = dot(abs(diff.rgb), luma_coeffs);
|
|
tex_col.rgb += vec3(luma);
|
|
}
|
|
|
|
frag_color = tex_col;
|
|
}
|