feat(paper): render the whole sheet via the shader, drop PaperCanvas

Paper space now renders entirely through the unified GPU shader, exactly
like model space — there is no separate 2-D canvas. The full-canvas
top-locked "sheet" viewport draws the layout's entities, hatches,
wipeouts and images; the desk is the container background and the white
printable area is a synthetic solid hatch.

- The white sheet fill uses draw_depth -2.0 (entity fills/wires are in
  the signed (-1, 1) range) so it is always strictly behind every object,
  with a negligible z offset (BIAS 0.001) — no far-plane clipping.
- Delete src/scene/paper_canvas.rs (the PaperCanvas widget) and its dead
  helpers (paper_canvas_wires / paper_sheet_wires / paper_canvas_cache).
  paper_canvas_hatches / _wipeouts remain — still used by paper hit-test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-02 20:25:50 +03:00
commit 206ad1a4aa
4 changed files with 52 additions and 247 deletions

View file

@ -653,14 +653,22 @@ impl Scene {
height: visible_h / canvas.1,
};
// Stage 1: the paper sheet instance contributes only entity wires; its
// hatch / wipeout / image fills are still drawn by PaperCanvas beneath
// the shader. (Stage 2 moves those into the shader and drops PaperCanvas.)
let (hatches, wipeout_hatches, images) = if inst.paper_sheet {
(Arc::new(Vec::new()), Arc::new(Vec::new()), Arc::new(Vec::new()))
// The paper sheet instance renders the same hatch / wipeout / image
// fills as everything else (wrong-camera fills fall outside its
// frustum and are culled), plus a synthetic white fill for the sheet's
// printable area — the GPU equivalent of the old PaperCanvas chrome.
let hatches = if inst.paper_sheet {
let mut v: Vec<HatchModel> = Vec::new();
if let Some(sheet) = self.paper_sheet_fill() {
v.push(sheet);
}
v.extend(self.hatch_models_arc().iter().cloned());
Arc::new(v)
} else {
(self.hatch_models_arc(), self.wipeout_models_arc(), self.images_arc())
self.hatch_models_arc()
};
let wipeout_hatches = self.wipeout_models_arc();
let images = self.images_arc();
Some(ViewportData {
wires: all_wires,