Files
oak-editor/engine/shaders/cornerpin.frag
T
Mike-Solar 28c4426236 build: split the engine into liboakengine.so; worker drops the UI entirely
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)
2026-07-20 03:23:28 +08:00

50 lines
953 B
GLSL

// Input texture
uniform sampler2D ove_maintex;
uniform sampler2D tex_in;
uniform bool perspective_in;
// Input texture coordinate
in vec2 ove_texcoord;
out vec4 frag_color;
in vec2 q;
in vec2 b1;
in vec2 b2;
in vec2 b3;
float Wedge2D(vec2 v, vec2 w) {
return (v.x*w.y) - (v.y*w.x);
}
void main() {
if(perspective_in){
frag_color = texture(tex_in, ove_texcoord);
} else {
float A = Wedge2D(b2, b3);
float B = Wedge2D(b3, q) - Wedge2D(b1, b2);
float C = Wedge2D(b1, q);
vec2 uv;
// solve for v
if (abs(A) < 0.001) {
uv.y = -C/B;
} else {
float discrim = B*B - 4.0*A*C;
uv.y = 0.5 * (-B + sqrt(discrim)) / A;
}
// solve for u
vec2 denom = b1 + uv.y * b3;
if (abs(denom.x) > abs(denom.y)) {
uv.x = (q.x - b2.x * uv.y) / denom.x;
} else {
uv.x = (q.y - b2.y * uv.y) / denom.y;
}
uv.y = 1.0 - uv.y;
frag_color = texture(tex_in, uv);
}
}