Repository navigation
Carry the camera near distance through the v1 upgrade (crucible#1159) - #60
Merged
Merged
Conversation
Merged
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.
Part of codepawl/crucible#1159.
What
The
cycleskernel already starts camera rays atcamera_near(FORMAT-v2 word 124,camera.wgslt_min = near / cos_forward), and the instanced route fills it fromcamera.near. A flattened job goes through the v1 tables and the upgrade, which carried no near distance, so the kernel always got 0. This writescamera.nearinto v1 parameter word 62 (free, 0 when unset) and the upgrade reads it back into the camera, socamera_nearis set. No kernel, struct or buffer size changes (KernelParamsV2 stays 336 bytes, the v1 block stays 256). A camera withoutnearpacks the same bytes as before; thelegacykernel ignores the word.How I checked it
node --testin the checkout: 196 tests, 196 pass (new test:a camera near distance is written to parameter word 62 and a camera without one leaves it 0).node tools/run-cargo-tests.mjs: Rust tests ran, no failure (Rust is unchanged).node build.mjs): a crucible test traces a glowing green wall 0.5 m ahead of a red wall 3 m ahead. Centre pixel without clipStart is green, with clipStart 1 it is red, with clipStart 0.2 it is green again. Before this change the clipStart 1 pixel stayed green (0,1,0).Evidence
Numbers above; there is no picture to show for a parameter word.