Repository navigation
TEST-910: sun shadow map for the G-buffer sandbox with the game's depth-only VS - #4436
Open
Joaovitor404silva wants to merge 3 commits into
Open
Joaovitor404silva wants to merge 3 commits into
Joaovitor404silva wants to merge 3 commits into
Conversation
vk_sandbox draws the props around a point with one translated game VS/PS pair chosen by signature and descriptor layout: a real camera through the VS constants, DiffuseTex albedo through the bindless set and the PS's own S#, depth, and a fly/walk/drive window. tools/sandbox.py packs the scene (tools/sandbox_scene.py), picks the pair and runs it; --check prints counts only. docs/sandbox.md has the table layout and the measurements. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PiKMETzszqwfnV8QQyzocY
…G-buffer tools/gbuffer.py picks a material VS/PS pair by user data and listing layout. The VS pulls its own vertices and the PS writes the five G-buffer targets. The script links the pair's interpolants by DXBC semantic and runs runtime/test/vk_gbuffer. That tool repacks the scene into the game's compressed vertex stream, fills the tables the pair reads, draws into mrt0-4 + D32 and reads every target back. It prints counts and PASS/FAIL only. The scene and camera helpers move from vk_sandbox.cpp to sandbox_common.h. docs/gbuffer.md records the tables, the stream and the target layout. tests/test_gbuffer_pick.py covers picking, linking and the thresholds on hand-made inputs. Depends on: ItsNotRexed#3530 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PiKMETzszqwfnV8QQyzocY
vk_gbuffer --shadow draws every prop into a 2048^2 D32 map from an orthographic sun with a depth-only VS picked by layout (SV_VertexID in, s9 object/view tables, float3 stream at s11/s12), then tests each covered G-buffer pixel against it and counts lit, shadowed and facing away. gbuffer.py --shadow runs two opposite suns and needs lit and shadowed pixels under each, with different counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PiKMETzszqwfnV8QQyzocY
Kam471
reviewed
Nov 23, 2026
Kam471
left a comment
Contributor
There was a problem hiding this comment.
Ran this at e5301e92 on Windows 11: pytest tests/test_gbuffer_shadow.py tests/test_gbuffer_pick.py tests/test_sandbox_pick.py tests/test_sandbox_scene.py -q -> 45 passed; git diff --check clean.
The new shadow test covers the depth-only VS selection, the sun direction and the shadow map packing; the existing G-buffer/sandbox tests pass. I did not run the GPU vk_gbuffer --shadow path here because it needs the user's scene/shader carve (this branch stacks #4119/#3530). No blocking issue on the CPU side.
This was referenced Nov 23, 2026
Contributor
1 of 2 tasks
1 of 2 tasks
This was referenced Nov 23, 2026
This was referenced Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: TEST-910
Depends on: #4119
Depends on: #3530
What and why
Sun shadows for the G-buffer sandbox of TEST-728 (#4119). This is the first step towards deferred sun light over the G-buffer.
vk_gbuffer --shadow <vs.spv> [--sun az el]draws every prop into a 2048² D32 map from an orthographic sun with a translated depth-only VS from the user's work folder. Each covered G-buffer pixel is moved back to world space through the inverse view-projection and tested against the map with a normal offset and a world-unit depth bias. It prints counts only: lit, shadowed, facing away, outside.tools/gbuffer.py --shadowpicks that VS by layout, not by name: SV_VertexID as the only input, no bindings, user SGPRs[ptr32_lo 9, const32 11, const32 12], object rows at s9 + 0x40, view-projection at s9 + 0x60 → 0x160, a float3 stream at s11/s12, exports pos0 + param0. It runs two opposite suns.docs/gbuffer_sandbox.md§5 documents the tables, the test and the numbers.Not in this PR: the shadow test and N·L run on the CPU. Running the game's shadow-mask and deferred lighting shaders over these targets is the next step.
Tested
RTX 4070 Ti SUPER, NVIDIA 621.24, Windows 11. Test scene from sandbox.md (150 props, 446 draws), 640×360:
--shadowthe run is the same as before.python -I tests/test_gbuffer_shadow.py: 22 tests OK, on hand-written listings.tests/test_gbuffer_pick.pyOK. The build has no warnings.AI-assisted (Claude Code). Reviewed with an automated code review; its findings are fixed.
Checklist
docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
https://claude.ai/code/session_01PiKMETzszqwfnV8QQyzocY