cad-editor/src/shaders
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Hakan Seven a4fc34c6a2 feat(web): render hatches on WebGL2 via a texture-backed renderer
WebGL2 has no vertex/fragment storage buffers, so the batched storage-buffer
hatch renderer (hatch_gpu) is disabled on wasm and real hatch fills never
rendered on the web build — the pick highlighted the boundary and the command
then appeared to cancel (issue #204).

Add a wasm-only per-hatch renderer (hatch_web_gpu + hatch_web.wgsl) that packs
the variable-length boundary / family / dash arrays into one RGBA32F data
texture read with textureLoad, instead of the fixed-size uniforms of the
wipeout path. This removes the MAX_FAMILIES (16) / MAX_HATCH_BOUNDARY_VERTS
(1024) / MAX_DASHES (128) caps, so every hatch — solid, gradient, and
arbitrarily complex line patterns — renders on the web. The fill algorithm
(in_polygon, per-family line/dash/dot, gradient, LOD, double-single vertex
transform) is identical to the desktop path; only the array ACCESS changes.
Pattern phase is anchored at world_origin with the boundary stored raw, and
scale / gradient-range clamped, to match the desktop batched renderer exactly.

Native (hatch_gpu + hatch.wgsl) and the wipeout mask renderer are untouched;
the new module and pipeline are gated on target_arch = "wasm32".

Also silence the resulting (and pre-existing) wasm-only dead-code warnings for
native-only paths so both the native and web builds compile clean.

Closes #204.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 00:53:51 +03:00
..
blit.wgsl fix(viewport): blit UV crop for off-canvas viewports 2026-05-28 12:15:00 +03:00
face3d.wgsl fix(render): draw 3D surface fills at their real depth, not draw order 2026-07-02 01:23:27 +03:00
hatch.wgsl refactor(pipeline): name the real hatch renderer hatch_gpu, legacy → wipeout_gpu 2026-07-09 10:45:40 +03:00
hatch_web.wgsl feat(web): render hatches on WebGL2 via a texture-backed renderer 2026-07-14 00:53:51 +03:00
image.wgsl refactor: remove the legacy full view_proj (CPU cull now relative-to-eye) 2026-06-24 20:14:41 +03:00
mesh.wgsl feat(render): draw ACIS solids as B-rep feature edges, meshes as tri edges 2026-07-04 17:57:00 +03:00
text.wgsl feat(text): SDF glyph-atlas foundation for shader text rendering 2026-07-06 22:03:36 +03:00
viewcube.wgsl fix: ViewCube hover, glow, centroids, corner geometry and snap angles 2026-04-23 19:11:19 +03:00
viewcube_text.wgsl first commit 2026-03-22 14:56:27 +03:00
wipeout.wgsl refactor(pipeline): name the real hatch renderer hatch_gpu, legacy → wipeout_gpu 2026-07-09 10:45:40 +03:00
wire.wgsl fix(linetype): A-type endpoint alignment so dashed lines end on a dash 2026-07-13 23:50:25 +03:00
wire_indexed.wgsl fix(linetype): A-type endpoint alignment so dashed lines end on a dash 2026-07-13 23:50:25 +03:00