forked from 1b-agent/opencadstudio-upstream
perf(hatch): tessellate fills so navigation no longer flickers (#258)
The batched hatch pass drew a screen-covering AABB quad per hatch and, for every fragment, ran a point-in-polygon ray-cast over the whole boundary plus the pattern test, with a discard that disabled early-Z. Zoomed into a hatch the quad covers the screen, so the shader re-ran per pixel every frame — the cost the PR #273 interaction-LOD worked around by suppressing hatches during navigation, which made fills flicker on and off while zooming. Triangulate each boundary once (lyon, even-odd — same coverage as the old in_polygon, islands/holes included) and rasterize those triangles instead: no screen-filling overdraw, no per-fragment boundary test. The fragment shader keeps the boundary test only on a per-instance fallback path (poly_test == 1) for boundaries that fail to tessellate. Tessellation is cached with the batch build (geometry_epoch) in local space, so the double-single relative-to-eye precision is preserved. With the fast path the interaction-LOD is no longer needed; it is gated behind OCS_HATCH_LOD (default off) as a safety net for now.
This commit is contained in:
1 parent
fd0b8fc1d4
commit
b4152ae1fe
6 files changed
+236
-58
No files matched your search
@@ -1,5 +1,6 @@
|
||||
pub mod face3d_gpu;
|
||||
pub mod hatch_batched_gpu;
|
||||
pub mod hatch_tess;
|
||||
pub mod hatch_gpu;
|
||||
pub mod image_gpu;
|
||||
pub mod mesh_gpu;
|
||||
|
||||
Reference in new issue
Block a user