mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-29 04:18:49 -04:00
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:
@@ -23,6 +23,16 @@ layout(push_constant) uniform Push {
|
||||
|
||||
#include "aa_common.glsl"
|
||||
|
||||
// ((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);
|
||||
}
|
||||
|
||||
float distance_at(ivec2 p) {
|
||||
float d = texelFetch(depth_tex, clamp(p, ivec2(0), pc.size - 1), 0).r;
|
||||
if ((int(pc.k.w) & 1) != 0) d = 1.0 - d;
|
||||
@@ -44,11 +54,13 @@ void main() {
|
||||
const ivec2 q = clamp(c + ivec2(x, y), ivec2(0), pc.size - 1);
|
||||
const float w = exp(-abs(distance_at(q) - z) / max(0.03 * z, 1e-4));
|
||||
const vec4 a = texelFetch(ao_tex, q, 0);
|
||||
sum += w * a.a;
|
||||
bounce += w * a.rgb;
|
||||
if (!evil_finite(w)) continue;
|
||||
sum += w * (evil_finite(a.a) ? a.a : 1.0);
|
||||
bounce += w * evil_clean(a.rgb);
|
||||
weight += w;
|
||||
}
|
||||
const float ao = weight > 0.0 ? sum / weight : 1.0;
|
||||
float ao = weight > 0.0 ? sum / weight : 1.0;
|
||||
if (!evil_finite(ao)) ao = 1.0;
|
||||
bounce = weight > 0.0 ? bounce / weight : vec3(0.0);
|
||||
if ((int(pc.k.w) & 2) != 0) { // (RX_VK_EVIL_AO_SHOW=1, the lab's: the occlusion alone, white open, black closed)
|
||||
imageStore(dst, c, uvec4(aa_pack_rgb9e5(vec3(sqrt(ao))), 0u, 0u, 0u));
|
||||
@@ -59,6 +71,7 @@ void main() {
|
||||
const float luma = dot(e * e, vec3(0.2126, 0.7152, 0.0722));
|
||||
const float kept = mix(ao, 1.0, 0.5 * smoothstep(0.5, 1.0, luma));
|
||||
// (the bounce: the light around, on this surface's colour; the occluded part of the pixel is what it lights)
|
||||
const vec3 lin = e * e * kept + bounce * e * e * pc.bounce_strength * (1.0 - kept + 0.25);
|
||||
const vec3 lin = evil_clean(e * e * kept + bounce * e * e * pc.bounce_strength * (1.0 - kept + 0.25));
|
||||
if (!evil_finite(lin.r + lin.g + lin.b)) return;
|
||||
imageStore(dst, c, uvec4(aa_pack_rgb9e5(sqrt(lin)), 0u, 0u, 0u));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user