diff --git a/ROADMAP.md b/ROADMAP.md index 654f5c35..1a70d26d 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -14,7 +14,7 @@ end to end today (engine + UI + automation + tests), not what is planned. | Project and files | 8 | 95% | New project from glTF/GLB, FBX (binary and ASCII, 6.x and 7.x), COLLADA, **USD (usda, usdc, usdz)**, **Alembic (Ogawa)**, OBJ, PLY, STL or built-in meshes (auto-unwrap when UVs are missing; a `.gltf`'s buffers and images and a loose USD layer's textures are read from its folder and kept in the project), **project templates** (built-in and saved from a project), `.tcraft` open/save/save as/save a copy, autosave, **asks to save unsaved changes** before quitting or replacing the project (in the browser too, and before the tab closes), recent files, drag and drop, reimport mesh **with strokes preserved on the surface**, **MaterialX import** (`file.importMaterialX`: a `.mtlx` material with `open_pbr_surface`, `standard_surface` or `gltf_pbr` becomes one fill layer with its textures and values), image resources, remove unused resources, textured OBJ (MTL), GLB and **USD** mesh export, browser open/save/download | HDF5 Alembic; Alembic animation (first sample only) | | Texture sets | 6 | 100% | One set per material, **UDIM / UV tiles** (auto-detected or switched on later with resampling, **a resolution per tile** whose filters and height slopes keep their size in UV space, one texture per tile at its own size, `$udim` export), list with visibility (show or hide all, invert, **focus** on one set), sizes 128–8192 with resampling, add/remove channels (19 channel types incl. coat, sheen, anisotropy and scattering), height strength, normal format | — | | Layer stack | 16 | 98% | Paint, fill, folder and **instance** layers; 32 per-channel blend modes and opacities; white/black/painted masks with **mask with height**; generator, fill, levels (with a histogram of its input), invert/threshold, color selection, compare, blur, sharpen and HSL effects on masks and layer content; anchor points; effects **dragged to reorder**, duplicated, and **copied, cut and pasted** across layers, masks and sets (Ctrl+C, Ctrl+X, Ctrl+V, Ctrl+D and Delete act on a selected effect); smart masks; mask view (Alt+click); Alt+click a material channel to keep it alone; duplicate, group, drag to reorder, rename, color tags, copy/cut/paste (also as instance) across sets, flatten, instantiate across sets, save layers as smart materials; **30 library filters** (adjustments incl. histogram scan, range and shift, blur/sharpen/high pass, bevel, glow, edge detect, warps, mosaic, baked lighting, material finishes); **geometry masks** (a layer on chosen mesh parts) | A few niche filters of the reference app's catalog | -| Painting tools | 14 | 91% | Paint, eraser, projection with image stencils, polygon fill, **path** and **lasso fill**, smudge, clone, color picker, quick mask, Shift+click lines with preview, 2D view painting; size, flow, stroke opacity, spacing, hardness, angle, follow path, jitters, alignment, angle fade, backface culling, lazy mouse, **Ctrl+drag in a view for size, hardness, flow and angle**, X/Y/Z mirror and **radial symmetry**, pen pressure in the 3D and 2D views (Windows Ink, and touch pens in the browser), procedural and image alphas, **text** in any installed font (as an alpha or a decal), **particle brush** | Pen tilt, and pen pressure on Linux, macOS and desktop browsers (not exposed by the windowing layer) | +| Painting tools | 14 | 91% | Paint, eraser, projection with image stencils, polygon fill, **path** and **lasso fill**, smudge, clone, material picker, quick mask, Shift+click lines with preview, 2D view painting; size, flow, stroke opacity, spacing, hardness, angle, follow path, jitters, alignment, angle fade, backface culling, lazy mouse, **Ctrl+drag in a view for size, hardness, flow and angle**, X/Y/Z mirror and **radial symmetry**, pen pressure in the 3D and 2D views (Windows Ink, and touch pens in the browser), procedural and image alphas, **text** in any installed font (as an alpha or a decal), **particle brush** | Pen tilt, and pen pressure on Linux, macOS and desktop browsers (not exposed by the windowing layer) | | Materials and assets | 8 | 92% | **MaterialCraft materials** (`.mcmat`, sent to the shelf from MaterialCraft) as fill layers whose graph inputs and presets stay editable, re-cooked at the set's resolution with its baked mesh maps; 63 procedural materials (incl. car paint, velvet, brushed steel, skin, wax, ice, snow, bark), 21 smart materials, 24 smart masks, **67 procedural brush alphas**, **18 brush presets** plus user presets, 23 procedurals, 6 environments plus imported HDR/EXR panoramas, image resources, a user smart material library, a tabbed shelf with search and **drag and drop** onto layers and the viewport | A smaller bundled library than the reference app's | | Baking | 10 | 90% | All ten mesh-map bakers; low-poly and high-to-low baking with CPU/GPU tracing; mesh-name matching, backface filtering, custom and distance-based cages, frontal/rear distances and average normals; undoable 2D cage/skew painting saved per texture set; rectangular output, antialiasing, dilation/diffusion, ID sources, ray filters, AO attenuation/ground plane, curvature controls and map normalization; per-texture-set selection, progress/cancel and mesh-map import | Residual Painter map differences; reference validation for Height, Bent Normal and Opacity and across additional assets; 3D cage-editing overlay | | Viewport and display | 12 | 95% | PBR with image-based lighting, 6 procedural environments or imported HDR/EXR panoramas with exposure, rotation, blur, opacity, ACES/linear tone mapping, HDR pipeline with bloom, vignette, sharpen and grain, key-light shadows, 4× MSAA plus idle temporal accumulation, the baked normal map under the painted normal, channel / mesh-map / mask / UV checker views, 3D and 2D wireframes of the mesh's own polygons, brush cursor, axis gizmos, subsurface scattering blur, **depth of field**, saved cameras and cameras from glTF, FBX, COLLADA and USD files, displacement (also in shadows and the path tracers), **path-traced Rendering mode** (F10, on the GPU or the CPU) with environment importance sampling and an edge-aware **denoiser**; picks a discrete GPU on multi-GPU machines (`--gpu`, `WGPU_ADAPTER_NAME`, `WGPU_POWER_PREF`), and display textures are made on demand so a mesh with many materials imports on a small GPU | Hardware ray tracing | diff --git a/crates/engine/src/painting.rs b/crates/engine/src/painting.rs index 6344311f..cf5c9565 100644 --- a/crates/engine/src/painting.rs +++ b/crates/engine/src/painting.rs @@ -1,5 +1,5 @@ //! Interactive painting on the session: strokes (begin / continue / end / cancel), polygon fill -//! and the color picker. The UI, CLI and agents all go through these. +//! and the material picker. The UI, CLI and agents all go through these. use std::collections::{BTreeMap, BTreeSet}; @@ -555,20 +555,22 @@ impl Session { Ok(()) } - /// Color picker: copy the material under the cursor into the tool's paint values. + /// Material picker: copy the material under the cursor into the tool's paint values pub fn color_pick(&mut self, screen: Vec2, viewport: Vec2) -> Result> { let hit = self.pick(screen, viewport).ok_or_else(|| EngineError::Other("nothing under the cursor".into()))?; - let ts = self.texture_set_of_material(hit.material).unwrap_or(self.ts()); - let cache = self.caches.get(ts).ok_or_else(|| EngineError::Other("texture set not ready".into()))?; - let (w, h) = (cache.size.0 as f32, cache.size.1 as f32); - let (x, y) = ((hit.uv.x * w).clamp(0.0, w - 1.0) as u32, (hit.uv.y * h).clamp(0.0, h - 1.0) as u32); - let mut out = BTreeMap::new(); - for c in cache.composite.channels.keys() { - let v = cache.composite.value(*c, x, y); - self.tool.values.insert(*c, v); - out.insert(*c, v); + let texture_set = self.texture_set_of_material(hit.material).unwrap_or(self.ts()); + let cache = self.caches.get(texture_set).ok_or_else(|| EngineError::Other("texture set not ready".into()))?; + + let (width, height) = (cache.size.0 as f32, cache.size.1 as f32); + let (x, y) = ((hit.uv.x * width).clamp(0.0, width - 1.0) as u32, (hit.uv.y * height).clamp(0.0, height - 1.0) as u32); + + let mut picked = BTreeMap::new(); + for channel in cache.composite.channels.keys() { + let value = cache.composite.value(*channel, x, y); + self.tool.values.insert(*channel, value); + picked.insert(*channel, value); } - Ok(out) + Ok(picked) } /// The stroke canvas alpha of the active stroke (for overlays and tests). diff --git a/crates/engine/src/session.rs b/crates/engine/src/session.rs index 41bfacbb..98490d57 100644 --- a/crates/engine/src/session.rs +++ b/crates/engine/src/session.rs @@ -109,7 +109,7 @@ impl Tool { Tool::PolygonFill => "Polygon fill", Tool::Smudge => "Smudge", Tool::Clone => "Clone", - Tool::ColorPicker => "Color picker", + Tool::ColorPicker => "Material picker", Tool::Path => "Path", Tool::GeometryMask => "Geometry mask", } diff --git a/crates/engine/src/tool_cmds.rs b/crates/engine/src/tool_cmds.rs index 6a390866..4e588ea9 100644 --- a/crates/engine/src/tool_cmds.rs +++ b/crates/engine/src/tool_cmds.rs @@ -20,7 +20,7 @@ pub fn specs() -> Vec { cmd!("tool.polygonFill", "Polygon fill", ["Tools"], Some("4"), "{}", always, |s, _| set_tool(s, Tool::PolygonFill)), cmd!("tool.smudge", "Smudge", ["Tools"], Some("5"), "{}", always, |s, _| set_tool(s, Tool::Smudge)), cmd!("tool.clone", "Clone", ["Tools"], Some("6"), "{}", always, |s, _| set_tool(s, Tool::Clone)), - cmd!("tool.colorPicker", "Color picker", ["Tools"], Some("P"), "{}", always, |s, _| set_tool(s, Tool::ColorPicker)), + cmd!("tool.colorPicker", "Material picker", ["Tools"], Some("P"), "{}", always, |s, _| set_tool(s, Tool::ColorPicker)), cmd!( "tool.geometryMask", "Geometry mask", @@ -105,7 +105,7 @@ pub fn specs() -> Vec { "Tool click", [], None, - "{x, y, viewport?: [w,h]} — polygon fill / color picker / single dab; polygon fill also takes a box {x0, y0, x1, y1, viewport?}, a 2D view point {uv: [u,v]} or a 2D view box {uv0: [u,v], uv1: [u,v]}", + "{x, y, viewport?: [w,h]} — polygon fill / material picker / single dab; polygon fill also takes a box {x0, y0, x1, y1, viewport?}, a 2D view point {uv: [u,v]} or a 2D view box {uv0: [u,v], uv1: [u,v]}", always, click ), diff --git a/crates/ui-egui/src/i18n/ar.rs b/crates/ui-egui/src/i18n/ar.rs index 773514cf..4fa44d5a 100644 --- a/crates/ui-egui/src/i18n/ar.rs +++ b/crates/ui-egui/src/i18n/ar.rs @@ -174,7 +174,6 @@ pub const TABLE: &[(&str, &str)] = &[ ("Color burn", "حرق لوني (Color Burn)"), ("Color dodge", "تفتيح لوني (Color Dodge)"), ("Color of the light that travels under the surface (each channel goes as far as its value)", "لون الضوء المنتقل تحت السطح (تصل كل قناة بقدر قيمتها)"), - ("Color picker", "منتقي الألوان"), ("Color selection", "تحديد لوني"), ("Color to replace", "اللون المراد استبداله"), ("Colors near the first shift towards the second, keeping their shading.", "الألوان القريبة من الأولى تتحول نحو الثانية مع الحفاظ على تظليلها."), @@ -484,6 +483,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("MatFinish Raw", "إنهاء المادة: خام"), ("MatFinish Sanded", "إنهاء المادة: مصنفر"), ("Material", "المادة"), + ("Material picker", "منتقي المواد"), ("Material ball", "كرة المادة"), ("Material finish", "إنهاء المادة"), ("Materials", "المواد"), diff --git a/crates/ui-egui/src/i18n/de.rs b/crates/ui-egui/src/i18n/de.rs index a46b660b..deff726b 100644 --- a/crates/ui-egui/src/i18n/de.rs +++ b/crates/ui-egui/src/i18n/de.rs @@ -180,7 +180,6 @@ pub const TABLE: &[(&str, &str)] = &[ "Color of the light that travels under the surface (each channel goes as far as its value)", "Farbe des Lichts, das unter der Oberfläche wandert (jeder Kanal reicht so weit wie sein Wert)", ), - ("Color picker", "Farbpipette"), ("Color selection", "Farbauswahl"), ("Color to replace", "Zu ersetzende Farbe"), ( @@ -511,6 +510,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("MatFinish Raw", "MatFinish Roh"), ("MatFinish Sanded", "MatFinish Geschmirgelt"), ("Material", "Material"), + ("Material picker", "Materialpipette"), ("Material ball", "Materialkugel"), ("Material finish", "Materialoberfläche"), ("Materials", "Materialien"), diff --git a/crates/ui-egui/src/i18n/es.rs b/crates/ui-egui/src/i18n/es.rs index cde2dbc6..c08a7ff5 100644 --- a/crates/ui-egui/src/i18n/es.rs +++ b/crates/ui-egui/src/i18n/es.rs @@ -177,7 +177,6 @@ pub const TABLE: &[(&str, &str)] = &[ "Color of the light that travels under the surface (each channel goes as far as its value)", "Color de la luz que viaja bajo la superficie (cada canal llega tan lejos como su valor)", ), - ("Color picker", "Cuentagotas"), ("Color selection", "Selección de color"), ("Color to replace", "Color a reemplazar"), ( @@ -502,6 +501,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("MatFinish Raw", "Acabado en bruto"), ("MatFinish Sanded", "Acabado lijado"), ("Material", "Material"), + ("Material picker", "Cuentagotas de material"), ("Material ball", "Bola de material"), ("Material finish", "Acabado de material"), ("Materials", "Materiales"), diff --git a/crates/ui-egui/src/i18n/fr.rs b/crates/ui-egui/src/i18n/fr.rs index 3f4625c0..82038edf 100644 --- a/crates/ui-egui/src/i18n/fr.rs +++ b/crates/ui-egui/src/i18n/fr.rs @@ -183,7 +183,6 @@ pub const TABLE: &[(&str, &str)] = &[ "Color of the light that travels under the surface (each channel goes as far as its value)", "Couleur de la lumière qui se propage sous la surface (chaque canal va aussi loin que sa valeur)", ), - ("Color picker", "Pipette"), ("Color selection", "Sélection de couleur"), ("Color to replace", "Couleur à remplacer"), ( @@ -517,6 +516,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("MatFinish Raw", "MatFinish Brut"), ("MatFinish Sanded", "MatFinish Poncé"), ("Material", "Matériau"), + ("Material picker", "Pipette de matériau"), ("Material ball", "Boule de matériau"), ("Material finish", "Finition du matériau"), ("Materials", "Matériaux"), diff --git a/crates/ui-egui/src/i18n/it.rs b/crates/ui-egui/src/i18n/it.rs index c60fa049..c88a1788 100644 --- a/crates/ui-egui/src/i18n/it.rs +++ b/crates/ui-egui/src/i18n/it.rs @@ -183,7 +183,6 @@ pub const TABLE: &[(&str, &str)] = &[ "Color of the light that travels under the surface (each channel goes as far as its value)", "Colore della luce che viaggia sotto la superficie (ogni canale arriva fino al proprio valore)", ), - ("Color picker", "Contagocce"), ("Color selection", "Selezione colore"), ("Color to replace", "Colore da sostituire"), ( @@ -508,6 +507,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("MatFinish Raw", "MatFinish Grezzo"), ("MatFinish Sanded", "MatFinish Carteggiato"), ("Material", "Materiale"), + ("Material picker", "Contagocce materiale"), ("Material ball", "Sfera materiale"), ("Material finish", "Finitura materiale"), ("Materials", "Materiali"), diff --git a/crates/ui-egui/src/i18n/ja.rs b/crates/ui-egui/src/i18n/ja.rs index d932757e..0770b619 100644 --- a/crates/ui-egui/src/i18n/ja.rs +++ b/crates/ui-egui/src/i18n/ja.rs @@ -186,7 +186,6 @@ pub const TABLE: &[(&str, &str)] = &[ "Color of the light that travels under the surface (each channel goes as far as its value)", "表面下を伝わる光の色 (各チャンネルは値に応じた距離まで届く)", ), - ("Color picker", "カラーピッカー"), ("Color selection", "カラー選択"), ("Color to replace", "置き換える色"), ("Colors near the first shift towards the second, keeping their shading.", "最初の色に近い色が、陰影を保ったまま2番目の色へ移ります。"), @@ -496,6 +495,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("MatFinish Raw", "MatFinish 未加工"), ("MatFinish Sanded", "MatFinish サンディング"), ("Material", "マテリアル"), + ("Material picker", "マテリアルピッカー"), ("Material ball", "マテリアルボール"), ("Material finish", "マテリアル仕上げ"), ("Materials", "マテリアル"), diff --git a/crates/ui-egui/src/i18n/ko.rs b/crates/ui-egui/src/i18n/ko.rs index d636deaf..7ee076da 100644 --- a/crates/ui-egui/src/i18n/ko.rs +++ b/crates/ui-egui/src/i18n/ko.rs @@ -177,7 +177,6 @@ pub const TABLE: &[(&str, &str)] = &[ "Color of the light that travels under the surface (each channel goes as far as its value)", "표면 아래로 이동하는 빛의 색상입니다 (각 채널은 값만큼 멀리 이동)", ), - ("Color picker", "색상 피커"), ("Color selection", "색상 선택"), ("Color to replace", "바꿀 색상"), ("Colors near the first shift towards the second, keeping their shading.", "첫 번째 색상에 가까운 색상이 음영을 유지한 채 두 번째 색상으로 바뀝니다."), @@ -490,6 +489,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("MatFinish Raw", "마감 - 원재료"), ("MatFinish Sanded", "마감 - 샌딩"), ("Material", "머티리얼"), + ("Material picker", "머티리얼 피커"), ("Material ball", "머티리얼 볼"), ("Material finish", "머티리얼 마감"), ("Materials", "머티리얼"), diff --git a/crates/ui-egui/src/i18n/pt_br.rs b/crates/ui-egui/src/i18n/pt_br.rs index 31545043..ddc2e70c 100644 --- a/crates/ui-egui/src/i18n/pt_br.rs +++ b/crates/ui-egui/src/i18n/pt_br.rs @@ -180,7 +180,6 @@ pub const TABLE: &[(&str, &str)] = &[ "Color of the light that travels under the surface (each channel goes as far as its value)", "Cor da luz que viaja sob a superfície (cada canal vai tão longe quanto seu valor)", ), - ("Color picker", "Conta-gotas"), ("Color selection", "Seleção de cor"), ("Color to replace", "Cor a substituir"), ("Colors near the first shift towards the second, keeping their shading.", "As cores próximas da primeira passam para a segunda, mantendo o sombreamento."), @@ -499,6 +498,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("MatFinish Raw", "MatFinish Bruto"), ("MatFinish Sanded", "MatFinish Lixado"), ("Material", "Material"), + ("Material picker", "Conta-gotas de material"), ("Material ball", "Esfera de material"), ("Material finish", "Acabamento de material"), ("Materials", "Materiais"), diff --git a/crates/ui-egui/src/i18n/zh_hans.rs b/crates/ui-egui/src/i18n/zh_hans.rs index c875d82e..d1a4bca9 100644 --- a/crates/ui-egui/src/i18n/zh_hans.rs +++ b/crates/ui-egui/src/i18n/zh_hans.rs @@ -162,7 +162,6 @@ pub const TABLE: &[(&str, &str)] = &[ ("Color burn", "颜色加深"), ("Color dodge", "颜色减淡"), ("Color of the light that travels under the surface (each channel goes as far as its value)", "在表面下传播的光的颜色(各通道的传播距离取决于其值)"), - ("Color picker", "拾色器"), ("Color selection", "颜色选择"), ("Color to replace", "要替换的颜色"), ("Colors near the first shift towards the second, keeping their shading.", "接近第一种颜色的颜色会在保留明暗的同时转向第二种颜色。"), @@ -454,6 +453,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("MatFinish Raw", "表面处理:原始"), ("MatFinish Sanded", "表面处理:砂磨"), ("Material", "材质"), + ("Material picker", "材质拾取器"), ("Material ball", "材质球"), ("Material finish", "材质表面处理"), ("Materials", "材质"), diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index 054b1d83..0be16695 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -23,17 +23,17 @@ const BAR_HEIGHT: f32 = 40.0; /// Padding inside the top bar card on its left and right, in points const BAR_PADDING: egui::Margin = egui::Margin::symmetric(8, 0); -pub fn tool_icon(t: Tool) -> &'static str { - match t { +pub fn tool_icon(tool: Tool) -> &'static str { + match tool { Tool::Paint => ic::PAINT_BRUSH, Tool::Eraser => ic::ERASER, - Tool::Projection => ic::PROJECTOR_SCREEN, + Tool::Projection => ic::CUBE_FOCUS, Tool::PolygonFill => ic::POLYGON, Tool::Smudge => ic::FINGERPRINT, Tool::Clone => ic::STAMP, Tool::ColorPicker => ic::EYEDROPPER, - Tool::Path => ic::PATH, - Tool::GeometryMask => ic::CUBE_FOCUS, + Tool::Path => ic::PEN_NIB_STRAIGHT, + Tool::GeometryMask => ic::SELECTION_SLASH, } } diff --git a/docs/features.md b/docs/features.md index a51352da..4a95356d 100644 --- a/docs/features.md +++ b/docs/features.md @@ -16,7 +16,7 @@ Everything TextureCraft does today, by area. What's still missing is in [`ROADMA stroke and keep the size; save your own brushes there too. - **Tools:** paint, eraser, **projection** with image stencils (hold S to move, turn and scale the stencil), polygon fill (triangle, UV island or the whole mesh), **path** and **lasso fill**, a - **particle brush**, **smudge**, **clone** (V + click sets the source), color picker, Shift+click + **particle brush**, **smudge**, **clone** (V + click sets the source), material picker, Shift+click straight lines, and painting directly in the **2D UV view**. - **Geometry decals:** drop an image on the surface, then move, scale and turn its frame; it stays an editable fill layer.