Add a fast curvature function that try to survive "Dolby ears®"

This commit is contained in:
Antonio Orefice 2023-09-27 11:14:32 +02:00
parent 43ad7ab791
commit 5766ed2fbf

View file

@ -29,6 +29,20 @@ vec2 tl_warp(vec2 pos)
return pos*0.5 + 0.5;
}
/* Curvature by kokoko3k, GPL-3.0 license
* w.x and w.y are global warp parameters
* protrusion is the rounded shape near the middle
* keep protrusion higher than ~0.5
*/
vec2 Warp_koko(vec2 co, vec2 w, float protrusion) {
float czoom = 1 - distance(co, vec2(0.5));
czoom = mix(czoom, czoom * protrusion, czoom);
vec2 czoom2d = mix(vec2(1.0), vec2(czoom), w);
vec2 coff = mix( vec2(0.0), vec2(0.625), w);
return zoomxy(co, coff + czoom2d );
}
// cgwg's geom
// license: GPLv2
@ -99,6 +113,8 @@ vec2 cgwg_warp(vec2 coord)
vec2(1.0, 1.0)/aspect + vec2(0.5, 0.5));
}
float corner(vec2 coord)
{
coord = (coord - vec2(0.5)) + vec2(0.5, 0.5);