Smarter translucency sorting #42

Merged
embeddedt merged 24 commits from rdh/celeritas:ts into stonecutter 2026-09-16 11:25:42 -04:00
24 Commits
Author SHA1 Message Date
embeddedt b80485bcbb Fix dynamic section sorting potentially lagging slightly 2026-09-16 09:19:24 -04:00
rdh fd362d1b76 skip degenerate quads in the parallel check 2026-09-16 00:36:10 -04:00
rdh 2a75492cab toposort the other way
quads with no relation should come out in ascending index order
2026-09-16 00:36:10 -04:00
rdh 7cf7c5367c try a static order on small groups before cutting them
a group of at most 256 quads that sorts topologically becomes one leaf, and every plane below it is gone
2026-09-14 01:07:16 -04:00
rdh dfa29fcd5e faster toposort
dfs over implicit edges replaces kahn's algorithm, which had to build every edge before it could see a cycle
2026-09-14 01:05:41 -04:00
rdh e6f2061e38 stream the partition tree readout straight into the index buffer 2026-09-14 00:58:50 -04:00
rdh 61ca849523 catch cut plane crossings during a rebuild's flight
The initial order is sorted for the camera at submission, but its planes only enter the index at upload, so a crossing in between was never noticed and the section kept a stale order until the next one. The camera is now recorded at submission and tested against the new planes at upload, for the latest build only, so a stale result cannot disturb a newer in-flight one.
2026-09-14 00:29:14 -04:00
rdh 2f691b6ac0 subtract the section origin from the camera before rounding it to float 2026-09-14 00:25:37 -04:00
rdh 232d5878f8 sort groups without a free cut topologically before splitting intersectors
conforms to the thesis's ordering of the fallbacks, since no free cut doesn't imply a cycle, so an acyclic group takes a static order instead of sinking the whole section to distance sorting
2026-09-14 00:25:37 -04:00
rdh 7e64f27a2e keep only the cuts carrying quads when everything between them is parallel
A multi-partition node took up every free gap, so a run of parallel quads like a water surface between walls was sliced into one slab per block, and every gap plane was a trigger. When all quads between the planes are parallel, only cuts with quads lying on them are kept and merged slabs become static leaves.
2026-09-14 00:25:37 -04:00
rdh 63b910add3 sort parallel groups statically inside the partition tree 2026-09-13 23:54:14 -04:00
rdh 00724cb613 add tree sort statistics to the debug overlay 2026-09-13 23:46:58 -04:00
rdh 8c18e3eac8 update section metadata when clearing sort states 2026-09-13 21:57:21 -04:00
rdh e843e7ae46 Merge remote-tracking branch 'upstream/stonecutter' into ts 2026-09-13 21:50:30 -04:00
embeddedt 6418e3e5f0 Track DYNAMIC-sorted sections more efficiently 2026-09-13 19:53:24 -04:00
rdh 62a85cea4d primary intersector detection
just a heuristic, but easier to make than full quad splitting
if we find intersecting geometry, split it and render the intersecting stuff first

see page 30, "Handling of Special Cases"
2026-09-13 19:41:23 -04:00
rdh 8627794f2a index cut planes into per-section buckets
removes the need to check every section for if the camera has crossed a cut plane
2026-09-13 16:59:08 -04:00
rdh 8a61753c87 resort trees only when crossing cut planes 2026-09-10 16:54:27 -04:00
rdh 5418c0e64f partition tree works omg 2026-09-10 15:17:36 -04:00
rdh b3a509d36f toposort! 2026-09-09 19:07:07 -04:00
rdh d6a8cc0868 prepare for the static toposort 2026-09-08 22:18:19 -04:00
rdh 407e193946 move quad index arithmetic into QuadSet accessors 2026-09-08 21:56:38 -04:00
rdh b6f7d74534 skip translucency sorting for outward faces on the section bounds
also moved all the analysis out of the analyzer, it's just a recorder now
2026-09-08 21:21:34 -04:00
rdh 4f9b824000 cleanup and restructuring 2026-09-08 16:06:28 -04:00