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:
@@ -21,6 +21,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);
|
||||
}
|
||||
|
||||
const int kSamples = 48;
|
||||
const float kReach = 0.85; // (how far towards the sun the line runs, as a share of the way)
|
||||
const float kDecay = 0.978; // (each sample's weight after the one before)
|
||||
@@ -34,7 +44,7 @@ float distance_at(vec2 uv) {
|
||||
vec3 sky_light(vec2 uv) {
|
||||
if (uv.x < 0.0 || uv.y < 0.0 || uv.x > 1.0 || uv.y > 1.0) return vec3(0.0);
|
||||
if (distance_at(uv) < pc.cam.w) return vec3(0.0);
|
||||
const vec3 c = textureLod(src, uv, 0.0).rgb;
|
||||
const vec3 c = evil_clean(textureLod(src, uv, 0.0).rgb);
|
||||
const float l = dot(c, vec3(0.2126, 0.7152, 0.0722));
|
||||
return c * smoothstep(0.2, 0.75, l);
|
||||
}
|
||||
@@ -60,7 +70,7 @@ void main() {
|
||||
}
|
||||
// (less as the pixel is further from the sun on the screen: the shafts gather round it)
|
||||
const float near_sun = 1.0 - smoothstep(0.2, 1.1, length((uv - pc.sun.xy) * vec2(pc.inv.y / pc.inv.x, 1.0)));
|
||||
const vec3 shafts = sum / float(kSamples) * pc.sun.z * pc.sun.w * (0.35 + 0.65 * near_sun);
|
||||
const vec3 shafts = evil_clean(sum / float(kSamples) * pc.sun.z * pc.sun.w * (0.35 + 0.65 * near_sun));
|
||||
if ((int(pc.cam.z) & 2) != 0) { // (RX_VK_EVIL_AO_SHOW=2, the lab's: the shafts alone, and the sun's place as a dot)
|
||||
const float dot_here = 1.0 - smoothstep(0.004, 0.006, length(uv - pc.sun.xy));
|
||||
imageStore(dst, c, uvec4(aa_pack_rgb9e5(sqrt(min(shafts * 4.0 + vec3(dot_here, 0.0, 0.0), vec3(1.0)))), 0u, 0u, 0u));
|
||||
|
||||
Reference in New Issue
Block a user