renderer: Add supercircular window corners (#8943)

renderer: Add supercircular shadows and borders

config: Add rounding_power to default and example configs

rule: add `roundingpower` window rule
This commit is contained in:
Pollux 2025-01-05 12:38:49 -06:00 committed by GitHub
parent b0bae15499
commit a5c14370c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 228 additions and 173 deletions

View file

@ -15,6 +15,7 @@ uniform vec2 fullSize;
uniform vec2 fullSizeUntransformed;
uniform float radius;
uniform float radiusOuter;
uniform float roundingPower;
uniform float thick;
// Gradients are in OkLabA!!!! {l, a, b, alpha}
@ -138,9 +139,9 @@ void main() {
const float SMOOTHING_CONSTANT = )#" +
std::format("{:.7f}", SHADER_ROUNDED_SMOOTHING_FACTOR) + R"#(;
float dist = length(pixCoord);
float distOuter = length(pixCoordOuter);
float h = (thick / 2.0);
float dist = pow(pow(pixCoord.x,roundingPower)+pow(pixCoord.y,roundingPower),1.0/roundingPower);
float distOuter = pow(pow(pixCoordOuter.x,roundingPower)+pow(pixCoordOuter.y,roundingPower),1.0/roundingPower);
float h = (thick / 2.0);
if (dist < radius - h) {
// lower