WIP: feat(vk): ray-traced ambient occlusion, sun shadows, global illumination and reflections #727
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!727
Loading…
Reference in a new issue
No description provided.
Delete branch "winterelfeas/Longshot:feat/ray-tracing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: feat · Risk: medium · Tested on: Windows 11, RTX 5090; Windows 11, Radeon RX 9070 XT (by Drommedhar) · Needs: Linux (AMD RADV), Intel Arc, an older NVIDIA RTX card
Why
The game lights its world with tricks made for a handheld: a screen-space ambient occlusion that only sees what is on screen, sun shadows from low-resolution cascades that fade out in the distance, light baked once per object that never bounces off what is near it, and reflections that show a fixed environment picture instead of the scene. On a PC with a ray tracing GPU, all four can be traced against the real scene instead. This PR adds that, as four options in the Graphics tab, all off by default, so nothing changes for anyone who doesn't turn them on.
No issue asks for it (searched the tracker for ray tracing, reflections, AO and shadows: #601 and #603 are about the game's own character shadows, which this leaves as they are).
What changed
Ray tracing over the game's own frame. The renderer keeps the scene's geometry as Vulkan acceleration structures, built from the game's own vertex and index buffers, and each effect goes in where the game computes the same thing: AO and sun shadows into the game's screen-space light mask, the bounce light and the reflections inside the game's own lighting programs, by a SPIR-V patch of their fragment modules when they are made. The game's renderer is otherwise left as it is; with every row off nothing here runs (
rt::mode()is one load).docs/ray-tracing.mddescribes each part, what it found in the game's frame, the requirements, the cost and the switches.gpu/vk/vk_rt.h. The parts are told of each draw before and after it is recorded (vk_draw.cpp), of each dispatch, and of each present (vk_replay.cpp).vk_rt_scene.cpp,vk_rt_omm.h,shaders/rt_scene_*): bottom levels from the depth pre-pass's draws, skinned characters (re-skinned in a compute pass), terrain patches, and the mesh-shader foliage (in the default native mode by running the compute fallback for capture only, every 4th frame per draw;RX_VK_RT_NATIVE_MESH=0turns that off), and the cascade draws placed by their own vertex stage (the Lost Woods' falling leaves) captured by transform feedback where the device hasVK_EXT_transform_feedback(RX_VK_RT_XFB=0turns that off), and static models the camera has drawn kept as casters while out of view, so interiors keep their roofs (RX_VK_RT_REMEMBER=0turns that off); a top level a frame with instance masks by kind (opaque, cutout, skinned, foliage, out-of-view casters, cascade-only blockers). Alpha-tested cards are cut by opacity micromaps from the game's own alpha where the device hasVK_EXT_opacity_micromap; hit normals by position fetch. The game's pools become build inputs only with ray tracing on (pool_usage()invk_memory.cpp). Device extensions and features are asked for only when a row orRX_VK_RTis on (vk_main.cpp).vk_rt_mask.cpp,shaders/rt_ao_*): after the game's combine writes its light mask (found by what it does, since it is another program in each kind of place), a trace, a temporal pass and a filter write the mask's AO and sun channels. The traced sun shadow takes the place of the game's (RX_VK_RT_SUN_KEEP=1adds it to the game's instead, for debugging), and a gate keeps the game's own where the rays would take away sunlight the game shows. Every caster's sun shadow is traced, in both mesh modes: the world, the characters and the plants; past 60 m the traced shadow hands over to the game's (fully by 120 m). The gate is a safety net for a broken structure only.vk_rt_gi.cpp,rt_gi_spirv.h,shaders/rt_gi_*): one diffuse bounce at half resolution, one ray a pixel, from the previous frame's lit colour, accumulated and filtered, added in the lit programs' ambient term.vk_rt_refl.cpp,rt_refl_spirv.h,shaders/rt_refl_*): the lit programs' specular environment lookup replaced by a traced reflection along the same vector, on water first, and on smooth metal and glass by their roughness; a march against the previous frame's colour, then the structure for what is off screen.vk_progcache.cpp,vk_shader.h): the GI and reflection patches are applied when a module is made, so the cache's records are the game's own, unchanged, and its stamp does not move.par_threads()turns parallel replay off while ray tracing is on: its parts record in the stream's order (the frame's captures, the structure's builds), and the log says so.vk_menu.cpp,vk_menu.h): a Ray tracing (Experimental) section at the end of the Graphics tab, four Off/On rows, read once at the start (restart rows, outside the quality presets), and a Reflections: max roughness row (Low / Medium / High / Max, applied at once).RX_VK_RT=<bits>goes over them.RX_VK_RT_ALPHA=1, off by default) the cut-outs' baked bits are tested in the rays' loop, withFULLsplit into micromaps and position fetch.tests/test_menu_sections.pyand the README's table know the rows;tests/test_recorder_sync.pyknows the structure builds (with a control case); the program cache, import and fallback pipeline fixtures stand in for the new hooks;gpu/vk/tests/rt_*_spirv_test.cpppatch modules forspirv-val.Measurements
Verdict: with the rows off this PR costs nothing measurable: main and this PR with
RX_VK_RT=0both hold the 60 fps cap with the same GPU time a frame and the same video memory. With all four rows on, the frame rate falls from 60 to 51.9 fps at the tester's settings (4K output, DLSS at 50%) and to 39.8 fps at 4K DLAA on an RTX 5090 (GPU time about +4 and +8.5 ms a frame, video memory +1.5 and +2.2 GB): the rows are off by default and marked Experimental, for cards with room to spare.Hardware: Windows 11 Home (26200), RTX 5090 32 GB, driver 621.01, Ryzen 7 9800X3D, 64 GB
Scene: Kokiri Forest by day, child Link standing at the save's spot; scripted (
longshot_ctl.py), the game's window not focused, sound off, no other GPU work alternating with the runsMethod: 30 s standing, then the log's
vk: N presents, X fpslines over 90 s, each run's median; a warm-up run, then main, this PR withRX_VK_RT=15and this PR withRX_VK_RT=0, interleaved, three times (twice forRX_VK_RT=0); the median of the runs.RX_VK_LOAD=create,RX_VK_PRECOMPILE=0Baseline: main 54ef5ca3's renderer against this PR's at
bd3ca8e6(this branch rebased on54ef5ca3), both built alone (RX_VK_ONLY, release) and swapped in one game folder built bymake_game.pyfrom this branch, so the exe (API 29) is the same on every sideHow to reproduce:
python -I scripts/longshot_ctl.py launch <game> --save <a save in Kokiri Forest> --env RX_VK_RT=0(then=15), with the renderers swapped, and read the fps lines54ef5ca3RX_VK_RT=0): this PR @bd3ca8e6RX_VK_RT=15): this PR @bd3ca8e6Main and the rows-off side are held at the cap, so this pair says only that nothing visible is lost at the cap; their GPU times agree within a few tenths of a millisecond. No device lost in these 18 runs. The earlier A/B on d34ac44b (before the sun gate's fix below) gave 49.8 and 32.3 fps all on. In that earlier batch, the first all-on runs (44.8 and 22.4 fps, with a GPU time of 28.5 or 45 ms a frame at 4K) were taken while another game's runs alternated with these on the same GPU; with nothing alternating, five 4K runs held 24-25 ms throughout. One run of this PR with the rows off lost the device (frame 11193, in a draw of the game's program 999fd641ba1fc2b0 with no ray tracing pass in the frame; Windows logged one nvlddmkm event 153); the runs after it (twenty-odd, all four parts on and off) did not. Logs and pictures are in the comment with these numbers;
docs/tested/2026-11-17-ray-tracing-winterelfeas-ab-*.mdhas this batch's two rows.The sun gate's sums (the light mask's count of sunlit texels, read back by the CPU) were atomics into host memory, over PCIe; they now go into a 16-byte device-local buffer, copied out once a frame (
cc5c18cf). That took the AO and sun shadows' "filter and write" span from 1.06 to 0.18 ms at the tester's settings and from 4.31 to 0.70 ms at 4K DLAA (interleaved before/after, 2 runs a side, pictures and the gate's readings unchanged), and it is the likely cause of the occasional 45 ms frames under load. The per-part table below is from before it.GPU time of each part (this PR at d34ac44b, the tester's settings: 4K output, DLSS at 50%; all four rows on with
RX_VK_PASS_TIMING=1, each part switched live, 45 s windows, nothing else on the GPU but a video player; fps is held at the 60 cap in most states, so the GPU time a frame is the measure; "structure only" is all four parts off with the scene still built every frame):RX_VK_RT=0Over the structure alone: AO about 0 (it takes the place of the game's SSAO, whose dispatches are left out), sun shadows +1.0 to +1.6 ms, GI +0.0 to +0.25 ms, reflections at Max +0.9 to +2.0 ms; the structure itself +1.0 to +2.3 ms over
RX_VK_RT=0; all four +3.4 to +4.6 ms. AO's quality rows cost 8.7 / 8.8 / 8.9 / 9.05 ms (Low to Ultra, Kokiri); the reflections' roughness rows 9.0 / 9.6 / 10.4 / 11.1 ms (Low to Max, Kokiri). Video memory with all four: +1.1 to +1.5 GB at the tester's settings, +2.3 GB at 4K DLAA. At 4K DLAA (pass-timed, steady): 24.6-25.4 ms a frame, 30-32 fps; the largest spans were then the AO and sun shadows' filter and write (4.3 ms, 0.7 ms sincecc5c18cf) and their rays (2.8 ms). Building the top level is CPU work on the render thread (1.2 to 5 ms a frame by place); moving it off that thread is the next optimisation. No device lost in these 9 runs.GPU-assisted validation (
VK_LAYER_KHRONOS_validationwith GPU-AV, core checks off), Kokiri Forest, all four rows on: no device lost, no out-of-bounds access, no invalid address, with the opacity micromaps and with the path without them forced (RX_VK_RT_OMM=0 RX_VK_RT_ALPHA=1). The one report from this PR's code, VUID-vkCmdBuildMicromapsEXT-pInfos-07515 (micromap data not 256-aligned), is fixed in4171fadeand gone in its own run. The other reports are not this PR's: VUID-RuntimeSpirv-MeshEXT-12380 (the shader translator's mesh path) and SharedMemoryDataRace in two of the game's own compute programs. The Market and the other towns were not reached under validation (a few frames a second).Quality, measured on the parts' branches before they were joined here: the structure agrees with the game's depth on 90-99% of the screen across eight areas; with the sun gate the rays keep 98-100% of the game's sunlit screen in Kokiri Forest and 92-96% in the gorge; GI adds 11% to Kokiri Forest's picture and 17-30% inside the Deku Tree, never darkening; at night (22:00) the traced shadows follow the moon's cascades and GI adds 12-22% with nothing darker; reflections reach ten water surfaces, the armour and the Market's shop windows.
Flags and settings
Five new menu rows (ini keys from their names) and the
RX_VK_RTswitch family; all off as shipped.RX_VK_MESH_SHADERS=computeRX_VK_RT=<bits>RX_VK_RT_*:RX_VK_RT_AO_CONTACT,RX_VK_RT_AO_FALLOFF,RX_VK_RT_AO_FAR,RX_VK_RT_AO_INTO_SSAO,RX_VK_RT_AO_MARCH_RADIUS,RX_VK_RT_AO_MARCH_WEIGHT,RX_VK_RT_AO_MASK,RX_VK_RT_AO_POWER,RX_VK_RT_AO_QUALITY,RX_VK_RT_AO_QUARTER,RX_VK_RT_AO_RADIUS,RX_VK_RT_AO_RAYS,RX_VK_RT_AO_STEPS,RX_VK_RT_AO_STRENGTH,RX_VK_RT_AO_THICKNESS,RX_VK_RT_ALPHA,RX_VK_RT_ALPHA_CENSUS,RX_VK_RT_ALPHA_LEVEL,RX_VK_RT_ALPHA_MB,RX_VK_RT_ALPHA_MESH_LEVEL,RX_VK_RT_ALPHA_REBAKE,RX_VK_RT_ALPHA_SKINNED,RX_VK_RT_ALPHA_TRIS,RX_VK_RT_ARENA_MB,RX_VK_RT_BACK,RX_VK_RT_BIAS,RX_VK_RT_BLAS_MB,RX_VK_RT_BUILD_TRIS,RX_VK_RT_CASCADES,RX_VK_RT_CASCADE_MESH,RX_VK_RT_CHANNELS,RX_VK_RT_CLAMP,RX_VK_RT_CONTACT,RX_VK_RT_CONTACT_STEPS,RX_VK_RT_CONTACT_THICKNESS,RX_VK_RT_CUT,RX_VK_RT_CUTOUT,RX_VK_RT_CUTOUT_COVER,RX_VK_RT_CUT_LEVEL,RX_VK_RT_DEBUG,RX_VK_RT_DEBUG_FILE,RX_VK_RT_DEBUG_GAIN,RX_VK_RT_DEBUG_MASK,RX_VK_RT_DEBUG_POINT,RX_VK_RT_DEBUG_VIEW,RX_VK_RT_EMISSION,RX_VK_RT_EMISSION_DEFAULTS,RX_VK_RT_EMISSION_GAIN,RX_VK_RT_FETCH,RX_VK_RT_FILTER,RX_VK_RT_FORCE,RX_VK_RT_GI_ADD,RX_VK_RT_GI_AREA,RX_VK_RT_GI_CACHE,RX_VK_RT_GI_CLAMP,RX_VK_RT_GI_CTL,RX_VK_RT_GI_FALLBACK,RX_VK_RT_GI_FEEDBACK,RX_VK_RT_GI_FILTER,RX_VK_RT_GI_FORGET,RX_VK_RT_GI_HISTORY,RX_VK_RT_GI_HOLD,RX_VK_RT_GI_KERNEL,RX_VK_RT_GI_LENGTH,RX_VK_RT_GI_NEAR,RX_VK_RT_GI_OCCLUDE,RX_VK_RT_GI_PROBE,RX_VK_RT_GI_RAYS,RX_VK_RT_GI_REGION,RX_VK_RT_GI_REPLACE,RX_VK_RT_GI_SELF,RX_VK_RT_GI_STABLE,RX_VK_RT_GI_STEPS,RX_VK_RT_GI_STRENGTH,RX_VK_RT_GI_THICKNESS,RX_VK_RT_GI_TRACE,RX_VK_RT_GI_WAY,RX_VK_RT_GROUND_MATERIAL,RX_VK_RT_HISTORY,RX_VK_RT_HISTORY_TOL,RX_VK_RT_HOLES,RX_VK_RT_HYBRID,RX_VK_RT_KEEP,RX_VK_RT_LEAF_CUT,RX_VK_RT_LEAF_CUT_LEVEL,RX_VK_RT_LEAF_LOG,RX_VK_RT_LEAF_MB,RX_VK_RT_LEAF_MIN,RX_VK_RT_LEAF_MIN_FAR,RX_VK_RT_LEAF_PROGS,RX_VK_RT_LIFT,RX_VK_RT_MAT_LOG,RX_VK_RT_MARCH,RX_VK_RT_MESH,RX_VK_RT_MESH_EDGE,RX_VK_RT_MESH_EDGE_CTL,RX_VK_RT_MESH_EVERY,RX_VK_RT_MESH_MB,RX_VK_RT_MESH_TEST,RX_VK_RT_NATIVE_MESH,RX_VK_RT_NEAR_DEDUPE,RX_VK_RT_OMM,RX_VK_RT_OMM_ALPHA,RX_VK_RT_OMM_LEVEL,RX_VK_RT_PALETTE_COPY,RX_VK_RT_PROBE,RX_VK_RT_REFL_AMBIENT,RX_VK_RT_REFL_BOUND,RX_VK_RT_REFL_CLAMP,RX_VK_RT_REFL_CONE,RX_VK_RT_REFL_CTL,RX_VK_RT_REFL_DITHER,RX_VK_RT_REFL_GLOW,RX_VK_RT_REFL_LENGTH,RX_VK_RT_REFL_MARCH_ALL,RX_VK_RT_REFL_MASK,RX_VK_RT_REFL_METAL_RAYS,RX_VK_RT_REFL_METAL_ROUGH,RX_VK_RT_REFL_NEAR,RX_VK_RT_REFL_NEAR_FAR,RX_VK_RT_REFL_OWN,RX_VK_RT_REFL_PROBE,RX_VK_RT_REFL_RAYS,RX_VK_RT_REFL_RES,RX_VK_RT_REFL_ROUGH,RX_VK_RT_REFL_SCREEN,RX_VK_RT_REFL_SHEEN,RX_VK_RT_REFL_SHEEN_BITS,RX_VK_RT_REFL_SHEEN_SHARE,RX_VK_RT_REFL_SHEEN_TINT,RX_VK_RT_REFL_SHARE,RX_VK_RT_REFL_STEPS,RX_VK_RT_REFL_STRENGTH,RX_VK_RT_REFL_STRIDE,RX_VK_RT_REFL_SUN,RX_VK_RT_REFL_THICKNESS,RX_VK_RT_REMEMBER,RX_VK_RT_REMEMBER_SKINNED,RX_VK_RT_SCENE_EARLY,RX_VK_RT_SCENE_LOG,RX_VK_RT_SCENE_SPV,RX_VK_RT_SCRATCH_MB,RX_VK_RT_SHADOW_BIAS,RX_VK_RT_SHADOW_DIST,RX_VK_RT_SHADOW_MASK,RX_VK_RT_SHADOW_RAYS,RX_VK_RT_SHADOW_SLOPE,RX_VK_RT_STATIC_MAP,RX_VK_RT_STATIC_MESH,RX_VK_RT_STATIC_MESH_MB,RX_VK_RT_SUN_CUTOUT,RX_VK_RT_SUN_FADE,RX_VK_RT_SUN_GATE,RX_VK_RT_SUN_GATE_FAR,RX_VK_RT_SUN_KEEP,RX_VK_RT_SUN_LOG,RX_VK_RT_SUN_SOFT,RX_VK_RT_SUN_TILT,RX_VK_RT_SUN_TURN,RX_VK_RT_TERRAIN_MASK,RX_VK_RT_TINT,RX_VK_RT_TINT_PROGS,RX_VK_RT_TINT_SHEEN,RX_VK_RT_TUNE,RX_VK_RT_XFB,RX_VK_RT_XFB_DUMP,RX_VK_RT_XFB_MASK,RX_VK_RT_XFB_MBdocs/ray-tracing.md; the head of each part's.cppfile)Documented in
docs/ray-tracing.md, indocs/development.md("The GPU") and in the README's option table, and each has its row ingpu/vk/switches.def(160 rows; the light mask's tuning switches are named whole inkNamedso the table's check sees their reads).Screenshots
The Graphics tab's Ray tracing (Experimental) rows (this PR's build):
The same spot and frame, the feature off (left) and on (right), 4K on an RTX 5090, from the parts' development builds (this PR's code; the sun shadow ones also carry the static shadow map's casters, still in testing).
Sun shadows (
RX_VK_RT=2against 0): each clover leaf, grass blade and fence slat casts its own cut shadow where the game's maps give soft patches.In Kokiri Forest, leaf-over-leaf and stem shadows inside the plant, which the game's cascades don't resolve:
GI (
RX_VK_RT=4against 0): light bounced from lamps, doorways and lava into what the game leaves near black.AO (
RX_VK_RT=9, AO and reflections, the AO switched off and on in the same frame): under the bedside table, behind its legs and where the bed meets the floor, the traced AO shades what the game's SSAO leaves light.The occlusion buffers of one frame (not the final picture), the game's SSAO left and the traced AO right: the game's is grainy, haloed round the table and fades out with distance; the traced one is clean and holds at any distance.
Reflections (
RX_VK_RT=9, the reflections switched off and on in the same frame): water takes what is really around it instead of the game's fixed environment picture.Testing
Tested:
python -I -B tests/run_all.pyon Windows (llvm-mingw and the Vulkan SDK on PATH, the renderer build's variables set), this branch rebased onto main544229a2: 643 passed, 44 failed, 45 skipped (the same 44 on54ef5ca3). main54ef5ca3in the same environment on this PC: 630 passed, 45 failed: the same 44 (test_auto_handheld, test_bug_report_defaults, test_cpu_report, test_crash_dialog, test_crt_options, test_damage_debug_menu, test_display_startup_failure, test_dlss_feature_size, test_failed_compile_keeps_objects, test_finish_output, test_framegen_preset, test_fsr_uniform_ownership, test_guest_imported, test_hud_layout_row, test_import_reach, test_invalidate_vcore, test_job_queue, test_linux_preflight, test_linux_pressure, test_mirror_budget, test_missing_nup, test_pads_after_menu, test_parallel_init_order, test_pending_guest_import, test_perf_report, test_pipeline_play_cache, test_present_thread, test_profiling_mode, test_readback_timeout_source, test_recorder_sync, test_replay_write_order, test_rumble_menu, test_run_all_changed, test_slow_frames, test_staging_burst, test_switch_table, test_target_image_pool, test_tested_configurations, test_upscaler_round_trip, test_upscaler_rows, test_vcore_escape, test_vk_occlusion_queries, test_vk_swapchain_compat, test_walk_key) and test_longshot_ctl, which times out at times when the tests run 16 at once. test_switch_table fails on main too, forRX_VK_PGO_FILE, which onlynx2/build.pypasses to the compiler; with that name left out it passes here with the 160 ray tracing rows.e9518463tof70c348d, all four rows on, by day and at night in Kokiri Forest, the Deku Tree, the Market, the Temple of Time, Kakariko, Hyrule Field and Zora's Fountain: it works. That driver has noVK_EXT_opacity_micromap, so it ran the path without micromaps throughout; their fixes from that run (the bottom levels' budget by video memory, position fetch apart from micromaps, cut-outs tested in the rays withRX_VK_RT_ALPHA=1) are in this PR as their own commits. Their report also names what is still off on that card: reflections of hits off the screen are flat colours, and a first start with the rows on built pipelines for about 17 minutes.make_game.py) at d34ac44b, an earlier push of this branch on main26ce01b5, in about 40 runs on 16 Nov (the measurements, GPU-assisted validation of both paths, the parts switched live in Kokiri Forest, the Market, Kakariko Village and Lake Hylia): one device lost, with the rows off (Measurements); the later commits' alignment fix passed its own GPU-assisted run.1327215a,94f6920f,e7cc11df), on Windows 11, RTX 5090: Kokiri Forest by the houses, with Foliage distance at 125% (a graphics option from outside this PR, in a local build that has it), was 10.7 fps against 42 at 100%, with huge sun shadows flickering over the area: falling leaves and faded mesh-shader foliage had corners parked off the view, unprojected to far places, so triangles spanning the area. With the fix, 38.8 fps at 125% against 40.1 at 100%, the rays' pass 0.46 against 0.44 ms. A regression check withRX_VK_RT_MESH_EDGE_CTL(switched live, the camera still): at Foliage 100%, in Kokiri Forest (three views), the Lost Woods, the Sacred Forest Meadow, Hyrule Field and Kakariko Village, the sun and AO views with the check off and at 30, 8, 4, 2, 1 and 0.05 m differ no more than two shots with it off do (wind sway): no tree or shadow goes missing. Live at 125%: check off 13.7 fps with the huge shadows, on 42 fps. The game-free checks on this head against the head before it, in the same environment: the same 641 passed and the same failing tests.scripts/check_guide_screenshots.py --review-sources:settings-graphics.pngnow also namesvk_menu.cppandvk_menu.h(main already names four other files for it). The new section is at the end of the Graphics tab, below Anisotropic filtering, far below what the image shows, so the image still matches; the review record is left for the documentation maintainer with main's four.Not tested:
Must be tested:
vk: rt:lines saying the scene is kept as acceleration structures (Test Farm: @Beanstalk ray tracing rows on, Kokiri Forest and Lake Hylia, RDNA 2 or newer)vk: rt:lines and the picture)Risks
What could break: with the rows on: a device lost or a hang on a driver this was not run on; a long first start while the patched lit programs' pipelines are built (about 17 minutes on Drommedhar's RX 9070 XT, about 3.5 later; the game draws what is ready meanwhile); wrong shading where the patched lighting programs meet a program the patch did not expect (it only patches programs it recognises, and leaves the rest as they are); memory (about 365 MB of images for AO and sun shadows at 4K, plus the structures). With the rows off: nothing should change; the hooks are behind
rt::on(), one load. Parallel replay is off while ray tracing is on, which costs CPU time on PCs that use it.Turning it off: the four rows (off by default), or
RX_VK_RT=0for a run.Compatibility: saves unchanged.
longshot_options.inigains the ray tracing rows' keys, written only when the menu saves. The shader and program caches are unchanged (the patch is applied when a module is made, after the cache); with GI or reflections on, the driver's pipeline cache builds the lit programs again on the first run. The vk ABI (MKWVK_API_VERSION) is unchanged. The builder's tools are unchanged.Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.docs/tested/for each new measured run (format indocs/tested-configurations.md).tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
New commit
1ffa9e4: the traced sun shadow is now added to the game's instead of replacing it (RX_VK_RT_SUN_KEEP=1, the default;=0is the previous behaviour).Why: the rays alone miss casters the game's shadow maps have. With native mesh shaders the plants can't be captured into the acceleration structure, so 15 % of the Kokiri spawn's picture was game shadow the rays left lit (5.8 % with
RX_VK_MESH_SHADERS=compute). The static map's channel now takes the darker of the game's value and the traced one under the sun gate; the cascades' channel stays the game's.Measured on the same frames (4K dumps, RTX 5090), share of the picture, lost shadow / lost sun, before -> after: native Kokiri 1.7 -> 0 % / 1.9 %; compute Kokiri 5.8 -> 0 % / 7.3 -> 7.7 %; compute gorge exit 1.1 -> 0 % / 1.8 -> 2.1 %; native gorge 0 % / 0.9 % and Lake Hylia 0 % / 8.9 % unchanged (the far cliffs past the cascades' reach: being worked on). Also checked:
RX_VK_RT_OMM=0runs the plain (no micromap) ray-query shader with no errors.Checks after the commit:
tests/run_all.py540 passed, 18 failed, the same 18 as main on this PC.docs/ray-tracing.mdupdated.New commit
801b951: the traced sun shadow takes the place of the game's by default again. Adding it on top of the game's (RX_VK_RT_SUN_KEEP=1) is now only a debug switch, to see what the rays miss.The goal is ray-traced sun shadows for every caster. What's missing for that in the default (native) mesh mode is the plants: their geometry comes from mesh shaders and isn't captured into the acceleration structure yet, so their shadows still come from the game's cascades (with
RX_VK_MESH_SHADERS=computethey are traced). Capturing them in the native mode is what's being worked on next.New commit
6228330: the mesh-shader plants (grass, ferns, flowers, tree leaves) are now in the ray tracing structure in the default native mesh mode, not only withRX_VK_MESH_SHADERS=compute.How: after a native task/mesh draw of the depth pre-pass or a sun cascade whose bottom level is due (every 4th frame per draw,
RX_VK_RT_MESH_EVERY),draw()runs once more with the program's compute fallback variant, for capture only: its task and mesh stages write the records the bottom level is built from, nothing is drawn, and the cards are cut by opacity micromaps as in compute mode.RX_VK_RT_NATIVE_MESH=0turns it off. The capture helpers sit beforewrites_memory()invk_draw.cpp, andtests/test_draw_side_effects.pystubs the two calls the readiness block makes.Kokiri Forest, native, RTX 5090: leaves and grass in the structure, 23 mesh draws a frame, about a quarter captured each frame, none left out; no device lost, no validation line. A first uncapped sample with the capture: median 320 fps, 1.8 ms GPU; the comparison against native without capture and compute mode is running. The first native run in an area compiles the fallback variants (a slow first minute).
Next: the sun shadow pass uses the captured plants in the native mode too, so every sun shadow is traced. Checks after the commit:
tests/run_all.py540 passed, 18 failed, the same 18 as main on this PC.New commit
3f68dfd: GI's passes cost 0.94 ms at 4K on the RTX 5090 (were 1.4 ms), with no visible loss in the irradiance pictures compared.What changed: one ray a half-size pixel and a 3 x 3 a-trous filter by default (
RX_VK_RT_GI_RAYS=2andRX_VK_RT_GI_KERNEL=5give the old settings), and a hit's own sun ray is traced only where neither the screen nor the world-space cache knows the hit. Timing from the pass report: filter 0.39 -> 0.16 ms, rays 1.0 -> 0.51 ms.Stability was measured too (
RX_VK_RT_GI_STABLE=1logs it): the GI term changes about 6 % a frame with the camera still and 10-12 % while turning, which is below the game's own lit colour (10-16 %, partly its TAA jitter). More rays, a longer history or more filter steps barely moved it, so it is not ray noise;RX_VK_RT_GI_HOLDandRX_VK_RT_GI_FEEDBACKare history switches for testing that.Checks after the commit:
tests/run_all.py540 passed, 18 failed, the same 18 as main on this PC.docs/ray-tracing.mdupdated.New commit
0b32254, two small ones: GI gets an area row for Death Mountain Trail (its light-mask program is its own), and a place with no row now takes the switches' values instead of the previous area's; the scene's status line counts the sun cascades' draws left out of the structure, by reason, and names their programs once. GI was also checked at Death Mountain Trail, Zora's Domain and the Market.Checks after the commit:
tests/run_all.py540 passed, 18 failed, the same 18 as main on this PC.Rebased onto current main (
aa95d35, after v3.0.0-rc.4); force-pushed. One conflict:tests/test_menu_sections.py, where #735 removed the VRAM budget row next to the new Ray tracing rows; resolved by keeping both changes. The renderer builds, andtests/run_all.pygives 540 passed, 18 failed on both mainaa95d35and this branch, the same 18.0b32254dd7b4e2584ed3New commit
aa8853a, reflections:RX_VK_RT_REFL_SHARE, default 2). For the material-F0 class each pixel traces 2 rays and the 2 x 2 quad averages them, so rough plate armour (Kakariko's guard) is smooth and as steady frame to frame as the game's own, where 1 ray a pixel left blotches. A device without quad operations in fragment shaders gets no reflections, and the log says so.The SPIR-V linker check passes (20 modules, 0 invalid). Checks after the commit:
tests/run_all.py540 passed, 18 failed, the same 18 as mainaa95d35on this PC.docs/ray-tracing.mdupdated.New commit
fb96265: the traced sun shadow now replaces the game's for every caster, in the default native mesh mode too.6228330), as in compute mode, so leaf and grass shadows are traced by default.RX_VK_RT_SUN_FADE).Native mode, one frame per view at 4K, share of the picture (lost shadow: the game shadows, the rays don't / shadow the game lacks):
The gate fired in none of the five. What is left is not a missing caster: scattered bits at Kokiri (leaf surfaces drawn at another level of detail, thin edges), and at Lake Hylia a band along shadow edges where the game's blurred static map reaches further than the traced edge. The Graphics menu's help, the README and docs/ray-tracing.md no longer say leaf shadows need the compute mesh mode. Not checked yet: the night (moon) and held items.
Checks after the commit: the renderer builds,
tests/run_all.py540 passed, 18 failed, the same 18 as mainaa95d35on this PC.Pushed
34cfe3f: every caster the game's sun cascades draw is now in the ray tracing structure in the areas checked (Kokiri Forest, the Hyrule Field gorge, Lake Hylia, the Lost Woods, inside the Deku Tree).VK_EXT_transform_feedback, then turned into world triangles every 4th frame. The status line's count of cascade draws left out there went from 5.5 a frame to none; the same particle captured from two cascades lands at the same world position.RX_VK_RT_XFB=0turns it off, and a device without the extension goes on without it.clock=<hour>(a test aid for night runs, through the Cheats page's clock action). At 22:00 the traced sun shadows follow the moon's cascades and GI brightens by 12-22% with nothing darker.tests/test_fallback_pipeline_state.py's fixture declares the new variablebuild_graphicsreads.Checks:
tests/run_all.pyon Windows, the same failures as mainaa95d35(machine-specific) plus the two that fail under load here (test_dev_packs,test_finish_output); the renderer builds with 0 failures. Still WIP: the measurements are taken once at the end.Pushed
51e66ed: a fix to the sun gate for interiors.RX_VK_RT_SUN_TILT,RX_VK_RT_SUN_TURN), used to show that the remaining band at Lake Hylia is the game's cascade edge, not a wrong direction.Checks: the same as the last push (main's failures plus the two that fail under load here); the renderer builds with 0 failures.
Pushed
da83010: interiors keep their roofs in the structure, and the caster count is honest on a first visit.RX_VK_RT_REMEMBER=0turns it off. The gate fix of the last push stays as the safety net.Checks: as before (main's failures plus the two that fail under load here); the renderer builds with 0 failures.
Pushed
dd2361band 1d7f2ce: the particles cast on an area's first visit.program_cache_savenow hands each translated program's SPIR-V tort::scene_program_translated, which keeps the vertex stages of the programs that would be captured (at most 512) and makes the capturing module at the first capture. Lost Woods withRX_VK_NO_PROGRAM_CACHE=1(every program translated in the run): 4 of 4 stages made from memory, no cascade draw left out.Known open, being worked on: static-map shadows whose casters are out of the camera's view (a mound by Link's house in Kokiri, a cliff over Kakariko's terraces) are lost with the traced shadow in the static map's place; the fix is capturing the static shadow map's casters into the structure.
Checks: as before (main's failures plus the two that fail under load here); the renderer builds with 0 failures.
Screenshots, same spot and frame, the feature off (left) and on (right), 4K on an RTX 5090, one part on at a time, from the parts' development builds (this PR's code; the sun shadow ones also carry the static shadow map's casters, still in testing). AO and reflections follow.
Sun shadows (
RX_VK_RT=2against 0): each clover leaf, grass blade and fence slat casts its own cut shadow where the game's maps give soft patches.GI (
RX_VK_RT=4against 0): light bounced from lamps, doorways and lava into what the game leaves near black.2a46f56f52f8ddebbc6eRebased onto
main@bbe6fdf2. No tests were run here; the test boxes stay yours. No conflicts.Pushed
1cef082,aae9b5e,4c8b00dand3add916on top of HumanBean's rebase (thanks). Update from an in-game test session:RX_VK_RT_SHADOW_BIASandRX_VK_RT_SHADOW_SLOPEnow default to 1 and 1 (were 2 and 3). Kokiri spawn, one frame, texels the game shadows but the rays lit, 6 to 20 m: 4.0 % before, 1.1 % after; 20 to 60 m: 5.3 % to 1.6 %. No acne on Kakariko's walls, steps and rocks or on Kokiri's ground.RX_VK_RT_REFL_SCREEN=1brings the screen-space hits back for comparison.After the rebase onto main, the checks show 18 failures on this PC, all of which fail on main as well,
test_vk_occlusion_queriesamong them (its wiring check looks for the recording-end barrier inmaybe_split, which moved tosplit_part).test_linux_pressure, new on main, needed this PR's ray tracing stubs (3add916).Two corrections to earlier comments: the commit that stubbed the program cache fixtures is
2a46f56(f8ddebbafter the rebase), not 1d7f2ce; and for Lake Hylia only the sun's elevation was checked, not its full direction.Pushed
a1a6cbcande951846, more from the same in-game test:RX_VK_RT_GI_SELF), so a clump keeps the game's ambient and a corner's bounce past 15 cm stays. GI's overall lift at the Kokiri spawn is +1.5 luma levels instead of +2.2.o + 1.5 o^2of the traced occlusion (RX_VK_RT_AO_CONTACT), the depth march's hit weighs 0.3, and the AO's rays leave the foliage out. Where the game's SSAO is under 0.5 in a Kakariko house, the traced AO now reads 0.27 (SSAO 0.34, before 0.49); open walls and lightly covered ground stay as they were.Checks: 18 failures on this PC, the same set as main.
AO and reflection screenshots, same spot and frame, the feature off (left) and on (right), 4K on an RTX 5090, cropped at 2x, from the parts' development builds (this PR's code: AO with the contact term of
e951846, reflections with no screen-space hits and the max roughness row at Medium).AO (
RX_VK_RT=9, AO and reflections, the AO switched off and on in the same frame): under the bedside table, behind its legs and where the bed meets the floor, the traced AO shades what the game's SSAO leaves light.The occlusion buffers of one frame (not the final picture), the game's SSAO left and the traced AO right: the game's is grainy, haloed round the table and fades out with distance; the traced one is clean and holds at any distance.
Reflections (
RX_VK_RT=9, the reflections switched off and on in the same frame): water takes what is really around it instead of the game's fixed environment picture.The game draws its 12288 x 12288 static shadow map (D16) once, while an area loads: some 2000 to 3600 depth-only draws in a frame or two, with no scene yet, so the cascades' rule ("no scene this frame: a cascade of nothing we trace") left them all out, and what the camera never shows and no cascade reaches was in no top level (the mound's shade by Link's house, the cliff's across Kakariko's terraces: mask's lost shadow). They are now noted as the cascades' draws are (models by their object block, the height-field patches) and kept in a set of the area's own, placed every frame as kBlocker / kCaster like a cascade's draw, a caster once by its geometry and place. The set is let go when the map is drawn again after a pause (another area). Their mesh draws (24 to 56 a batch) are not captured. RX_VK_RT_STATIC_MAP=0: not taken. The status line says the batch: its draws, the casters kept. Kakariko: 1966 draws, 1830 casters kept (109 terrain patches), none left out but 24 mesh draws. Kokiri: 3629 draws, 3560 kept. Kokiri spawn: agreement with the game's depth unchanged (89.4 %), 4561 instances a frame (1197 without), 116 MB of bottom levels (43). Co-Authored-By: Claude Opus 5.5 <[email protected]>Pushed
655adcf,068650c,5df3d0f,f51b339,4ebfcbcand6f19017:068650c) are now captured then and kept, so what casts the game's far, static shadows also casts the traced one, wherever the camera looks. Switches:RX_VK_RT_STATIC_MAP,RX_VK_RT_STATIC_MESH,RX_VK_RT_STATIC_MESH_MB.RX_VK_RT_REMEMBER_SKINNED), so they keep casting and reflecting after the camera turns away. With the static models already kept (the Know-It-All brothers' door lanterns are static cutout models), this answers the in-game report that the lanterns vanished from the river's reflection as they left the screen.4ebfcbc,6f19017). The game has no emissive texture: its lanterns glow through a light inside the object (c5[106]times a mask texture's red channel and a falloff). The scene now keeps that as a second block of material records, per geometry, and a reflection hit adds it, so the Kokiri door lanterns reflect in the stream the same whether they are on screen or not (RX_VK_RT_EMISSION_GAINandRX_VK_RT_REFL_GLOW, both 1; at 4 the lanterns' flicker breaks into orange specks on the ripples). Placements of one geometry within 2 cm are placed once (RX_VK_RT_NEAR_DEDUPE=0turns it off): the duplicate instances at three test spots go from 83 / 116 / 130 to 44 / 73 / 81, with the one-frame lost sun shadow unchanged (Kokiri spawn 1.8 % either way, Kakariko gate 1.5 / 1.4 %).068650calso addsgpu/vk/shaders/rt_scene_build.sh, which regenerates everyrt_sceneSPIR-V header (byte for byte the committed ones), and gives the static pool its own push fields.The static map's casters and the out-of-view skinned objects, on the parts' development branch, ran once under GPU-assisted validation on this PC: no out-of-bounds, invalid-address or device-lost report.
Pushed
5821699: the reflections' material-F0class (armour and glass, but also cloth: banners, bunting, tunics) no longer traces up to roughness 0.65 with 2 rays at Medium. At Low and Medium its cutoff is now the same as everything else's (0.2, 0.35); High widens it to 0.65 and Max to 1, so rough metal still reflects there. At the Market gate the GPU pass time goes from 6.28 ms a frame to 4.78 (off: 2.99; a second run 6.30 / 4.79), with no local difference in the picture.Pushed
500a01a: the traced sun shadow now takes the game's place at every distance. It used to hand back to the game's own value from 60 to 120 m of view depth (RX_VK_RT_SUN_FADE, now 0 by default; 60 brings the handover back). Past the game's own shadow, which ends near 120 m, the rays shadow far cliffs the game shows lit; under the fog this doesn't show in the final picture. Of the texels past 60 m, the share the rays shadow and the game lights: Lake Hylia 43 %, Kokiri 13 %, Kakariko 6 %, the castle gate's field 5 %, Gerudo Valley 1 %. No stray caster was found: the castle, hedges and canyon walls agree with the game.Pushed
ba1c755,e512c96and1173c39. Two of these fix device losts found in testing tonight; the RT rows are off by default, so nothing changes for anyone who hasn't turned them on.e512c96). The static shadow map's casters, kept for the area since655adcf, were rebuilt every frame from the guest memory they were captured from whenever that memory had been written since. After a teleport that memory holds the next area's data, so the bottom levels were built from another area's bytes as indices (pastmaxVertex): white blown-out ground, holes in a character, and on two runs a GPU page fault (VK_ERROR_DEVICE_LOST) at the next area's first frames. A kept note that wasn't drawn this frame is now never rebuilt from rewritten streams: one noted before the last loading screen is let go, and one of the current area has its indices checked on the CPU against its vertices first, and is let go if any reaches past them. Kokiri -> Kakariko -> Market in one run: 2844 and 122 stale casters let go at the arrivals, no corruption, no device lost.1173c39). A further run lost the device at the Market at the first draws taken by transform feedback (cascade particle draws, their capturing vertex stage made from SPIR-V in memory). The same route with the capture off ran clean, so it is off by default until the cause is found (RX_VK_RT_XFB=1turns it on for testing). Particles such as the Lost Woods' falling leaves are out of the structure meanwhile.ba1c755). An instance kept from the static map or remembered from an earlier frame is not placed again where the same geometry is drawn this frame within 2 cm and 0.05 of rotation: the same-geometry duplicates at the Kokiri spawn go from 30 to 0 a frame, with the one-frame lost sun shadow unchanged (1.7 % at the Kokiri spawn, 1.4 % at the Kakariko gate).Pushed
2f3f348,44d9788,83b1760,8d674ef,6d6c25f,a96fd3e,531f118andd16c17e. AO first (2f3f348,44d9788,83b1760): the traced AO now goes into the game's own SSAO image, and the game's SSAO dispatches (a generate and four blurs) are left out, so their cost goes away and the game's combine upsamples and blends the traced AO as its own. The approach comes from #815 by JayDeGoodz (thanks); the code is our own.RX_VK_RT_AO_INTO_SSAO=0brings back the previous write over the light mask's AO channel. The Ray-traced ambient occlusion row now has quality steps: Off, Low (half size, 1 ray), Medium (half size, 2 rays), High (full size, 1 ray), Ultra (full size, 2 rays, the previous On).Measured at 1280x720 scene size on an RTX 5090 (one report each, so differences under ~0.1 ms are noise): Kokiri spawn, ms a frame in all, old path 12.82, Ultra 11.32, Low 11.28, AO off (the game's SSAO) 11.25; Kakariko's entrance, old path 10.43, Ultra 10.52, Low 10.38, off 10.36. The pictures match the old path apart from moving things. One run under GPU-assisted validation with four Kokiri -> Kakariko teleports: only the known messages, no device lost.
An options file saved with the previous Off/On row loads its On as Ultra once (
options_version7,83b1760;tests/test_ao_steps_saved.py), so nobody's AO quietly drops to Low.The rest:
8d674ef: the sparse pool mirrors are made withpool_usage(), which addsACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLYwhen ray tracing is supported (validation reported VUID 03673 for bottom levels built from them).531f118: a particle draw's occlusion query now ends before its transform feedback capture, which ends the pass and records compute work; before, the query ended outside the pass it began in (VUID-vkCmdEndRendering-None-06999). It is a real spec violation but not the whole cause: a validation run with the capture on still lost the device, and showed the capture's commands recorded from another thread into a command buffer that holds neither its pass nor its pipeline (a pending capture shared between the replay and recorder threads). The capture stays off by default while that is fixed.6d6c25f,a96fd3e:RX_VK_RT_XFB=2, a test mode that writes the capturing vertex stages' SPIR-V and never draws with them (the dumped stages passspirv-valwith the translator's layout options; the patch only adds the TransformFeedback capability, the Xfb mode and the position's Offset / XfbBuffer / XfbStride).d16c17e: the AO's write into the SSAO image is listed intests/test_drawn_page_map.py, and the roughness row's override switches are read as values (tests/test_env_on.py).Pushed
9a818a6,90228f4,de654afand9f05136.90228f4: the static shadow map drawn again in part (the Market and Kakariko redraw a few to a few dozen of its draws now and then, with no loading screen) adds its casters to the area's set instead of replacing it; the same caster is kept once, and the part's mesh draws are not taken again. Only a map drawn after a loading screen replaces the set, and past 25000 casters it starts again. Over a stress run Kokiri -> Kakariko -> Market -> Kakariko -> Market (transform feedback off): the Market keeps 1572 to 1600 casters (37 before, after its 1572 -> 3 -> 3 -> 33 redraws), Kakariko 1830 to 2000 (164 before); each loading screen still lets the area before go. No device lost.9a818a6: the cause of the transform feedback capture's device lost. With threaded rendering (RX_VK_RECORDER=thread) every recorded call is a packet the recorder thread runs later, but the capture's bind, begin and end went through their extension pointers straight into the command buffer from the replay thread, ahead of the queued pass begin, the capturing pipeline's bind and the draw, while the recorder was using the pool. That matches every message of the validation run. They now wait for the recorder first (boundary(B_DIRECT), as the structure and micromap builds already do;tests/test_recorder_sync.pychecks them), and a capture asked for is the asking thread's own. Built, not yet run with the capture on:RX_VK_RT_XFBstays off by default until a validation run with it on has passed.de654af: docs for both.9f05136: the static map's batch line in the log says what a part drawn again added.Checks: the same 18 failures as main.
Pushed
2b38254and07a98b9. A scene that draws no static shadow map of its own (the drawbridge past the Market) kept the last few dozen casters of the area before, those whose memory the new scene had not rewritten, so they could shade a place they are not in. Now, 30 frames after a loading screen that let casters go with no new batch, those are let go too (tests/test_rt_static_orphan.py); a pause with no loading writes nothing and keeps the area's set, which the game does not draw again. The stale-stream guard is unchanged. Stress run Kokiri -> Market -> drawbridge -> Market (transform feedback off): Kokiri 3560, the Market 1556 then 1564 as parts were drawn again, the drawbridge 41 -> 0, the Market 1596 again; no device lost.On
90228f4(the static map drawn again in part), a walk in Kakariko now goes 1830 -> 1860 -> 1865 casters where the build before went 1830 -> 277 -> 243; one frame's area of lost shadow 1.1 % against 2.4 %. A moving-camera survey (Kokiri, Kakariko, the Market, Lake Hylia) found nothing to fix, and with the camera still the frame-to-frame luma change is no higher with ray tracing on (Kokiri 2.03 on, 2.07 off; the Market 0.66 on, 0.85 off; 0-255, shots ~0.3 s apart).Checks: the same 18 failures as main.
Pushed
f7177fd: reflections share a ray in a 2 x 2 quad only when the pixel's vector is within two pixels' angle of the quad leader's (the pixel angle from the view rays' screen derivatives, so it holds at any size; on a rough surface also within half its blur lobe, 0.5 x roughness² x cone). The test before was vectors within 18 degrees, and rippled shallow water turns its vectors by a few degrees from one pixel to the next, so whole quads took one answer: blocky grey stair-step reflections of the rocks along the Kokiri stream's edge, reflections only. Same camera at that spot, switched live:RX_VK_RT_REFL_SHARE=3(the old test) shows the tiles, the new default 2 is smooth and matches 0 (no sharing); at the Market gate 3, 2 and 0 look the same on the floor and the guard's armour. No device lost. Rippled smooth water now traces up to 4 times the rays it did there; the cost is being measured and will follow.Checks: the same 18 failures as main.
The cost of
f7177fd(reflections' quad sharing within two pixels' angle), at a 4K output with DLSS (scene 2560x1440), RTX 5090, Link standing in the Kokiri stream looking down so rippled traced water fills about 60 % of the picture (about the worst view there is): whole frame 13.58 / 13.58 ms with the old test (RX_VK_RT_REFL_SHARE=3) against 14.02 / 14.05 ms with the new one, +0.46 ms, all of it in the lit pass that holds the water. A limit of 4 pixels' angle would save 0.04 ms of that, 8 pixels 0.17 ms (one report), so the limit stays at 2. At 1280x720 the same spot costs +0.10 ms, and the Market gate shows nothing measurable.Pushed
e56b6d82: GI on hair cards that keep no history. In Dodongo's Cavern's dark south-west room, lit by the fairy alone, Link's fringe showed gold specks with GI on, a new set every frame, none with GI off: a hair texel's rays mostly end on the hair itself and count for nothing (RX_VK_RT_GI_SELF), so it is dark unless its one ray gets out and brings full light back, the cards fail the history's depth and normal tests every frame so nothing averages that out, and the upsample, finding none of the four half-size texels on the pixel's surface, normalised tiny weights and picked one almost at random. Now a pixel with under 3 frames of history takes the same-surface mean of this frame's rays (5 x 5, two apart, itself in; surfaces with history are as before,rt_gi_temporal.comp), and the upsample's texel weights have a 0.02 floor (rt_gi_upsample.comp). Same spot and camera, five GI off/on pairs a run: specks on the fringe (pixels 35 over their 7 x 7 median), on minus off, +100 before, -10 after; Kokiri's spawn and Kakariko's entrance look the same as before. One run under GPU-assisted validation: only the known messages.Interiors with GI off and on and turning frames, nothing else found: Link's house, the Kokiri shop, the Know-It-All brothers' house, a Kakariko house's upper floor, Dodongo's Cavern's west and south-west rooms; Link's hair under his house's lamps is clean. GI's cost, RTX 5090, 1280x720 scene (4K output with DLSS), one report each (noise 0.1-0.3 ms): the traced passes +0.11 to +0.18 ms, the whole frame +0.12 (Lake Hylia) to +0.53 ms (Dodongo's hall); Kokiri +0.22, Kakariko +0.24, the Market +0.42, Death Mountain Trail +0.24, the interiors +0.18 to +0.32.
Checks: the same 18 failures as main.
Pushed
55fede0: a reflection's hit lit flat (one the kept picture does not have) is no brighter than 1.5 times the kept picture's light around its place, read at a coarse level (RX_VK_RT_REFL_BOUND, 0: no bound). It was lit by the whole picture's mean, and under the Kokiri canopy's bright haze and light shafts a sun-facing pebble a few centimetres off the water came out about 2.5 times that: white chips, and silvery sheets over much of the shallow water, beside the dim pebbles the picture shows. Same camera at the stream's edge, switched live: 0 shows the chips and sheets, 3 leaves pale sheets, 2 is calmer, 1.5 matches the surroundings; at the Market gate 0 and 1.5 look the same on the street, the guard's armour and the gate door. No device lost. The description's list of tuning switches also gains the 15 that were missing.Checks: the same 18 failures as main.
Pushed
02fbf76: the Reflections: max roughness row's Medium step (the default) keeps the material-F0class (armour, glass, water, cloth) tracing up to roughness 0.65, as before the row.5821699had dropped it to 0.35 at Medium to stop banners, bunting and tunics tracing for nothing visible, but the guards' plates take the ground only at 0.65 (hardly at 0.5, not at 0.35), so at the default their reflections were gone. It costs about 1.5 ms a frame at the Market's gate (the reflections' pass 6.28 ms against 4.78 at 0.35); Low still drops the class to 0.2, High and Max are as they were.Checks: the same 18 failures as main.
Pushed
bb9279d: 55fede0's bound on a reflection's flat-lit hit (no brighter than 1.5 times the kept picture around it) also bounded the hit's own emission, so a lantern reflected over dark water was cut to the water's brightness and the Know-It-All brothers' lanterns were gone from the Kokiri stream (seen in play). The bound now applies to the light the hit takes (its albedo lit by the ambient and the sun), and the emission is added after it.Checks: the same 18 failures as main.
Pushed
b5b51c0and68f4e54: a rupee's material record carries its colour. In play the green rupee by the Kokiri stream reflected as a grey-white shape. Its program (a5ab9e9efb5f0553) takes its albedo assaturate(texture * c5[32..34])(green 0 0.29 0, blue 0.014 0.05 1), and its record was the mean of the pale gem texture alone, which reflections and GI read for a hit the kept picture does not have. For the programs listed inRX_VK_RT_TINT_PROGS(the rupees' by default;RX_VK_RT_TINT=0none) the record is now the mean times that tint, one record per geometry and object block so a green and a blue rupee of one geometry keep their own (tests/test_rt_material_tint.py). It is not read for every program, because the same words are integers or other values elsewhere. InRX_VK_RT_DEBUG=tlasm(the records as hits use them) the rupee goes from grey-white to green; the Market differs on 1.3 % of pixels, all moving things. No device-address reads added; no device lost in 14 runs. Hearts and other drops are not checked yet (none reachable in this save).Checks: the same 18 failures as main.
Pushed
b4207e3andbec545f: a reflection's hit on a material that lights itself takes its colour from the kept picture where its place was drawn at its depth (the screen hits' test), and is lit flat only off the picture. Seen in play: with screen-space hits off (the default) every top-level hit was lit flat, so the rupee came out dark green (its record is the tint times the gem's mean; its program draws lighting times the tint plus a texture times 30, timesc5[106]) and the Know-It-All brothers' lanterns a fraction of what the game draws. Self-lit means the emissions' block has w > 0 for the record: 1 a glow, as before, 2 a tinted program's own shading (rt_scene_mean.compmarks tinted records).RX_VK_RT_REFL_OWN=0lights them flat as before. The hit-kind view shows kept-picture hits only with it on; the Market's gate and the Kokiri stream's white-chip spot are unchanged apart from moving things; no device lost.Also from today: a solo core-validation run with
RX_VK_RT_XFB=1on this branch's68f4e54(Kokiri -> Market) passed: no device lost, none of the transform feedback VUIDs from the run that lost it (04128, the render pass ones, 02323, the threading write, 06999), two capturing stages made at the Market. A normal pair with it off and on lost nothing either. It stays off by default for now.Checks: the same 18 failures as main.
Pushed
63d5eb9andf70c348: a material block whose glow words are all their defaults (intensity, power, radiusc5[72]and colour exactly 1) writes no glow record. Link's tunic, arms and boots carried a grey 0.5 glow (seen inRX_VK_RT_DEBUG=tlase), so their reflections off the picture got white added and, withb4207e3, counted as self-lit. The lanterns' radius is 0.09 to 0.12 and their power is not 1, so they keep theirs; in tlase at the Know-It-All brothers' house Link goes from white to his own colours and the lanterns glow as before (tests/test_rt_emission_defaults.py;RX_VK_RT_EMISSION_DEFAULTS=1brings the old records back). No device lost. Link's hat and the river still show in tlase from another record, not looked at yet.Also checked today: the falling leaves at Kokiri cast no shadow with ray tracing off either; the game draws them into the lit picture after the lighting, with no cascade draw, so taking them in would be a new caster, not a fix.
Checks: the same 18 failures as main.
theguyser referenced this pull request2026-11-16 13:51:42 +00:00
Pushed
e4e1e01,e1fb065,e50af55and97242ce: rupees.e50af55: a gem's sphere map is traced. The rupees' program (a5ab9e9efb5f0553, ande2bb45349c57c184with the same pattern) addsc5[106] x 30 xa grey sphere map looked up by the view-space normal: a fixed highlight.rt_refl_spirv.hfinds a 2D sample whose r, g and b are each multiplied by 30 and callsrt_refl_sheen()after it: one mirror ray off the facet (the normal from the position's derivatives, no cone) through the reflections' own lookup, its light mapped so the scene's middle light gives the map's mean; a miss keeps the game's texel. Native crops close up: the facets show the cliff, the ground and the sky; the gem's mean luma 0.590 -> 0.574 and 0.509 -> 0.508; 17.90 ms a frame against 17.84 ms (noise, a gem is a few thousand pixels); the Market's gate differs in 0 pixels. The patched modules passspirv-val.RX_VK_RT_REFL_SHEENis the gain (0: the game's map), with_TINTand_SHARE.e4e1e01: a tinted program's emission record is its own light (c5[106] x 30 xits sphere map's mean, the texture found as the second sRGB 2D one,RX_VK_RT_TINT_SHEENto name another or 0 for none), so a rupee's reflection off the picture is lit about as it is on it rather than dark green. It shows once a spinning rupee stays in the structure off the screen, which is being worked on.Checks: the same 18 failures as main.
Pushed
41337ed6718a2d02: the falling leaves cast shadows. At Kokiri a single leaf drifting down cast none, with ray tracing off too: the game draws them (program5bea5f63bbd3d665, an instanced quad its vertex stage places from the particle buffers by instance) after the lighting, with no cascade draw. Their draws are now captured by transform feedback every frame into an arena of their own (RX_VK_RT_LEAF_MB, 32 MB) and placed in the next frame's top level (they are drawn after it is built) as0x40kBlocker, which only the sun's rays take, so they shade the ground and do not show in reflections, AO or GI's bounces. Each leaf quad is cut by its texture's alpha through an opacity micromaprt_scene_cut.compbuilds once (level 5), every captured triangle pointing at it through a 16-bit 0, 1, 0, 1 index stream, so the shadow has the leaf's shape.RX_VK_RT_LEAF_PROGSnames the programs (that one by default,nonefor none); the transform feedback extension is asked for whenever leaves are wanted, while the cascades' capture stays behindRX_VK_RT_XFB. Native crops before/after: a leaf over sunlit stone, no shadow, then its leaf-shaped shadow beside it; the Market unchanged (no leaf draws there). GPU a frame at Kokiri 9.6-9.8 ms before, 9.8-10.0 after (+0.2). A core-validation run at Kokiri showed only the known messages; GPU-assisted validation with transform feedback on did not reach the menu in 13 min; a stress run withRX_VK_RT_XFB=1as well (Kokiri -> Market -> drawbridge -> Hyrule Field) and every other run lost no device (tests/test_rt_leaf_casters.py).Checks: the same 18 failures as main.
Pushed
9033cf9: the cascades' transform feedback capture (particle draws only the sun's cascades draw, such as the Lost Woods' falling leaves) is on by default again;RX_VK_RT_XFB=0turns it off. It was off after the Market's device lost; its cause was fixed in9a818a6, a core-validation run with it on passed, and the stress run for the falling leaves (with it on) lost nothing.Checks: the same 18 failures as main.
Pushed
36a42f87: the falling leaves' micromaps start their data and their triangle array at multiples of 256 bytes, checked on the CPU before the build is recorded (an arena not aligned makes no leaf micromap). A core-validation run at Kokiri shows the leaf micromap at data ...4000 and triangles ...4100, and its ten VUID 07515 reports all name the older cutout micromaps (their alignment is a separate change, not in this branch yet), none a leaf's. No device lost. The review that stands in for GPU-assisted validation (which did not reach the menu with transform feedback on) is in the commit body: no new shader code; the cut and the mesh capture write only inside their checked reservations, and every buffer they use lives until the device goes.Checks: the same 18 failures as main.
Tested on AMD under Windows, which the description lists as not tested: Radeon RX 9070 XT (16 GB), driver 26.11.1, Windows 11, from
e9518463tof70c348d, with FSR 4.1.2 at 1440p.It works, in Kokiri Forest, the Deku Tree, the Market, the Temple of Time, Kakariko, Hyrule Field and Zora's Fountain, by day and at night, all four rows on. One thing to know about this card: the driver has no
VK_EXT_opacity_micromap, so everything here ran the path without micromaps.We are building on this branch (https://git.magicbean.dev/Drommedhar/Longshot/src/branch/feat/path-tracing, rebased onto yours as it moves; 75 commits, nearly all in files of our own). Take whatever is useful.
What we change in your code
Six changes of behaviour, each from something seen on this card:
RX_VK_RT_CHANNELS=1353brings the shadow back:channels_defaultputs the traced shadow into a alone, and the lit programs seem not to take a past the static map's range. We give g the traced shadow as well (3 where you have 7), at the price of the squared penumbra your note avoids. You may know a better way.FULLis split into micromaps and position fetch. This card has only the second, so hits had no face normals; now they do.RX_VK_RT_ALPHA=1): the same opacity bits, baked, as a quick "may be covered" test in the ray query's candidate loop, and for a covered cell the game's own texture sampled at the hit, as an any-hit shader would (the sun's, the AO's and GI's rays; lamp shadows and the reflections' lookup keep the bits alone). In your ray shaders that is an#ifdefblock andRT_PROCEED(q)in place of the loop; your generated headers are untouched, ours are extra ones.holes_notereturns at once, so a patch is the full grid. Kakariko's ground lies below the height field, in holes, and by night the whole village was in shadow: its sun rays ended 8 to 15 m up on the back of a patch. We bake a patch's bits from the same map and test the texel at the hit (a hole wheremax(red, green)is over 0.5019). The sun term's mean in that view went from 72 to 131 of 255, and it now looks like the game's own.kBlockerclass is far only on that path: a sun ray whose receiver is within 50 m of the camera passes it (RX_VK_RT_BLOCKER_NEAR, 0 = as you have it). This one may matter to you on every device. The class holds the game's own low-detail shadow models, ordinary meshes the camera never draws, batched at the level's matrix, and in them a tree's leaf cards are solid polygons with no alpha anywhere. The game uses them where its static shadow map applies, far away; in the rays they are hit at every distance, so a tree's sun shadow near the camera is filled whatever the real leaves' alpha says. Measured at a pine in the Market by night (mean brightness of the shadow, the game's own about 84): 55 as it was, 62 with the texture test alone, 81 with both. Its price: a real object the camera has not drawn yet casts nothing onto receivers within that distance until it has been seen once. We found nothing that tells the shadow models from such objects: not the pass (the cascades draw them too, at times), not the vertex layout.The rest of what we touch in your files is hook lines: a hidden state the parts ask (F8, below), one function each asks for its debug picture (F7), and calls into our files where a draw is noted, a lit draw is seen, a program's module is made and GI's added term is ready.
What we add
RX_VK_RTbit 16), a patch in the lit programs' light loop.a1c74226a51fb7ce) and the window panes (f76f461080f8dc36,3be28542db4ee637in Kakariko) end inlit + emissive * c5[106] * c6[225];c6[225]is the frame's emission scale, and no glow record is made for them.RX_VK_RTbit 32): a pass after the lit draws, at the fog's composite, with a shadow ray a light, the diffuse term and a GGX highlight. It needs what a forward renderer does not keep, so the lit programs now store it: guide buffers (shading normal with the normal map, roughness, albedo, F0) written by a SPIR-V patch like yours, as image stores; every guide in 77.8 % of the cache's lit stages. They are also what a denoiser or Ray Reconstruction will ask for.RX_VK_RT_HIT=1, picturesRX_VK_RT_DEBUG=hitc; not in GI's or the reflections' hits yet): a lit program's base colour read from its SPIR-V and folded per draw into a few steps a hit shader runs, with records for the ground and the mesh-shader cards too. Primary rays find the game's texture colour on 99.9 % of the screen in Kokiri Forest and the Market and 97 % in Hyrule Field.SUN_SOFT,FILTERandHISTORY, the AO's and GI's strength), saved with the options. And three diagnostics that found points 5 and 6: the biggest instances of the top level told, a list of geometry to leave out, and sun probes that name what a pixel's sun ray meets.Still open on this card
RX_VK_RT_GI_STABLEcounter, Kakariko by night; 4.2 % by day). Sixteen rays bring it to 3.2 %, the clamp, the feedback and a history of 64 or 128 frames change little: about 3 % is a floor that is not ray noise. A variance-guided filter of ours did no better and is not on the branch.RX_VK_GPU_PROFILE). This point said before that the reflections were most of the frame in towns at night, 12 fps against 42. That was wrong: the pair was probably taken with the slower lookup ofRX_VK_RT_VIEWS=1linked in, and it does not hold for the ordinary build. The Market at night: 74.6 fps with ray tracing off (GPU 10.0 ms a frame), 33 to 38 with everything on (20 to 24 ms). The largest part of what is added there is ours: the lantern lights' pass, up to 7 ms, which we are cutting down. Yours: the mask part's rays 3.7 ms (AO at Ultra instead of Medium adds 1.3 to 1.5), GI's rays and filters about 1 ms, the scene's builds 0.9 ms. The reflections by the max roughness row: in the Market off 39.5 fps, Low 38.7, Medium 31.6, Max 27.6 (about 1, 6 and 11 ms in the lit passes); facing a pond in Hyrule Field by day, water over about a third of the picture, off 44.2 fps, Low 37 to 41, Medium 29.1, High 27.9, Max 20.8 (the lit passes 6.2 ms with them off, 8 to 10 at Low, 18.8 at Medium, 20.4 at High, 32.5 at Max). So they are cheap at Low and where little water is in view, and by far the largest cost above Low with water in view. On the CPU the renderer thread works 12.5 ms a frame there against 7.8 with ray tracing off (about 3 ms of it in the top level at 2,200 instances); by day in the Market it is the limit: about 10 ms a frame in the top level at 6,400 to 7,400 instances.500a01a9, before you turned it off by default. We have not run it since: the repeated device losses took the PC down twice. We have the bisection's notes if they help.Not tested: Linux, frame generation with the rows on.
Pushed
94af2559: a rupee's traced gem took its mirror normal from the position's screen derivatives, which jump from one 2 x 2 quad to the next as the gem spins: in play its facets broke into a blocky speckle that changed every frame (over the gem 0.033 a frame of change in a recording, the background 0.002). The mirror ray now uses the normal the program itself looks its sphere map up by (the view-space normal, its normal map included, read from the twofmas that make the map's coordinate) turned into the world with the camera's axes; where that pattern is not found the old normal stays. Close crops of a blue rupee: the old normal shows the same mosaic as the recording, the new one clean reflections. A frame-to-frame number before/after could not be taken here (shots at 4K are not consecutive while the gem spins), so that check is left to a recording in play. Both gem programs' patched modules passspirv-val.Checks: the same 18 failures as main.
@Drommedhar thank you for this, and for the careful write-up on #1151. The base fixes are exactly what #727 needed, and the AMD numbers are the first we have from a card without opacity micromaps.
What I pulled into #727 (cherry-picked with
-x, your authorship kept, so the commits stay yours):e257d5e46a30e8cbrt_budget.h)02c62e4757a44c3dRX_VK_RT_ALPHA=1), andFULLsplit into micromaps and position fetch, so a card with fetch but no micromaps gets face normals96c1037ccf41d9c1892d4ffb8a4845ffRX_VK_RT_ALPHA_CENSUSe81c765cc6cab366b8d52221af1a4bec0b0798a8f060b4b033229e7fde19b9bdcdba9fe3regenerates the ALPHA headers from this branch's sources (rt_alpha_build.sh, no other header changed). I dropped the lines that only your other work uses (the census and hit-record calls, the lamp and show variants). The full checks give the same 18 failures as main.Not pulled, so still on your side in #1151:
da99df60, the exact test, anda7dab713, the terrain holes without micromaps. Both need the bindless table and the hit records. Textured hits stay off in #727 for now: they are what was running when this PC bugchecked, and I will only turn them on after a GPU-assisted validation pass. Once #727 lands, these two can come in with your textured hits.RX_VK_RT_BLOCKER_NEAR) clashes with something newer in #727. Since718a2d02, Kokiri's falling leaves are captured by transform feedback and placed askBlocker(0x40), so only the sun's rays meet them. With your rule, a leaf within 50 m of the camera would cast no shadow. I suggest giving the leaves a mask bit of their own before the rule lands. I can do that on #727 if you want to rebase onto it.fe6dad1a, the traced sun shadow into the cascades' channel g, and the lantern and window glow scale fromc6[225]. I'll measure both on an RTX 5090 with before and after pictures and report here. Our lantern reflections are missing today, so the second may well be the reason.Your XFB device lost is fixed.
9a818a6closes the capture withboundary(B_DIRECT)and keeps the pending capture thread-local. It passed a GPU-assisted validation run, and the capture has been on by default since9033cf99.I'm happy to run #1151 on the RTX 5090 (validation first, then pictures and GPU times) whenever it helps. Thanks again!
Two small things on #727's side.
bdc61afddropstest_rt_hit.py's check of the hit record's matrix, since the records aren't here.19f973b0renames the Graphics tab's section to "Ray tracing (Experimental)". Next I'll rebase #727 on current main (it is 138 commits behind) and force-push it. That moves the base your branch stacks on (f70c348), so #1151 will need a rebase too, and I'll say here when it's done.19f973b081515fe79454Rebased onto main
5c284721(force-pushed,515fe794). @Drommedhar this moves the base #1151 stacks on again, sorry for the churn.Since the last push:
f3dfa041: the ray tracing parts' shaders go through main's newbuiltin_spv(RX_VK_SHADER_DIR), sotest_builtin_spv.pypasses.625dce16(from the scene part): falling leaves keep their sun shadow as they land. A leaf is a two-sided card, and the back-face rule for rays starting under the solid world was passing a leaf's underside within 25 cm of the ground.515fe794: the AO's ALPHA variant made again.Still to come before ready: the main-against-PR measurements (running now on this PC, with GPU-assisted validation first), the
docs/tested/files, and a Linux build. There's no Linux here, so @Beanstalk please build this branch on Linux when the farm can.@winterelfeas only members of
BigBeanscan start the farm.One of them can approve this request by reacting 👍 to it.This request was for515fe79, and the PR has changed since (46c24c4), so a 👍 no longer approves it. Comment@Beanstalkagain to ask for the new commit.The RT files' comments and the checks' docstrings named our own process instead of the reason: local results/ paths and scripts (vk_rt_gi.cpp, vk_rt_refl.cpp, rt_gi_spirv.h, rt_refl_spirv.h, the SPIR-V tests), private commit hashes that are not in this branch's history ("scene's 10230f9", "a736075", "a232c89"), session names ("mask's run", "mask's Market walk"), "the user's test" and bare dates and times (11-15, 11-16, 01:53) in vk_rt_scene.cpp, vk_rt_mask.cpp, the GI shaders and tests/test_rt_omm_layout.py and test_rt_static_orphan.py, "this driver" (vk_rt.h, vk_rt_scene.cpp: NVIDIA's, where it was measured) and "stage 1 of the design" (vk_rt_hit.h). Each now keeps what was seen and why it matters, or drops the reference. xfb_note's comment said the capture was off by default since a device loss and RX_VK_RT_XFB=1 turned it on to test; it is on by default (xfb_mode, docs/ray-tracing.md), so the note goes. Comments only: no code, and no shader's SPIR-V, changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>46c24c440af5f3be39faMeasured, validated and rebased onto main
983d607b: the description's Measurements section has the numbers and a verdict. Everything is done from my side but the Linux build (the last unticked box), so this stays WIP only until the Test Farm has built it; reviews are welcome now.Measurements (RTX 5090, Kokiri Forest, main against this PR, interleaved runs, medians):
docs/tested/rows are added.GPU-assisted validation (Kokiri Forest, all four rows on, with the opacity micromaps and with the path without them forced): no device lost, no out-of-bounds access, no invalid address. It found one issue in this PR: micromap data not 256-aligned. That's fixed (
4171fade) and gone in its own run.Since the last comment:
clock=(it went aroundcheats_on()) is removed, along with test switches nothing used.Device lost: one, in a run of this PR with the rows off, in a draw of the game's own program with no ray tracing in the frame (one nvlddmkm event 153). Nothing like it happened in the twenty-odd runs since. It's in the description.
@Beanstalk please build this branch on Linux and run the four Ray tracing rows as the Must be tested lines say. The Linux build is the one box I can't tick here.
@winterelfeas only members of
BigBeanscan start the farm.One of them can approve this request by reacting 👍 to it or to this comment.This request was forf5f3be3, and the PR has changed since (a1ad9d9), so a 👍 no longer approves it. Comment@Beanstalkagain to ask for the new commit.Awesome work! Can you please include screenshot of the settings?
f5f3be39faa1ad9d9b74Rebased onto main
54ef5ca3, with one speed fix and the switch table's rows. The description's Measurements, Testing and Screenshots are updated. It's still WIP only for the Linux build.Since the last comment:
cc5c18cf): the light mask's count of sunlit texels was 3 atomics per 8x8 group into host memory, over PCIe. They now go into a 16-byte device-local buffer, copied out once a frame; the CPU reads it as before.bd3ca8e6, for #1300): the 160RX_VK_RT*switches each have a row ingpu/vk/switches.def. The light mask's tuning switches were read under a name built at run time;kNamednow names each one whole, so the check sees the reads.54ef5ca3(RTX 5090, Kokiri Forest, interleaved, medians of 3, no device lost in 18 runs):docs/tested/rows are replaced by this batch's.run_allon Windows, 642 passed and 44 failed; main54ef5ca3fails the same 44 here (plustest_longshot_ctl's timeout).test_switch_tablefails on main too, forRX_VK_PGO_FILE.The Graphics tab's Ray tracing rows, as asked:
Sun shadows, Kokiri Forest (off left, on right): leaf-over-leaf and stem shadows inside the plant, which the game's cascades don't resolve.
@Beanstalk please build this branch on Linux and run the four Ray tracing rows as the Must be tested lines say. The Linux build is the one box I can't tick here.
@winterelfeas only members of
BigBeanscan start the farm.One of them can approve this request by reacting 👍 to it or to this comment.This request was fora1ad9d9, and the PR has changed since (96cf669), so a 👍 no longer approves it. Comment@Beanstalkagain to ask for the new commit.@HumanBean thanks! The settings screenshot is in the comment above (#727 (comment)) and at the top of the description's Screenshots: the Graphics tab's Ray tracing (Experimental) rows.
WIP: feat(vk): ray-traced ambient occlusion, sun shadows, global illumination and reflectionsto feat(vk): ray-traced ambient occlusion, sun shadows, global illumination and reflectionsfeat(vk): ray-traced ambient occlusion, sun shadows, global illumination and reflectionsto WIP: feat(vk): ray-traced ambient occlusion, sun shadows, global illumination and reflectionsa1ad9d9b7496cf669b5aRebased onto main
544229a2(two commits, no conflict, no change of ours). run_all on Windows: 643 passed, 44 failed, the same 44 as main. The push reset the farm request, so again: @Beanstalk please build this branch on Linux and run the four Ray tracing rows as the Must be tested lines say.@winterelfeas only members of
BigBeanscan start the farm.One of them can approve this request by reacting 👍 to it or to this comment.This request was for96cf669, and the PR has changed since (a88d251), so a 👍 no longer approves it. Comment@Beanstalkagain to ask for the new commit.96cf669b5aa88d251e00Commit messages only, the code is byte for byte the same (same tree as
96cf669b): @JayDeGoodz is now a co-author (Co-Authored-By) of the two commits that carry his AO approach from #815, the traced AO into the game's own SSAO image and its quality steps, as he agreed on #815. One commit's author placeholder is corrected to mine. The push reset the farm request, so again: @Beanstalk please build this branch on Linux and run the four Ray tracing rows as the Must be tested lines say.@winterelfeas only members of
BigBeanscan start the farm.One of them can approve this request by reacting 👍 to it or to this comment.This request was fora88d251, and the PR has changed since (1327215), so a 👍 no longer approves it. Comment@Beanstalkagain to ask for the new commit.Pushed
1327215a,94f6920fande7cc11df: a fix for huge flickering sun shadows and a big slowdown at a raised Foliage distance, a graphics option from outside this PR (Kokiri Forest at 125%: 10.7 fps, against 42 at 100%).Cause:
rt_scene_mesh.compunprojected each corner on its own. A corner the game parks off the view (a falling leaf out of its life, a faded mesh-shader foliage instance) came back at a finite but far place, so its triangle spanned the area: every ray traversed it (the rays' pass 0.45 to 7.8 ms) and the sun drew its shadow. Now a triangle's three corners are unprojected together and it is left out when an edge is longer than 30 m (2 m for a falling leaf's draw). The static shadow map's pool, the world's own geometry, is not checked. With the fix: 38.8 fps at 125% against 40.1 at 100%.RX_VK_RT_MESH_EDGE=<m>(0: no check) andRX_VK_RT_MESH_EDGE_CTL=<file>(a live number, for tests) are in docs/ray-tracing.md and the description's Flags and settings. With them I checked for lost geometry: at Foliage 100%, in five areas, the sun and AO views differ no more than two shots of the same camera do, even with the limit down to 0.05 m. No tree or shadow goes missing. The game-free checks give the same results as before. The description's Testing has the details.This is everything I have locally, so I'm asking for the Must-be-tested runs now:
@Beanstalk build and ray tracing rows on, Linux
@Beanstalk ray tracing rows on, Kokiri Forest and Lake Hylia, RDNA 2 or newer
@Beanstalk ray tracing rows on, Intel Arc
@winterelfeas only members of
BigBeanscan start the farm. One of them can approve this request by reacting 👍 to it or to this comment.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.