Darken only sunlit pixels with contact shadows

The half-resolution lighting pass the composite reads keeps the sun's visibility in its first target's alpha: 1 in
the sun, 0 in the shadow maps' shadow and everywhere underground. vk_contact.c finds that pass (eight targets at half
the scene size, the first RGBA8) and contact_shadow.comp scales its darkening by that alpha, so a contact shadow takes
away direct sunlight only and caves no longer turn flat. Without that pass in the frame the old behaviour stays.
TOTK_CONTACT_DEBUG=2 shows the visibility in grey.

Carried onto dev from #439: the march is now planned by the scan (vk_contact_plan) and recorded from a VkExecJob, so
the lighting target travels in the job's new sun field, and the factor multiplies the facing-the-sun factor of the
back-face fix.

Co-Authored-By: itaskaev2 <165683571+itaskaev2@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
authored and itaskaev2 committed 2026-11-15 17:34:42 +01:00
1 parent 6151ac4fbc
commit 581c1ecdef
5 files changed
+276 -215

No files matched your search

+1 -1
View File
@@ -20,7 +20,7 @@ Many rows below are developer tools that only act together with another setting
| --- | --- | --- | --- |
| `astc_time` | `1` times the GPU dispatches of each ASTC texture decode and logs the time per block footprint and the largest call. | Adds GPU timestamp queries around every decode; if the queue has no timestamps or no `hostQueryReset`, the log says the decodes are not timed and nothing is measured. | Caution |
| `bind_stats` | `1` counts bindings and descriptors per draw of each stage and how much of the bound state changes between draws. | Adds per-draw bookkeeping to the render thread and extra log output; frames get slower. | Caution |
| `contact_debug` | `1` draws the contact-shadow factor in grey in place of the picture. | The frame shows a grey debug image while it is set; has no effect when contact shadows are off. | Caution |
| `contact_debug` | `1` draws the contact-shadow factor in grey in place of the picture; `2` draws the sun visibility the shadows are scaled by (white in the sun, black in shade and underground). | The frame shows a grey debug image while it is set; has no effect when contact shadows are off. | Caution |
| `core_diag` | `1` records why ready guest threads wait for a virtual core and for how long, with a histogram every 60 presents. | Turns on host-call and SVC depth tracking and writes many log lines (one per present over 25 ms); frames get slower. | Caution |
| `menu_cursor_log` | `1` logs what the menu cursor code reads at every screen change. | Only adds log lines. | Safe |
| `perf_slow_ms` (default `50`) | Frames at least this many milliseconds long get a `perf: slow frame` log line with the time blocked per cause. | Changes how many frames are logged; a small value fills the log. | Safe |