Triforce v0.8.5

A Randomizer page in the launcher, a new title screen with Mods and Save Select tabs, scaling changes applied in game, the Jabu-Jabu bars fixed, renderer frame-time work and the brightness-flash fix, and fixes from the 0.8.4 reports.
This commit is contained in:
ruckus7382sfgsgdf
2026-11-28 10:54:41 -06:00
parent 2df08c751e
commit b527e29adb
203 changed files with 18821 additions and 2051 deletions

View File

@@ -23,6 +23,16 @@ layout(push_constant) uniform Push {
vec4 k; // (radius in world units, strength, the distance it is gone by, flags: 1 the depth runs the other way, 2 show)
} pc;
// ((Triforce, 11-27) a value that is a number: its exponent's bits not all set (not Inf, not NaN), tested by its bits so that
// no compiler takes it for always true. A ROG Ally X (Radeon 890M, AMD's driver) showed black blots and whole black frames
// with Evil HD: the game's picture there can hold a NaN pixel (its B10G11R11 target keeps them), and min, max and clamp of a
// NaN stay NaN on AMD's hardware, where NVIDIA's give the other operand: the occlusion and the shafts of every pixel that
// sampled it were NaN, which aa_pack_rgb9e5 writes as black. Every colour taken in and every result is cleaned)
bool evil_finite(float v) { return (floatBitsToUint(v) & 0x7f800000u) != 0x7f800000u; }
vec3 evil_clean(vec3 c) {
return vec3(evil_finite(c.r) ? max(c.r, 0.0) : 0.0, evil_finite(c.g) ? max(c.g, 0.0) : 0.0, evil_finite(c.b) ? max(c.b, 0.0) : 0.0);
}
const int kSamples = 12;
const float kTurns = 7.0; // (the spiral's turns over the samples: no two on one line)
@@ -50,7 +60,13 @@ void main() {
const vec3 l = view_at(c - ivec2(1, 0)), r = view_at(c + ivec2(1, 0)), d = view_at(c - ivec2(0, 1)), u = view_at(c + ivec2(0, 1));
const vec3 dx = abs(r.z - p.z) < abs(p.z - l.z) ? r - p : p - l;
const vec3 dy = abs(u.z - p.z) < abs(p.z - d.z) ? u - p : p - d;
// (a surface a pixel thin in front of the sky: its neighbours' distances near b / 1e-7, their cross product past a float's
// range, and its normal no number: left open)
vec3 n = normalize(cross(dx, dy));
if (!evil_finite(n.x) || !evil_finite(n.y) || !evil_finite(n.z)) {
imageStore(ao_out, c, vec4(0.0, 0.0, 0.0, 1.0));
return;
}
if (dot(n, -p) < 0.0) n = -n;
// (how rough the depth is here: its second difference across and down, as a share of the distance. A wall, a floor or
// the inside of a corner is smooth; grass, leaves and hair are rough at every pixel, and their own blades would darken
@@ -73,13 +89,13 @@ void main() {
// fog (or a room the game keeps dark) makes it nearly flat: the creases the occlusion finds there are ones the fog hides, and
// drawn over it they showed the rock through a foggy cave. Where the picture is that flat the occlusion fades out
const vec3 luma_w = vec3(0.2126, 0.7152, 0.0722);
float lo = dot(texelFetch(src, c, 0).rgb, luma_w), hi = lo;
float lo = dot(evil_clean(texelFetch(src, c, 0).rgb), luma_w), hi = lo;
for (int i = 0; i < kSamples; i++) {
const float t = (float(i) + 0.5) / float(kSamples);
const float angle = 6.2831853 * (t * kTurns + noise);
const vec2 offset = vec2(cos(angle), sin(angle)) * (px * t);
const ivec2 q = c + ivec2(round(offset));
const vec3 seen = texelFetch(src, clamp(q, ivec2(0), pc.size - 1), 0).rgb;
const vec3 seen = evil_clean(texelFetch(src, clamp(q, ivec2(0), pc.size - 1), 0).rgb);
const float y = dot(seen, luma_w);
lo = min(lo, y), hi = max(hi, y);
const vec3 v = view_at(q) - p;
@@ -92,6 +108,7 @@ void main() {
// grey against the open ground between them (lab 11-23); a corner's walls are tens of centimetres away and count)
const float near_share = smoothstep(0.15 * radius, 0.4 * radius, sqrt(vv));
const float w = clamp((cosine - 0.25) / 0.75, 0.0, 1.0) * clamp(1.0 - vv / r2, 0.0, 1.0) * near_share;
if (!evil_finite(w)) continue;
occluded += w;
bounce += w * seen;
}
@@ -104,5 +121,5 @@ void main() {
ao = mix(ao, 1.0, smoothstep(0.6 * far, far, p.z));
ao = mix(1.0, ao, smooth_here * not_flat);
const float keep = smooth_here * not_flat * (1.0 - smoothstep(0.6 * far, far, p.z));
imageStore(ao_out, c, vec4(bounce / float(kSamples) * keep, ao));
imageStore(ao_out, c, vec4(evil_clean(bounce / float(kSamples) * keep), evil_finite(ao) ? ao : 1.0));
}