Triforce v0.8.0

Evil HD (SMAA Ultra, 16x filtering, full textures, ambient occlusion with bounce light, sunlight shafts, foliage drawn 4x as far, the remastered texture pack's loader and the launcher's download of it), FSR 3.1 frame generation for every GPU, Intel XeSS, FSR 4 model choice, ReShade presets, Auto (this PC), HUD placement, the options menu in 13 languages, a second input for every control, hold to toggle, DualSense speaker and haptics, NFC from the player's own dumps, the above-60 fps game fixes, the Debug tab's flight and Inventory fixes, the launcher's full settings, and over 250 fixes.
This commit is contained in:
ruckus7382sfgsgdf
2026-11-25 10:21:32 -06:00
parent 861702476a
commit 4fa4f9188b
881 changed files with 179428 additions and 15581 deletions

View File

@@ -1,5 +1,7 @@
#include "../gpu/vk/dlss_actor.h"
#include <array>
#include <cmath>
#include <cstdio>
#define CHECK(name, condition) do { if (!(condition)) { std::fprintf(stderr, "FAIL %s at line %d\n", name, __LINE__); return 1; } } while (0)
@@ -80,6 +82,82 @@ int main() {
proj[14] = -1.0f, proj[15] = 0.0f, proj[2] = 0.5f;
CHECK("an off-centre one: not a jitter", !da::camera_jitter(proj, own));
CHECK("the cameras' buffer holds its words", da::kJitterBeforeWord + 2 <= da::kHeadWords && da::kToleranceWord < da::kJitterBeforeWord);
// copies of a model pair with the frame before's copies by place, all at once, the nearest pairs first, within a reach
using P = da::Placed;
const auto same = [](const std::vector<int>& a, std::vector<int> b) { return a == b; };
// (the four Gossip Stones: 2.3 units apart in a row, still)
const std::vector<P> stones = {{{39.4f, 102.8f, -11.9f}, 0}, {{39.4f, 102.8f, -9.6f}, 1}, {{39.4f, 102.8f, -7.3f}, 2},
{{39.4f, 102.8f, -5.0f}, 3}};
CHECK("still copies in the same order: themselves", same(da::pair_by_place(stones, stones, 1.0f), {0, 1, 2, 3}));
const std::vector<P> turned = {stones[2], stones[0], stones[3], stones[1]};
CHECK("still copies drawn in another order: themselves", same(da::pair_by_place(turned, stones, 1.0f), {2, 0, 3, 1}));
// (run C, 19.58 s: the first stone comes into view; the frame before had the other three only)
const std::vector<P> three = {{{39.4f, 102.8f, -9.6f}, 0}, {{39.4f, 102.8f, -7.3f}, 1}, {{39.4f, 102.8f, -5.0f}, 2}};
CHECK("a copy new in view takes no neighbour's place", same(da::pair_by_place(stones, three, 1.0f), {-1, 0, 1, 2}));
CHECK("... nor with a reach wider than the row", same(da::pair_by_place(stones, three, 100.0f), {-1, 0, 1, 2}));
// (a stone drawn by the other model in the frame before: this model's only copy then is another stone)
const std::vector<P> lone_now = {stones[3]}, lone_then = {stones[1]};
CHECK("a lone copy further than the reach: none", same(da::pair_by_place(lone_now, lone_then, 1.0f), {-1}));
const std::vector<P> moved = {{{39.9f, 102.8f, -5.2f}, 0}};
CHECK("a lone copy that moved a little: it", same(da::pair_by_place(moved, lone_now, 1.0f), {0}));
// (two of one model passing each other, drawn in the other order than the frame before)
const std::vector<P> walkers_then = {{{0.1f, 0, 0}, 0}, {{0.4f, 0, 0}, 1}}, walkers_now = {{{0.5f, 0, 0}, 0}, {{0.0f, 0, 0}, 1}};
CHECK("two passing each other: each itself", same(da::pair_by_place(walkers_now, walkers_then, 1.0f), {1, 0}));
// (two of one model 0.6 apart, both moving 0.35 and drawn in the same order: the first's new place is nearest the
// second's old one, and nearest first alone would swap them. By draw order 0.35 each, against 0.25 and 0.95)
const std::vector<P> pair_then = {{{0.0f, 0, 0}, 0}, {{0.6f, 0, 0}, 1}}, pair_now = {{{0.35f, 0, 0}, 0}, {{0.95f, 0, 0}, 1}};
CHECK("two moving fast for their spacing, in draw order: each itself",
same(da::pair_by_place(pair_now, pair_then, 1.0f), {0, 1}));
// (0.9 apart, both moving 0.5: nearest first pairs only one, the first's new place with the second's old one at 0.4,
// and leaves the other 1.4 away, past the reach. Draw order pairs both at 0.5: more pairs win over a smaller total)
const std::vector<P> wide_then = {{{0.0f, 0, 0}, 0}, {{0.9f, 0, 0}, 1}}, wide_now = {{{0.5f, 0, 0}, 0}, {{1.4f, 0, 0}, 1}};
CHECK("draw order pairing more copies wins over nearest first's smaller total",
same(da::pair_by_place(wide_now, wide_then, 1.0f), {0, 1}));
// (a stone changes model: the frame before's copies of this model were the first two stones, this frame's are the second
// and third. Within the reach actor_motion keeps at the most (2), the second stone is itself and the third has none; with
// a reach past the stones' 2.3, draw order pairs two to nearest first's one and moves both toward their neighbour)
const std::vector<P> row_then = {stones[0], stones[1]}, row_now = {{{39.4f, 102.8f, -9.6f}, 0}, {{39.4f, 102.8f, -7.3f}, 1}};
CHECK("a row whose model changed, within a reach of 2: itself and none",
same(da::pair_by_place(row_now, row_then, 2.0f), {1, -1}));
CHECK("... and past the stones' spacing, each takes its neighbour (why the reach is capped)",
same(da::pair_by_place(row_now, row_then, 3.3f), {0, 1}));
// (the same geometry drawn twice for one object: both copies at one place, each keeps its own n-th)
const std::vector<P> twice = {{{5, 5, 5}, 0}, {{5, 5, 5}, 1}}, twice_swapped = {{{5, 5, 5}, 1}, {{5, 5, 5}, 0}};
CHECK("a tie at one place: the same n-th", same(da::pair_by_place(twice, twice, 1.0f), {0, 1}) &&
same(da::pair_by_place(twice, twice_swapped, 1.0f), {1, 0}));
const std::vector<P> once = {{{5, 5, 5}, 0}};
CHECK("a tie at one place, its own n-th gone: the other", same(da::pair_by_place(once, {twice[1]}, 1.0f), {0}));
const std::vector<P> lost = {{{std::nanf(""), 0, 0}, 0}};
CHECK("a place that is not finite: none", same(da::pair_by_place(lost, once, 1.0f), {-1}));
CHECK("none then, none now", da::pair_by_place(stones, {}, 1.0f) == std::vector<int>(4, -1) &&
da::pair_by_place({}, stones, 1.0f).empty());
// a draw's place: its origin plus its bones' mean translation (copies at one origin, placed by their bones, differ)
const auto pose_of = [](float ox, float oy, float oz, std::vector<std::array<float, 3>> moves) {
std::vector<uint8_t> p(16 + moves.size() * 48, 0);
const float o[4] = {ox, oy, oz, 0.0f};
std::memcpy(p.data(), o, sizeof o);
for (size_t b = 0; b < moves.size(); b++) {
const float m[12] = {1, 0, 0, moves[b][0], 0, 1, 0, moves[b][1], 0, 0, 1, moves[b][2]};
std::memcpy(p.data() + 16 + b * 48, m, sizeof m);
}
return p;
};
float place[3];
const auto by_origin = pose_of(100, 0, 5, {{0, 0, 0}, {0, 2, 0}});
da::place_of(by_origin.data(), by_origin.data() + 16, 2, place);
CHECK("placed by its origin", place[0] == 100 && place[1] == 1 && place[2] == 5);
const auto by_bones = pose_of(0, 0, 0, {{300, 0, 7}, {300, 4, 7}});
da::place_of(by_bones.data(), by_bones.data() + 16, 2, place);
CHECK("placed by its bones, at a shared origin", place[0] == 300 && place[1] == 2 && place[2] == 7);
auto bad = pose_of(10, 0, 0, {{2, 0, 0}, {0, 0, 0}});
const float nan = std::nanf("");
std::memcpy(bad.data() + 16 + 48 + 3 * 4, &nan, 4);
da::place_of(bad.data(), bad.data() + 16, 2, place);
CHECK("a bone that is not finite is left out", place[0] == 12 && place[1] == 0);
da::place_of(by_origin.data(), by_origin.data() + 16, 0, place);
CHECK("no bones: the origin", place[0] == 100 && place[1] == 0 && place[2] == 5);
std::puts("dlss_actor: ok");
return 0;
}