From e56022230bdb64200830fb4eb2c317fcc30e29f9 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 1 Nov 2026 12:40:36 +0700 Subject: [PATCH] Geometry masks: layers on chosen mesh parts A layer or folder can show only on the mesh parts you pick: right-click a layer > Geometry mask lists the parts of its texture set as checkboxes; Show on all parts clears it. - Layer.geometry_mask (part names, serde default); the compositor zeroes the layer's mask on texels whose triangle (UV G-buffer) lies in another part, so it combines with painted masks, mask with height, folders and anchors; an instance keeps its own - layer.set {geometryMask: [names] | null} (unknown parts refused), textureSet.parts {ts?}; inspect shows geometryMask per layer and parts per set - translations for the menu labels in all eight UI languages - tests: compositor split of one material into two parts; engine commands on a two-object OBJ (parts, masked composite, refused input, inspect, undo, clear) --- crates/compose/src/eval.rs | 49 +++++++++++++++++++++++- crates/core/src/layer.rs | 4 ++ crates/engine/src/inspect.rs | 4 ++ crates/engine/src/instance_cmds.rs | 59 +++++++++++++++++++++-------- crates/engine/src/set_cmds.rs | 24 ++++++++++++ crates/engine/tests/painter_gaps.rs | 30 +++++++++++++++ crates/ui-egui/src/dock.rs | 28 ++++++++++++++ crates/ui-egui/src/i18n/de.rs | 2 + crates/ui-egui/src/i18n/es.rs | 2 + crates/ui-egui/src/i18n/fr.rs | 2 + crates/ui-egui/src/i18n/it.rs | 2 + crates/ui-egui/src/i18n/ja.rs | 2 + crates/ui-egui/src/i18n/ko.rs | 2 + crates/ui-egui/src/i18n/pt_br.rs | 2 + crates/ui-egui/src/i18n/zh_hans.rs | 2 + docs/features.md | 3 +- 16 files changed, 199 insertions(+), 18 deletions(-) diff --git a/crates/compose/src/eval.rs b/crates/compose/src/eval.rs index 3ef7c327..f9f7e183 100644 --- a/crates/compose/src/eval.rs +++ b/crates/compose/src/eval.rs @@ -711,6 +711,8 @@ struct Node<'a> { /// The node or one of its children records an anchor. has_anchor: bool, height_mask: HeightMask, + /// Geometry mask: whether the layer shows on each mesh submesh (None: everywhere). + parts: Option>, } /// Plans of the visible effects of a stack: mask effects (`channel` None) or the content @@ -830,7 +832,9 @@ fn plan_node<'a>( let mask = layer_mask(inp.project, id).and_then(|m| mask_plan(inp, id, m, tx, ty, fields)); let anchors = if fx { anchor_cuts(&layer.content_effects) } else { Vec::new() }; let has_anchor = !anchors.is_empty() || matches!(&content, Content::Group(nodes) if nodes.iter().any(|n| n.has_anchor)); - Some(Node { id, content, chans, mask, anchors, has_anchor, height_mask: layer.height_mask }) + // The geometry mask is the layer's own (an instance in another set has other parts). + let parts = own.geometry_mask.as_ref().map(|names| inp.mesh.submeshes.iter().map(|s| names.contains(&s.name)).collect()); + Some(Node { id, content, chans, mask, anchors, has_anchor, height_mask: layer.height_mask, parts }) } /// The visible anchor points of a content stack with where they cut it: after their index among @@ -1278,6 +1282,9 @@ impl<'a, 'b> Texel<'a, 'b> { /// The mask of node `n` at this texel, combined with the layer's height when it masks with /// height. fn node_mask(&mut self, n: &Node) -> f32 { + if n.parts.as_ref().is_some_and(|p| !self.in_parts(p)) { + return 0.0; + } let m = match &n.mask { Some(mp) => self.mask(mp), None => 1.0, @@ -1290,6 +1297,22 @@ impl<'a, 'b> Texel<'a, 'b> { n.height_mask.apply(m, h) } + /// Whether this texel's triangle lies in a submesh `allowed` marks (uncovered texels and + /// meshes without submeshes count as inside). + fn in_parts(&self, allowed: &[bool]) -> bool { + let g = self.inp.gbuf; + let tri = g.tri.get((self.y * g.width + self.x) as usize).copied().unwrap_or(NO_TRI); + if tri == NO_TRI { + return true; + } + let first = tri.saturating_mul(3); + let subs = &self.inp.mesh.submeshes; + let holds = |k: usize| subs.get(k).is_some_and(|s| s.start <= first && first < s.start.saturating_add(s.count)); + // Submeshes are in index order; anything else is searched. + let k = subs.partition_point(|s| s.start <= first).checked_sub(1).filter(|k| holds(*k)).or_else(|| (0..subs.len()).find(|k| holds(*k))); + k.and_then(|k| allowed.get(k).copied()).unwrap_or(true) + } + /// Record the anchors of the stack below layer `id` (`full` is the planned stack), to /// evaluate that layer on its own. fn anchors_below(&mut self, full: &[Node], id: LayerId) { @@ -2217,6 +2240,30 @@ soft {soft:?}" assert_eq!(Filter::Invert.baked_light([0.0; 3], 1.0), None); } + #[test] + fn geometry_masks_show_layers_on_chosen_parts_only() { + let mut f = fixture(); + // Two parts of the plane's one material: the first half of its triangles and the rest. + let n = f.mesh.indices.len() as u32 / 6 * 3; + f.mesh.submeshes = vec![ + texturecraft_geom::SubMesh { name: "Lid".into(), material: 0, start: 0, count: n }, + texturecraft_geom::SubMesh { name: "Body".into(), material: 0, start: n, count: f.mesh.indices.len() as u32 - n }, + ]; + let id = fill_layer(&mut f.project, [1.0, 0.0, 0.0], 0.2); + let red = |f: &Fixture| { + let out = run(f, None); + (0..64 * 64).filter(|i| close(out.value(Channel::BaseColor, i % 64, i / 64), [1.0, 0.0, 0.0])).count() + }; + let all = red(&f); + f.project.layer_mut(id).unwrap().geometry_mask = Some(vec!["Lid".into()]); + let lid = red(&f); + f.project.layer_mut(id).unwrap().geometry_mask = Some(vec!["Body".into()]); + let body = red(&f); + assert!(lid > 0 && body > 0 && lid + body == all, "{lid} + {body} of {all}"); + f.project.layer_mut(id).unwrap().geometry_mask = Some(Vec::new()); + assert_eq!(red(&f), 0, "no parts: hidden everywhere"); + } + #[test] fn content_paint_and_fill_effects_add_to_layers() { let mut f = fixture(); diff --git a/crates/core/src/layer.rs b/crates/core/src/layer.rs index 2744329a..58a34c17 100644 --- a/crates/core/src/layer.rs +++ b/crates/core/src/layer.rs @@ -42,6 +42,9 @@ pub struct Layer { /// Combine the mask with the layer's height ("mask with height"). #[serde(default)] pub height_mask: HeightMask, + /// Geometry mask: the mesh parts (submesh names) the layer shows on; None shows it on all. + #[serde(default)] + pub geometry_mask: Option>, } /// Mask with height: partial mask values follow the layer's own height, so a transition @@ -112,6 +115,7 @@ impl Layer { content_effects: Vec::new(), color_tag: None, height_mask: HeightMask::default(), + geometry_mask: None, } } diff --git a/crates/engine/src/inspect.rs b/crates/engine/src/inspect.rs index 8bfd066a..9baa23c8 100644 --- a/crates/engine/src/inspect.rs +++ b/crates/engine/src/inspect.rs @@ -78,6 +78,9 @@ fn layer_json(s: &Session, l: &Layer, depth: usize) -> Value { if l.height_mask.enabled { v["heightMask"] = json!({ "contrast": l.height_mask.contrast, "offset": l.height_mask.offset }); } + if let Some(parts) = &l.geometry_mask { + v["geometryMask"] = json!(parts); + } if matches!(l.kind, LayerKind::Paint) { // Sorted: the store is a hash map, and inspect output must be stable. let mut painted: Vec<(&str, usize)> = @@ -130,6 +133,7 @@ pub fn texture_set(s: &Session, i: usize) -> Value { "tiles": tiles, "channels": t.channels.iter().map(|(c, f)| json!({ "channel": c.id(), "format": f.label() })).collect::>(), "layers": s.doc.project.walk(i).len(), + "parts": crate::set_cmds::parts(s, i), "baked": crate::project_cmds::baked_json(s.doc.baked.get(&i)), "visible": t.visible, "active": i == s.ts(), diff --git a/crates/engine/src/instance_cmds.rs b/crates/engine/src/instance_cmds.rs index eb0a6a4a..8e6b7e21 100644 --- a/crates/engine/src/instance_cmds.rs +++ b/crates/engine/src/instance_cmds.rs @@ -33,7 +33,7 @@ pub fn specs() -> Vec { "Set layer properties", [], None, - "{layer?, heightMask?: {enabled?, contrast?: 0..64, offset?: -1..1} | bool} — mask with height: m' = saturate(m + contrast·4m(1−m)·(height + offset))", + "{layer?, heightMask?: {enabled?, contrast?: 0..64, offset?: -1..1} | bool, geometryMask?: [part names] | null} — mask with height: m' = saturate(m + contrast·4m(1−m)·(height + offset)); geometry mask: the mesh parts (textureSet.parts) the layer shows on, null for all", has_layer, set ), @@ -138,26 +138,53 @@ pub(crate) fn prune_pixels(doc: &mut Document) { } fn set(s: &mut Session, p: &Value) -> Result { - // Linked properties live on an instance's source. - let id = content_param(s, "layer.set", p)?; + let cmd = "layer.set"; + // Linked properties live on an instance's source; the geometry mask is the layer's own + // (an instance in another texture set has other parts). + let (own, id) = (layer_param(s, cmd, p)?, content_param(s, cmd, p)?); let hm = match p.get("heightMask") { - Some(Value::Bool(on)) => json!({ "enabled": on }), - Some(v @ Value::Object(_)) => v.clone(), - Some(_) => return Err(bad("layer.set", "`heightMask` must be an object {enabled?, contrast?, offset?} or a bool")), - None => return Err(bad("layer.set", "give `heightMask`")), + Some(Value::Bool(on)) => Some(json!({ "enabled": on })), + Some(v @ Value::Object(_)) => Some(v.clone()), + Some(_) => return Err(bad(cmd, "`heightMask` must be an object {enabled?, contrast?, offset?} or a bool")), + None => None, }; + let geometry = match p.get("geometryMask") { + None => None, + Some(Value::Null) => Some(None), + Some(Value::Array(a)) => { + let names: Option> = a.iter().map(|v| v.as_str().map(str::to_string)).collect(); + let names = names.ok_or_else(|| bad(cmd, "`geometryMask` must be a list of part names or null"))?; + let ts = s.doc.project.locate(own).map_or(s.ts(), |(ts, _, _)| ts); + let known = crate::set_cmds::parts(s, ts); + if let Some(unknown) = names.iter().find(|n| !known.contains(n)) { + return Err(bad(cmd, format!("unknown mesh part `{unknown}` (parts: {})", known.join(", ")))); + } + Some(Some(names)) + } + Some(_) => return Err(bad(cmd, "`geometryMask` must be a list of part names or null")), + }; + if hm.is_none() && geometry.is_none() { + return Err(bad(cmd, "give `heightMask` or `geometryMask`")); + } let out = s.edit("Layer properties", |s| { + if let Some(g) = geometry { + s.doc.project.layer_mut(own)?.geometry_mask = g; + } let h = &mut s.doc.project.layer_mut(id)?.height_mask; - if let Some(on) = boolp(&hm, "enabled") { - h.enabled = on; + if let Some(hm) = &hm { + if let Some(on) = boolp(hm, "enabled") { + h.enabled = on; + } + if let Some(c) = f32p(hm, "contrast") { + h.contrast = c.clamp(0.0, 64.0); + } + if let Some(o) = f32p(hm, "offset") { + h.offset = o.clamp(-1.0, 1.0); + } } - if let Some(c) = f32p(&hm, "contrast") { - h.contrast = c.clamp(0.0, 64.0); - } - if let Some(o) = f32p(&hm, "offset") { - h.offset = o.clamp(-1.0, 1.0); - } - Ok(json!({ "layer": id.0, "heightMask": { "enabled": h.enabled, "contrast": h.contrast, "offset": h.offset } })) + let h = *h; + let g = s.doc.project.layers.get(&own).and_then(|l| l.geometry_mask.clone()); + Ok(json!({ "layer": own.0, "heightMask": { "enabled": h.enabled, "contrast": h.contrast, "offset": h.offset }, "geometryMask": g })) })?; Ok(out) } diff --git a/crates/engine/src/set_cmds.rs b/crates/engine/src/set_cmds.rs index 3de3ffb1..d311b65d 100644 --- a/crates/engine/src/set_cmds.rs +++ b/crates/engine/src/set_cmds.rs @@ -30,9 +30,33 @@ pub fn specs() -> Vec { cmd!("textureSet.visible", "Toggle texture set visibility", [], None, "{ts?, visible?}", always, visible), cmd!("textureSet.rename", "Rename texture set", [], None, "{ts?, name}", always, rename), cmd!("textureSet.settings", "Texture set settings", [], None, "{ts?, description?, heightStrength?, normalFormat?: openGl|directX}", always, settings), + cmd!( + "textureSet.parts", + "List mesh parts", + [], + None, + "{ts?} — the mesh parts (submesh names) of a texture set, for geometry masks", + always, + |s, p| { + let ts = ts_param(s, p, "textureSet.parts")?; + Ok(json!(parts(s, ts))) + } + ), ] } +/// The mesh parts (submesh names, in mesh order, each once) of texture set `ts`. +pub fn parts(s: &Session, ts: usize) -> Vec { + let Some(material) = s.doc.project.texture_sets.get(ts).map(|t| t.material) else { return Vec::new() }; + let mut out: Vec = Vec::new(); + for sm in s.mesh.submeshes.iter().filter(|sm| sm.material == material) { + if !out.contains(&sm.name) { + out.push(sm.name.clone()); + } + } + out +} + pub(crate) fn ts_param(s: &Session, p: &Value, cmd: &str) -> Result { match u64p(p, "ts") { Some(t) if (t as usize) < s.set_count() => Ok(t as usize), diff --git a/crates/engine/tests/painter_gaps.rs b/crates/engine/tests/painter_gaps.rs index c7a68ebf..406dde12 100644 --- a/crates/engine/tests/painter_gaps.rs +++ b/crates/engine/tests/painter_gaps.rs @@ -121,6 +121,36 @@ fn filter_library_adds_every_filter_and_edits_its_parameters() { assert!(at(&mut s, Channel::BaseColor, 200.0, 200.0).iter().all(|v| v.is_finite())); } +/// Two OBJ objects in one texture set: a fill shows on the parts its geometry mask names. +#[test] +fn geometry_masks_limit_layers_to_mesh_parts() { + let obj = "o Lid\nv 0 0 0\nv 1 0 0\nv 0 1 0\nvt 0 0\nvt 0.5 0\nvt 0 0.5\nf 1/1 2/2 3/3\n\ + o Body\nv 1 1 0\nv 2 1 0\nv 1 2 0\nvt 0.5 0.5\nvt 1 0.5\nvt 0.5 1\nf 4/4 5/5 6/6\n"; + let mut s = Session::from_mesh_bytes("parts.obj", obj.as_bytes(), 256, "parts").unwrap(); + assert_eq!(execute(&mut s, "textureSet.parts", &Value::Null).unwrap(), json!(["Lid", "Body"])); + let layer = id(execute(&mut s, "layer.add.fill", &json!({"color": [1, 0, 0]})).unwrap(), "layer"); + // Texels inside each triangle (OBJ v is flipped to the top-left origin). + let texel = |s: &mut Session, u: f32, v: f32| { + s.update(); + let (w, h) = s.caches[0].size; + red(s.caches[0].composite.value(Channel::BaseColor, (u * w as f32) as u32, (v * h as f32) as u32)) + }; + assert!(texel(&mut s, 0.1, 0.9) && texel(&mut s, 0.6, 0.4)); + let r = execute(&mut s, "layer.set", &json!({"layer": layer.0, "geometryMask": ["Body"]})).unwrap(); + assert_eq!(r["geometryMask"], json!(["Body"])); + assert!(!texel(&mut s, 0.1, 0.9) && texel(&mut s, 0.6, 0.4), "only on Body"); + assert!(execute(&mut s, "project.inspect", &Value::Null).unwrap().to_string().contains("geometryMask")); + assert!(execute(&mut s, "layer.set", &json!({"layer": layer.0, "geometryMask": ["Nope"]})).is_err()); + assert!(execute(&mut s, "layer.set", &json!({"layer": layer.0, "geometryMask": "Body"})).is_err()); + assert!(execute(&mut s, "layer.set", &json!({"layer": layer.0})).is_err()); + execute(&mut s, "edit.undo", &Value::Null).unwrap(); + assert!(texel(&mut s, 0.1, 0.9), "undone"); + execute(&mut s, "layer.set", &json!({"layer": layer.0, "geometryMask": []})).unwrap(); + assert!(!texel(&mut s, 0.1, 0.9) && !texel(&mut s, 0.6, 0.4), "no parts: hidden"); + execute(&mut s, "layer.set", &json!({"layer": layer.0, "geometryMask": null})).unwrap(); + assert!(texel(&mut s, 0.1, 0.9) && texel(&mut s, 0.6, 0.4)); +} + #[test] fn decals_project_an_image_from_a_frame_placed_on_the_surface() { let mut s = session(); diff --git a/crates/ui-egui/src/dock.rs b/crates/ui-egui/src/dock.rs index f1607343..d62708c7 100644 --- a/crates/ui-egui/src/dock.rs +++ b/crates/ui-egui/src/dock.rs @@ -521,6 +521,33 @@ fn effect_row(app: &mut TextureCraftApp, ui: &mut Ui, layer: &Layer, eid: LayerI }); } +/// Geometry mask: the mesh parts of the layer's texture set it shows on (when the set has +/// several parts). +fn geometry_mask_menu(app: &mut TextureCraftApp, ui: &mut Ui, layer: &Layer) { + let ts = app.session.doc.project.locate(layer.id).map_or(app.session.ts(), |(ts, _, _)| ts); + let parts = texturecraft_engine::set_cmds::parts(&app.session, ts); + if parts.len() < 2 { + return; + } + let lid = layer.id.0; + let shown = layer.geometry_mask.clone().unwrap_or_else(|| parts.clone()); + ui.menu_button(tr("Geometry mask"), |ui| { + for part in &parts { + let mut on = shown.contains(part); + if ui.checkbox(&mut on, part.as_str()).changed() { + let next: Vec<&String> = parts.iter().filter(|q| if *q == part { on } else { shown.contains(q) }).collect(); + let value = if next.len() == parts.len() { Value::Null } else { json!(next) }; + app.run("layer.set", json!({"layer": lid, "geometryMask": value})); + } + } + ui.separator(); + if ui.add_enabled(layer.geometry_mask.is_some(), egui::Button::new(tr("Show on all parts"))).clicked() { + app.run("layer.set", json!({"layer": lid, "geometryMask": null})); + ui.close(); + } + }); +} + fn layer_context_menu(app: &mut TextureCraftApp, ui: &mut Ui, layer: &Layer) { let tk = Tokens::get(ui.ctx()); ui.set_min_width(230.0); @@ -549,6 +576,7 @@ fn layer_context_menu(app: &mut TextureCraftApp, ui: &mut Ui, layer: &Layer) { run(app, ui, tr("Invert mask"), "mask.invert", json!({"layer": lid}), has_mask); run(app, ui, tr("Clear mask"), "mask.clear", json!({"layer": lid}), has_mask); run(app, ui, tr("Remove mask"), "mask.remove", json!({"layer": lid}), has_mask); + geometry_mask_menu(app, ui, layer); ui.separator(); run(app, ui, tr("Flatten layer"), "layer.flatten", json!({"layer": lid}), !layer.is_group()); #[cfg(not(target_arch = "wasm32"))] diff --git a/crates/ui-egui/src/i18n/de.rs b/crates/ui-egui/src/i18n/de.rs index 1f4ded16..004c7305 100644 --- a/crates/ui-egui/src/i18n/de.rs +++ b/crates/ui-egui/src/i18n/de.rs @@ -341,6 +341,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("From template", "Aus Vorlage"), ("From template / project", "Aus Vorlage / Projekt"), ("Full", "Voll"), + ("Geometry mask", "Geometriemaske"), ( "GGX specular with height-correlated Smith visibility, Lambert diffuse, split-sum image-based lighting with spherical-harmonics irradiance and horizon fading.", "GGX-Specular mit höhenkorrelierter Smith-Sichtbarkeit, Lambert-Diffus, bildbasierte Split-Sum-Beleuchtung mit Irradianz aus sphärischen Harmonischen und Horizont-Ausblendung.", @@ -723,6 +724,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("Sheen weight", "Schimmer-Gewichtung"), ("Shift + wheel", "Umschalt + Mausrad"), ("Shortcuts list...", "Liste der Tastenkürzel..."), + ("Show on all parts", "Auf allen Teilen zeigen"), ("Show UV wireframe in the 2D view", "UV-Drahtgitter in der 2D-Ansicht anzeigen"), ("Show entire mesh", "Gesamtes Mesh anzeigen"), ("Show log...", "Protokoll anzeigen..."), diff --git a/crates/ui-egui/src/i18n/es.rs b/crates/ui-egui/src/i18n/es.rs index c4eb07ad..3c091741 100644 --- a/crates/ui-egui/src/i18n/es.rs +++ b/crates/ui-egui/src/i18n/es.rs @@ -338,6 +338,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("From template", "Desde la plantilla"), ("From template / project", "Desde la plantilla / el proyecto"), ("Full", "Completa"), + ("Geometry mask", "Máscara de geometría"), ( "GGX specular with height-correlated Smith visibility, Lambert diffuse, split-sum image-based lighting with spherical-harmonics irradiance and horizon fading.", "Especular GGX con visibilidad Smith correlacionada con la altura, difuso Lambert, iluminación basada en imagen de suma dividida con irradiancia por armónicos esféricos y atenuación en el horizonte.", @@ -717,6 +718,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("Sheen weight", "Peso del lustre"), ("Shift + wheel", "Mayús + rueda"), ("Shortcuts list...", "Lista de atajos..."), + ("Show on all parts", "Mostrar en todas las partes"), ("Show UV wireframe in the 2D view", "Mostrar la malla de alambre UV en la vista 2D"), ("Show entire mesh", "Mostrar toda la malla"), ("Show log...", "Mostrar registro..."), diff --git a/crates/ui-egui/src/i18n/fr.rs b/crates/ui-egui/src/i18n/fr.rs index 57aaec06..7245fb38 100644 --- a/crates/ui-egui/src/i18n/fr.rs +++ b/crates/ui-egui/src/i18n/fr.rs @@ -344,6 +344,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("From template", "Selon le modèle"), ("From template / project", "Selon le modèle / projet"), ("Full", "Pleine"), + ("Geometry mask", "Masque de géométrie"), ( "GGX specular with height-correlated Smith visibility, Lambert diffuse, split-sum image-based lighting with spherical-harmonics irradiance and horizon fading.", "Spéculaire GGX avec visibilité de Smith corrélée à la hauteur, diffus Lambert, éclairage basé sur l'image en split-sum avec irradiance en harmoniques sphériques et atténuation à l'horizon.", @@ -729,6 +730,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("Sheen weight", "Poids du lustre"), ("Shift + wheel", "Shift + molette"), ("Shortcuts list...", "Liste des raccourcis..."), + ("Show on all parts", "Afficher sur toutes les parties"), ("Show UV wireframe in the 2D view", "Afficher le filaire UV dans la vue 2D"), ("Show entire mesh", "Afficher tout le maillage"), ("Show log...", "Afficher le journal..."), diff --git a/crates/ui-egui/src/i18n/it.rs b/crates/ui-egui/src/i18n/it.rs index 23c1abb7..7958274e 100644 --- a/crates/ui-egui/src/i18n/it.rs +++ b/crates/ui-egui/src/i18n/it.rs @@ -341,6 +341,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("From template", "Da modello"), ("From template / project", "Da modello / progetto"), ("Full", "Piena"), + ("Geometry mask", "Maschera geometria"), ( "GGX specular with height-correlated Smith visibility, Lambert diffuse, split-sum image-based lighting with spherical-harmonics irradiance and horizon fading.", "Speculare GGX con visibilità Smith correlata all'altezza, diffusa Lambert, illuminazione basata su immagine split-sum con irradianza in armoniche sferiche e attenuazione all'orizzonte.", @@ -723,6 +724,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("Sheen weight", "Peso sheen"), ("Shift + wheel", "Maiusc + rotella"), ("Shortcuts list...", "Elenco scorciatoie..."), + ("Show on all parts", "Mostra su tutte le parti"), ("Show UV wireframe in the 2D view", "Mostra il wireframe UV nella vista 2D"), ("Show entire mesh", "Mostra intera mesh"), ("Show log...", "Mostra log..."), diff --git a/crates/ui-egui/src/i18n/ja.rs b/crates/ui-egui/src/i18n/ja.rs index 2c96bced..c8b51a43 100644 --- a/crates/ui-egui/src/i18n/ja.rs +++ b/crates/ui-egui/src/i18n/ja.rs @@ -332,6 +332,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("From template", "テンプレートから"), ("From template / project", "テンプレート / プロジェクトから"), ("Full", "フル"), + ("Geometry mask", "ジオメトリマスク"), ( "GGX specular with height-correlated Smith visibility, Lambert diffuse, split-sum image-based lighting with spherical-harmonics irradiance and horizon fading.", "GGXスペキュラー (高さ相関Smithビジビリティ)、Lambertディフューズ、球面調和関数による放射照度とホライズンフェードを用いたスプリットサムのイメージベースドライティング。", @@ -705,6 +706,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("Sheen weight", "シーンウェイト"), ("Shift + wheel", "Shift + ホイール"), ("Shortcuts list...", "ショートカット一覧..."), + ("Show on all parts", "すべてのパーツに表示"), ("Show UV wireframe in the 2D view", "2DビューにUVワイヤーフレームを表示"), ("Show entire mesh", "メッシュ全体を表示"), ("Show log...", "ログを表示..."), diff --git a/crates/ui-egui/src/i18n/ko.rs b/crates/ui-egui/src/i18n/ko.rs index d3dd7a4d..64ca3e54 100644 --- a/crates/ui-egui/src/i18n/ko.rs +++ b/crates/ui-egui/src/i18n/ko.rs @@ -329,6 +329,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("From template", "템플릿 기준"), ("From template / project", "템플릿 / 프로젝트 기준"), ("Full", "전체"), + ("Geometry mask", "지오메트리 마스크"), ( "GGX specular with height-correlated Smith visibility, Lambert diffuse, split-sum image-based lighting with spherical-harmonics irradiance and horizon fading.", "높이 상관 Smith 가시성을 사용하는 GGX 스페큘러, Lambert 디퓨즈, 구면 조화 함수 조도와 수평선 페이딩을 적용한 분할 합 이미지 기반 라이팅.", @@ -699,6 +700,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("Sheen weight", "쉰 가중치"), ("Shift + wheel", "Shift + 휠"), ("Shortcuts list...", "단축키 목록..."), + ("Show on all parts", "모든 파트에 표시"), ("Show UV wireframe in the 2D view", "2D 뷰에 UV 와이어프레임 표시"), ("Show entire mesh", "전체 메시 표시"), ("Show log...", "로그 표시..."), diff --git a/crates/ui-egui/src/i18n/pt_br.rs b/crates/ui-egui/src/i18n/pt_br.rs index d9f19c45..52b20516 100644 --- a/crates/ui-egui/src/i18n/pt_br.rs +++ b/crates/ui-egui/src/i18n/pt_br.rs @@ -341,6 +341,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("From template", "Do modelo"), ("From template / project", "Do modelo / projeto"), ("Full", "Completa"), + ("Geometry mask", "Máscara de geometria"), ( "GGX specular with height-correlated Smith visibility, Lambert diffuse, split-sum image-based lighting with spherical-harmonics irradiance and horizon fading.", "Especular GGX com visibilidade Smith correlacionada à altura, difuso Lambert, iluminação baseada em imagem com soma dividida, irradiância por harmônicos esféricos e atenuação no horizonte.", @@ -717,6 +718,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("Sheen weight", "Peso do lustro"), ("Shift + wheel", "Shift + roda do mouse"), ("Shortcuts list...", "Lista de atalhos..."), + ("Show on all parts", "Mostrar em todas as partes"), ("Show UV wireframe in the 2D view", "Exibir wireframe das UVs na vista 2D"), ("Show entire mesh", "Exibir malha inteira"), ("Show log...", "Exibir log..."), diff --git a/crates/ui-egui/src/i18n/zh_hans.rs b/crates/ui-egui/src/i18n/zh_hans.rs index c5b99480..abc4409f 100644 --- a/crates/ui-egui/src/i18n/zh_hans.rs +++ b/crates/ui-egui/src/i18n/zh_hans.rs @@ -296,6 +296,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("From template", "基于模板"), ("From template / project", "基于模板 / 项目"), ("Full", "完整"), + ("Geometry mask", "几何遮罩"), ( "GGX specular with height-correlated Smith visibility, Lambert diffuse, split-sum image-based lighting with spherical-harmonics irradiance and horizon fading.", "GGX 高光与高度相关的 Smith 可见性项、Lambert 漫反射、拆分求和的基于图像的光照,以及球谐辐照度与地平线衰减。", @@ -648,6 +649,7 @@ pub const TABLE: &[(&str, &str)] = &[ ("Sheen weight", "绒光权重"), ("Shift + wheel", "Shift + 滚轮"), ("Shortcuts list...", "快捷键列表..."), + ("Show on all parts", "在所有部件上显示"), ("Show UV wireframe in the 2D view", "在 2D 视图中显示 UV 线框"), ("Show entire mesh", "显示整个网格"), ("Show log...", "显示日志..."), diff --git a/docs/features.md b/docs/features.md index eef951df..04277876 100644 --- a/docs/features.md +++ b/docs/features.md @@ -24,7 +24,8 @@ Everything TextureCraft does today, by area. What's still missing is in [`ROADMA - **Paint, fill, folder and instance layers** with **32 blend modes per channel** (Normal through Normal map detail), per-channel opacity, visibility, color tags, drag-and-drop reordering, - duplicate, group, flatten, cut, copy and paste across texture sets. + duplicate, group, flatten, cut, copy and paste across texture sets, and **geometry masks** that + show a layer only on the mesh parts you pick (right-click a layer). - **Filters and content effects** on any layer or mask: **27 filters** (HSL, levels, contrast/luminosity, color balance, gradient map, posterize, clamp, invert, threshold, grayscale, edge detect, normal invert, baked lighting, blur, directional and slope blur, sharpen, high pass,