CRT-Geom Corners with Royal Border Darkness

I’ve been using Lottes Curvature with crt-geoms corners, like crt-guest-dr-venom.

And the border smoothness(edge darkness?) setting leaves much to be desired.

But crt-royale’s border_darkness, border_compression set-up looks miles better, imho.

So I was wondering if anyone could help me achieve a similar effect without using crt-royale’s curvature pass, and it be compatible with the Lottes Curvature/Geom Corner combo?

1 Like

Update: I’ve gotten this partially working.

I’m mainly having issues getting the border darkness to follow the actual borders/corners(Lottes Curvature and crt-geom corners).

I’ll post some code if anyones interested in helping.

Update, Update: This code is a combination of crt-geom’s corner code (under GPL) and crt-royale’s border dim code (under MIT).

float corner(vec2 coord)
	coord *= SourceSize.xy / InputSize.xy;
	coord = (coord - vec2(0.5)) * 1.0 + vec2(0.5);
	coord = min(coord, vec2(1.0)-coord) * vec2(1.0, OutputSize.y/OutputSize.x);

	vec2 cdist = vec2(csize);

    vec2 border_penetration =
        max(vec2(border_size) - cdist, vec2(0.0));
    float penetration_ratio = length(border_penetration)/border_size;
    float border_escape_ratio = max(1.0 - penetration_ratio, 0.0);
    float border_dim_factor =
        pow(border_escape_ratio, border_darkness) * max(1.0, border_compress);

	coord = (cdist - min(coord,cdist));
	float dist = sqrt(dot(coord,coord));
	return clamp((cdist.x-dist)*border_dim_factor,0.0, 1.0);

The game isn’t visible at all unless you turn up the border compression to at least like 3-5 or so (and even then the image is super dark)… it also may give you a completely black screen without turning on the corner code(setting corner size at 0.0 gives black, I think…).

It’s still doesn’t work properly but it’s closer to running how I want it to, I guess. Still unusable, though lol.

This uses crt-royale’s settings for border -darkness, compression and size.