feat(render): phase 0 — render-mode pick_list + 3-flag pipeline plumbing

Replaces the binary Wireframe/Solid toggle with a 7-mode dropdown
that maps onto acadrust's `ViewportRenderMode` enum: Wireframe 2D /
Wireframe 3D / Hidden Line / Flat Shaded / Gouraud Shaded / Flat
Shaded + Edges / Gouraud Shaded + Edges. Per-tab state lives on
`DocumentTab::render_mode`; the old `SetWireframe` message forwards
to `SetRenderMode` so the ribbon + WIREFRAME / SOLID command line
keep working.

`scene::render::render_mode_flags()` translates the mode into three
pipeline-facing booleans (`face3d_fill`, `mesh_fill`,
`show_3d_edges`); `mesh_fill` / `show_3d_edges` are stubs that the
upcoming phases will consume. `Primitive` carries the derived
`view_wireframe` plus the two new fields through to `prepare()`.

`Pipeline::upload_face3d` takes a `wireframe_only` flag that drops
3DFACE quad fills (built from `key_vertices`) while keeping the
`all_wires.fill_tris` channel — that channel carries text-LOD greek
rectangles and PolyfaceMesh face triangles which must stay visible
in wireframe mode. 3DFACE edges stay on regardless of mode.

Solid3D mesh wireframe rendering, Hidden Line z-prepass, and Flat /
Gouraud shader uniforms come in phases 1–4.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.7 committed 2026-05-27 00:08:37 +03:00
1 parent 5ea996d5fe
commit 2145ab8a66
8 files changed
+273 -90

No files matched your search

+1 -39
View File
@@ -1,10 +1,9 @@
//! Viewport overlay widgets:
//! • info_bar() — top-left bracket buttons showing view name / style
//! • nav_toolbar() — vertical orbit/pan/zoom buttons on the right
use glam::{Mat4, Vec3};
use iced::mouse;
use iced::widget::{button, canvas, column, container, row, text};
use iced::widget::{button, canvas, column, container, text};
use iced::{Background, Border, Color, Element, Length, Point, Size, Theme};
use crate::app::Message;
@@ -30,43 +29,6 @@ pub struct GripMarker {
pub is_hot: bool,
}
// ── Info bar ─────────────────────────────────────────────────────────────
pub fn info_bar<'a>(view_name: &'a str, visual_style: &'a str) -> Element<'a, Message> {
let bracket = |s: &'a str| -> Element<'a, Message> {
container(text(s).size(10).color(Color {
r: 0.78,
g: 0.78,
b: 0.78,
a: 1.0,
}))
.style(|_: &Theme| container::Style {
background: Some(Background::Color(Color {
r: 0.10,
g: 0.10,
b: 0.10,
a: 0.75,
})),
border: Border {
color: Color {
r: 0.35,
g: 0.35,
b: 0.35,
a: 1.0,
},
width: 1.0,
radius: 0.0.into(),
},
..Default::default()
})
.padding([2, 6])
.into()
};
row![bracket("[-]"), bracket(view_name), bracket(visual_style)]
.spacing(0)
.into()
}
// ── Nav toolbar ───────────────────────────────────────────────────────────
pub fn nav_toolbar<'a>() -> Element<'a, Message> {