A room with light shafts, checked against a ray tracer
A game-style frame with sun shadows and light shafts renders correctly through the layer, and an independent Python ray tracer agrees exactly on every pixel it can vouch for.
What changed
I added a test sample, room, built the way a game builds a frame. The earlier samples each checked one feature; this one chains four passes that depend on each other:
- A depth-only pass renders the scene from the sun into a 1024² shadow map (a depth image that records, for each direction, how far the sun's light gets). It uses depth bias, a small offset that stops surfaces from shadowing themselves.
- The scene pass draws 13 boxes as instances of one cube into a 16-bit float target. It shades each pixel with Lambert lighting (brightness proportional to the cosine between surface and light) and a filtered shadow-map lookup.
- A compute pass walks 48 steps along each pixel's view ray, up to the depth the scene pass stored. At each step it asks the shadow map whether that point of air is in sunlight. The lit steps, weighted by a Schlick phase function (how much light scatters towards the eye), add up to the light shafts.
- A fullscreen pass adds the shafts to the scene and tonemaps with c / (1 + c) and gamma 1/2.2 into the 8-bit target.
Along the way it uses typeless depth resources read back as textures, a comparison sampler with a border colour, per-instance vertex data, a root constant buffer, descriptor tables, a 16-bit float UAV and the barriers between the passes.
The interesting part
Expected values for a frame like this can't be worked out by hand, and no D3D12 machine is available for a WARP reference. So a small Python script ray-traces the same boxes in Python with exact sun visibility instead of a shadow map, and marches the same 48 samples with the same per-pixel offsets.
A shadow map is only an approximation, so the two images must differ near shadow edges. The script therefore picks test pixels only where its answer can't depend on that approximation. Each surface point and every march sample must be at least 0.025 units from a sun/shadow boundary, which is 1.5 shadow-map texels plus margin. The 7×7 pixels around each probe must also lie on one face.
All 11 probes match exactly. They cover the back, left and right walls, the ceiling, the pillar, the crate, the shaded floor, the sky, the sunlit floor, and shafts over a wall and over the floor.

Numbers
- Probes: 11 of 11 match with a difference of 0, although their tolerances are 2–3.
- Whole image: 218,954 of 230,400 pixels (95.0%) are identical to the reference, and 309 differ by more than 20 levels. The differences lie only on the shafts and on the rim of the sunlit patch, where the shadow map's resolution decides.
- Three runs produced bit-identical output.
- This entry changes only a test sample. There was no full conformance run, so there is no new test count.
difference per channel, in 8-bit levels · pixels
- any (> 0)11,446
- > 15,857
- > 23,662
- > 32,260
- > 51,155
- > 10513
- > 20309