v0.4.3
Unified viewport architecture
- Model and paper layouts now share a single GPU shader widget:
Scene::active_viewportsyields aVec<ViewportInstance>(one per tiled Model pane or floating paper viewport), and theMultiPipelinerenders each into its own scissor pass. - Model space gains a tiled-pane layout: split the active tile via ▤/▥ buttons or
VPORTS 2H|2V|4|SINGLE, drag the inner dividers to resize, and drag a divider past the ViewCube minimum to collapse the pane into its longest-contact neighbour. The tile layout (rect + per-pane camera) round-trips through the DXF/DWGVPorttable via*OCS_Tile_<i>entries. - Paper layout drops the old
PaperViewportPane+PaperViewportPipelinenewtype. ThePaperCanvas2-D widget draws the sheet, paper-space entities and viewport borders; every content viewport (active and inactive) renders through the unified shader on top, with a transparent shader clear + alpha-blended blit so the paper sheet shows through outside drawn geometry.
Paper viewport rendering
- Each content viewport now runs its own frustum + LOD cull (
view_aabb+wppderived from the viewport's stored camera + on-paper pixel height), so 100k-entity drawings no longer re-tessellate the whole model through every floating viewport every frame. Per-viewport hatch / wipeout / mesh upload follows the same pattern. - UTM-style drawings whose
view_target = (0, 0, 0)no longer render blank —camera_for_viewportruns the same overlap-with-content-cluster test the CPU projection path already had and auto-fits when the saved view points at empty WCS. - Off-canvas viewports composite correctly: the per-viewport MSAA is sized to the on-canvas intersection and the camera projection is cropped via
crop_view_projto map only the visible sub-rect to NDC, so deep paper zoom no longer panics inDevice::create_texturepast the 8192-pixel limit and partially off-screen viewports no longer drift toward the canvas corner. - Inactive paper viewports were drifting against the CPU projection in
PaperCanvasonce the rect ran off-canvas; the CPU projection of model content is now removed (the unified GPU path is the single source of truth) andpaper_canvas_hatches/paper_canvas_wipeoutsfilter to paper-layout-block entities only so model-block hatches don't get a second copy on the sheet.
Color adaptation
adapt_to_bgnow reaches every entity type: wires (already), hatches, ACIS meshes (Solid3D / Region / Body), 3DFACE filled triangles. NewScene::recolor_meshesrewrites cached mesh colours onBACKGROUNDchange + layout switch so ACIS solids track the live background without re-tessellating.BlockCachestores raw sub-entity colours and appliesadapt_to_bgatBatches::finalizetime with the per-renderbg_color. A single cached block defn now serves model and paper renders simultaneously with the right adaptation per render call — no rebuild needed onBACKGROUNDor layout switch.model_wires_for_viewportadapts model content shown in paper viewports to the paper background (what's actually visible behind the transparent shader), not the model bg.
Mesh / world_offset / UTM precision
- ACIS solids were tessellated straight from the SAT data in WCS while every other path runs in
(WCS - world_offset)— at UTM scale this floated meshes millions of units off camera. The newoffset_mesh_lod_setshifts eachMeshLodSet's verts +world_aabbinto the shared local f32 space at every tessellation call site. - Model-tile cameras +
view_targets round-trip through the DXF/DWGVPorttable withworld_offsetadded back, so saved tiled layouts re-open at the right model coordinates.
Cosmetics + input
- Cursor hidden over the viewport (
Interaction::Hidden) so the CAD crosshair is the only cursor; the OS resize arrow takes over on Model-tile dividers, and the CAD crosshair is suppressed there to avoid double cursors. - Divider hover hit-test + drag pipeline. Border between Model tiles drawn as a 2-px line.
- Render-mode picker, ViewCube hit-area and the active-viewport border follow the active tile in tiled Model layouts and the active viewport in paper layouts.
- Premultiplied-alpha blit fixes the double-darkening of anti-aliased line edges against the now-transparent shader background.
Full Changelog: v0.4.2...v0.4.3