Conversation
Adds two small seams to raydeon's renderer so callers can generate their own surface detail: - Scene::illumination_for_hit computes lighting at a caller-constructed surface hit, letting hatch generators sample light at points they already know lie on a face. - SceneCamera::clip_and_project exposes the existing chop/occlude/join projection pipeline for caller-provided world-space segments. The new hatch-lab crate renders one architectural test scene (gabled house with door/window openings, chimney, sphere-canopy tree, ground plane, single point light) through four hatching strategies for visual comparison: - a_screen_space: the existing screen-space hatching, seeded - b_world_uniform: 45-degree world-space hatching per face, stochastic keep probability driven by sampled illumination - c_crosshatch_tonal: discrete tone bands accumulate cross-hatch directions at tightening spacing, engraving-style - d_light_flow: hatch direction follows the light direction projected onto each face; sphere rings wrap the axis pointing at the light Hatch lines are generated in face-plane coordinates, clipped to convex outlines minus door/window holes, lifted slightly off the surface so their visibility rays do not re-intersect their own face, then filtered sample-by-sample against scene illumination. Also removes two unused bon::builder imports flagged by clippy. Claude-Session: https://claude.ai/code/session_01WT2VUpRTEKguqL42ehtXdn
Owner
Author
|
Closing per Sean's preference to work from branches without PRs — the branch stays pushed. |
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.
What this is
An experimentation harness for the "beautiful architectural renderings" direction: one test scene (gabled house with door/window openings, chimney, sphere-canopy tree, ground plane, single point light) rendered through four hatching strategies so they can be compared visually. Run with:
Outputs land in
hatch-lab/renders/*.svg(gitignored, like all render outputs in this repo).Core seams added to raydeon
Two minimal public APIs that world-space hatching needs, both extracted from existing internals rather than new logic:
Scene::illumination_for_hit— computes total light arriving at a caller-constructedHitShape, so hatch generators can sample illumination at surface points they already know.SceneCamera::clip_and_project— the existing chop → occlusion-clip → join → project pipeline, now callable with arbitrary caller-generated world-space segments.render()is reimplemented on top of it.Strategies
screen_spaceworld_uniformcrosshatch_tonallight_flowHatch lines are generated in face-plane coordinates, clipped to the convex outline minus door/window holes, lifted ~0.006 world units off the surface (so their visibility rays don't re-intersect their own face), then illumination-filtered per ~0.16-unit sample using the same slice/join machinery as the main renderer.
Notable findings while building this
join_slicesdrops theshapereference when rebuilding segments, so render output can't currently be traced back to materials — this blocks per-pen/per-layer SVG output and is worth fixing in the planned cleanup.🤖 Generated with Claude Code
https://claude.ai/code/session_01WT2VUpRTEKguqL42ehtXdn