Repository navigation
Cheaper height ray and per-draw work in NosVille - #18
Conversation
The height ray is straight up in practice, so most ground triangles are rejected on the ray/triangle test's first edge value, now computed from four coordinates; the difftest gains upright rays and grid-snapped geometry to cover it. Draw constants are packed by the number of lights actually used instead of a fixed 75-texel block, setting a transform to the matrix it already holds no longer recomputes world-view-projection, and the setup loggers check the last match first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014gSmkXCUwMW8pvXTj7msSU
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Vertical-ray filter and test cases recomp/runtime/rt_game.c, recomp/difftest/overrides.c |
height_node applies an additional triangle prefilter when the ray has zero horizontal direction. Differential test cases now include grid-aligned and upright inputs. |
Rendering updates
| Layer / File(s) | Summary |
|---|---|
Transform matrix updates recomp/port/render.c |
r_set_transform skips unsupported transform types and avoids copying a matrix that matches the stored value. |
Draw-constant storage and addressing recomp/port/render_gl.inc |
Buffered draws allocate variable-size constant blocks, reuse a matching preceding block of the same size, and address constants by row and column. js_gl_run uploads constants in 2025-texel rows. Setup logging checks the most recently matched key first. |
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Refactor
Sequence Diagram(s)
sequenceDiagram
participant BufferedDraw
participant ConstantsBuffer
participant js_gl_run
participant WebGL2ConstantTexture
participant ShaderBaseUniform
BufferedDraw->>ConstantsBuffer: Reserve or reuse a variable-size block
ConstantsBuffer->>js_gl_run: Pass populated constants on flush
js_gl_run->>WebGL2ConstantTexture: Upload constants in 2025-texel rows
BufferedDraw->>ShaderBaseUniform: Set the constants row and column
Possibly related PRs
- NosCoreIO/NosCore.ClientLab#17: Adds the height-model ray routine and differential tests that this PR updates.
- NosCoreIO/NosCore.ClientLab#15: Adds GPU vertex-buffer draws and the constants texture that this PR changes.
- NosCoreIO/NosCore.ClientLab#5: Adds batched WebGL command submission, whose buffered draw path this PR updates.
Suggested reviewers: claude
Merge Risk: 
Minimal · up to 2f6f4
-
No merge-blocking issue was established. Normal checks should run before merging.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 3 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Summary
height_nodenow rejects most ground triangles on the first edge value,u, which it computes from four coordinates. The value is bit-identical toray_triangle'suwhenever that is not NaN, so the shortcut rejects exactly the triangles the full test would. The difftest gains upright rays and grid-snapped geometry to cover the shortcut.Results (NUC, 1080p, uncapped)
texSubImage2DGenerated by Claude Code
Summary by CodeRabbit