Skip to content

fix(gpu): fix ambient solid-angle distance clamp and SRV table binding - #23

Merged
HumanlyDev merged 1 commit into
mainfrom
fix/ambient-solid-angle-and-srv-binding
Nov 26, 2026
Merged

HumanlyDev merged 1 commit into
mainfrom
fix/ambient-solid-angle-and-srv-binding

Conversation

@HumanlyDev

Copy link
Copy Markdown
Owner

Summary

  • **Fix broken solid-angle weight in \�mbient.rs::place()**: When clamping \wz = min(p.z, 50.0), \p\ was left unclamped (up to \z = 1000.0\ for sky cells), causing \c.w / dd\ to suppress sky and distant cells by 400x and bias \gather()\ heavily toward nearby bright surfaces. Now \p\ is scaled along the view ray to \wz / max(p.z, 1e-6)\ so \z^2 / d^2\ solid-angle weighting is preserved.
  • **Fix D3D12 SRV/UAV descriptor mismatch in \�mbient.rs\ / \draw.rs**: \State::ambient()\ previously passed the UAV \image\ handle as \depth\ (bound to root param 1 \DescriptorTable(SRV(t0))) for \Role::Radiance\ and \Role::Air. Now \Views::depth\ is \Option<D3D12_GPU_DESCRIPTOR_HANDLE>, and root param 1 is only bound for \Role::Resolve.

Verification

  • \cargo test -p victory-gpu --lib ambient: 3 passed, 0 failed (including \ he_passes_build).

@HumanlyDev
HumanlyDev merged commit d8d82a2 into main Nov 26, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant