Commit Graph
96 Commits
Author SHA1 Message Date
bflatastic 4f8a2f0828 Docs: roadmap after the issue fixes 2026-11-02 08:28:30 +07:00
bflatastic be1e095157 Merge main into fix/ask-to-save-before-replacing
# Conflicts:
#	crates/ui-egui/src/i18n/ar.rs
#	crates/ui-egui/src/i18n/de.rs
#	crates/ui-egui/src/i18n/es.rs
#	crates/ui-egui/src/i18n/fr.rs
#	crates/ui-egui/src/i18n/it.rs
#	crates/ui-egui/src/i18n/ja.rs
#	crates/ui-egui/src/i18n/ko.rs
#	crates/ui-egui/src/i18n/pt_br.rs
#	crates/ui-egui/src/i18n/zh_hans.rs
2026-11-02 08:26:03 +07:00
bflatastic f48d5b6ba4 Ask to save before opening, starting or closing another project
New project, Open, a recent project, a dropped file, Open sample
project and Close replaced a project with unsaved changes without a
word. They now wait on the same Save / Don't save / Cancel dialog as
quitting, and go ahead once the changes are saved or let go.
2026-11-02 08:24:29 +07:00
bflatastic ad8c650c09 Merge main into fix/fabric-materials
# Conflicts:
#	crates/ui-egui/src/i18n/ar.rs
#	crates/ui-egui/src/i18n/de.rs
#	crates/ui-egui/src/i18n/es.rs
#	crates/ui-egui/src/i18n/fr.rs
#	crates/ui-egui/src/i18n/it.rs
#	crates/ui-egui/src/i18n/ja.rs
#	crates/ui-egui/src/i18n/ko.rs
#	crates/ui-egui/src/i18n/pt_br.rs
#	crates/ui-egui/src/i18n/zh_hans.rs
2026-11-02 08:01:39 +07:00
bflatastic 3fea0f6c62 Materials: twill for denim and carbon fiber, a pile for velvet
Carbon Fiber, Fabric Cotton, Denim and Velvet were all the same plain
weave in different colours. A new Twill weave pattern (2/2: diagonal
ribs, the weft darker than the warp) now gives Denim its diagonal and
Carbon Fiber its light and dark tows under a clear coat; Velvet is a
soft pile with no weave under its sheen; Fabric Cotton keeps the plain
weave. Twill weave is also a fill pattern, translated into all nine
other UI languages.

Fixes #97.
2026-11-02 07:53:46 +07:00
bflatastic 85c749bb1b Ask to save unsaved changes when the app closes
Closing the window (or File > Quit) with unsaved changes now keeps the
app open and asks: Save, Don't save or Cancel. A cancelled or failed
save keeps the app and the dialog open. Strings translated into all
nine other UI languages.

Fixes #100.
2026-11-02 07:41:01 +07:00
bflatastic 2d8c34c055 Features: the texture set visibility controls 2026-11-02 07:07:45 +07:00
bflatastic 7e78a2cba6 Material channels: Alt+click keeps one channel
Alt+click on a channel of a fill's or the brush's Material section turns
that channel on and every other one off (one undo step for a fill).
tool.material and layer.fill.set take solo: true for the same.

Fixes #74.
2026-11-02 06:37:04 +07:00
bflatastic e03a9d6c71 Merge remote-tracking branch 'origin/main' into assets/brush-presets
# Conflicts:
#	ROADMAP.md
#	crates/engine/tests/session.rs
#	crates/paint/src/lib.rs
#	crates/ui-egui/src/i18n/ar.rs
#	crates/ui-egui/src/i18n/de.rs
#	crates/ui-egui/src/i18n/es.rs
#	crates/ui-egui/src/i18n/fr.rs
#	crates/ui-egui/src/i18n/it.rs
#	crates/ui-egui/src/i18n/ja.rs
#	crates/ui-egui/src/i18n/ko.rs
#	crates/ui-egui/src/i18n/pt_br.rs
#	crates/ui-egui/src/i18n/zh_hans.rs
2026-11-02 04:48:21 +07:00
bflatastic f4baf8140a Merge remote-tracking branch 'origin/main' into ui/start-window
# Conflicts:
#	crates/ui-egui/src/i18n/ar.rs
#	crates/ui-egui/src/i18n/de.rs
#	crates/ui-egui/src/i18n/es.rs
#	crates/ui-egui/src/i18n/fr.rs
#	crates/ui-egui/src/i18n/it.rs
#	crates/ui-egui/src/i18n/ja.rs
#	crates/ui-egui/src/i18n/ko.rs
#	crates/ui-egui/src/i18n/pt_br.rs
#	crates/ui-egui/src/i18n/zh_hans.rs
2026-11-02 04:29:43 +07:00
bflatastic 1d885c8df1 Brushes: 18 brush presets in the shelf, and your own
The Assets shelf has a Brushes tab: presets grouped as Basic (hard, soft,
airbrush, square, dots), Wear and grunge (dry brush, chalk, spray, grunge,
splatter, scratches, chips, cracks, drips) and Details (stars, stitches,
rivets, fur), each with a preview of its stroke. A click sets the stroke (alpha,
spacing, flow, hardness, angle, path following, jitters, particles) and keeps
the brush's size, alignment, culling, symmetry and lazy mouse. My brushes saves
the current brush as a .tcbrush file in the brushes folder and lists them.

Commands: brush.preset.list, brush.preset.apply {preset}, brush.preset.save
{path} and brush.preset.load {path} (an image alpha from another project is
dropped). Labels translated into the other nine UI languages.
2026-11-02 04:28:17 +07:00
bflatastic 96b179ccfc Start window: new, open or a recent project at launch
The app opens on the sample project, which left no obvious place to pick a
project. A start window now offers New project, Open, the recent projects and
Continue with the sample project, with Show at startup (also Settings >
Interface > Start window). It opens at launch in the desktop and web apps, but
not when a file is given on the command line or the app runs with --control.

Labels translated into the other nine UI languages; a UI test covers New
project, Continue and the startup setting.
2026-11-02 04:15:55 +07:00
bflatastic 0c9627573e Merge remote-tracking branch 'origin/main' into tools/text-alpha 2026-11-02 04:07:38 +07:00
bflatastic 7fdd9be0a3 Text: draw text in any installed font as a brush alpha or a decal
resource.text draws one or more lines of text, shaped with harfrust (kerning,
ligatures, joined scripts) from the font's outlines (skrifa) and filled by a
non-zero scanline rasterizer, cropped to the ink, as an image resource: white
for the brush alpha, or a color for a decal. text.fonts lists the installed
families and styles, read from each font file's name table only (246 families in
80 ms here); Ubuntu Light and Hack from the UI's built-in fonts are always there
and are the fallback in the browser.

- Properties > Alpha > Text: the text, a font and style, Use as brush alpha and
  Place as decal (in the tool's base color).
- Image alphas keep their proportions (their longer side spans the stamp), so a
  line of text stays a line; image thumbnails are letterboxed and show alpha.
- harfrust 0.12 and skrifa 0.44 are the versions egui already builds, so the
  lockfile gains no packages.

Fixes #40
2026-11-02 04:07:37 +07:00
BFlat 0788317deb Merge pull request #47 from test-bit-sys/feat/arabic-localization
Add complete Arabic (ar) UI localization
2026-11-02 04:03:28 +07:00
bflatastic eb812f90d4 Arabic: UI font fallback, and the docs
Arabic text needs a font with Arabic glyphs; egui already shapes it and orders
right-to-left runs. The script joins the CJK ones in the lazy fallback fonts:
Noto Sans Arabic from craft-fonts (desktop and web, 0.8 MB), else Segoe UI,
Tahoma or Arial on Windows, SF Arabic or Geeza Pro on macOS, and Noto Sans
Arabic or DejaVu Sans on Linux and FreeBSD. Without any, the picker lists Arabic
by its English name, as for CJK.

ATTRIBUTION, the localization table (panels keep the left-to-right layout),
features, README and roadmap count ten languages.
2026-11-02 03:28:59 +07:00
bflatastic bd128ab181 Wireframes show the mesh's polygons, not their triangles
Importers fan-triangulate quads and n-gons, and the 3D and UV wireframes drew
every triangle edge, so a quad mesh showed its triangulation. Meshes now carry a
per-triangle mask of the diagonals the importer added (Mesh::diagonals), and the
wireframe leaves them out (Mesh::wire_edges), unless a UV seam split one from its
twin.

- OBJ reads polygons whole (tobj without triangulation) and fans them itself.
- OBJ, PLY and the polygon sink (FBX, COLLADA, USD, Alembic) share one fan,
  RawMesh::polygon, which records the diagonals.
- The built-in meshes mark their grid quads.
- glTF and STL store triangles only, so they keep every edge.

Fixes #41
2026-11-02 03:20:57 +07:00
bflatastic bdac5a22d2 Custom title bar: app icon, menus and window buttons in one strip
The top menu strip is now the window's title bar wherever the app draws the
frame (crates/ui-egui/src/titlebar.rs), using craft-window for the decision
and for the draggable empty area:

- Windows: no OS frame. App icon at the very left, the menus, empty space
  that moves the window (double-click maximizes), the mode label, then
  minimize, maximize/restore and close (46 pt wide, crisp pixel-snapped
  glyphs, close turns red on hover, dimmed while inactive). Invisible edge
  and corner zones resize the window. A per-frame guard ported from
  VectorCraft keeps the undecorated window borderless and a maximized one
  clear of the taskbar (winsafe, no unsafe), and the taskbar gets the big
  app icon.
- macOS: the traffic lights over the strip (full-size content view, hidden
  title), centred on it with eframe's traffic-light API, the app icon after
  their inset, and AppKit's movable flag synced by craft-window.
- Linux and the BSDs: craft-window's probe decides; where the compositor
  leaves the frame to the app (GNOME) the strip draws the buttons in the
  desktop's button layout.
- Wherever the system draws the frame (and on the web) the strip stays the
  menu bar, with the app icon at its left. No line under the strip.

TEXTURECRAFT_TITLEBAR=app|system overrides the decision. Settings ›
Interface › System title bar (applies on restart) brings the OS frame back;
it is read from the saved settings before the window opens and is settable
over the control channel as prefs.system_title_bar. ui.inspect reports
titleBar. New strings are translated in every language, and the offscreen
snapshots render the app-drawn and macOS variants.
2026-11-01 19:46:06 +07:00
BFlat 155fa7343b Merge pull request #28 from storytold/filters/replace-color-filter
Replace Color filter
2026-11-01 17:37:28 +07:00
bflatastic 56a3a655ee Replace Color filter
Colors near a chosen color shift towards a new one, keeping their shading and texture.
27 -> 28 library filters.

- Filter::ReplaceColor {from, to, tolerance, softness}: each color within the tolerance (RGB
  distance 0..1) moves by to - from, fading out over the softness (smoothstep); far colors and
  scalar channels are untouched; content only (Adjustments)
- effect.add.filter / effect.set take from and to as linear RGB or "#rrggbb"; Properties has a
  swatch per color and the two sliders; translations in all eight UI languages
- tests: near, far and halfway colors, scalars; the engine filter library test adds it
2026-11-01 16:57:50 +07:00
bflatastic 12fa192373 Six more materials: Rust, Slate, Sandstone, Terrazzo, Cork, Paper
48 -> 54 procedural materials on the shelf and through material.apply:
- Rust (Metal): pitted, blotchy orange-brown iron oxide, a rough dielectric
- Slate, Sandstone, Terrazzo (Stone & Masonry): layered dark stone, fine warm grains, pale
  binder with polished stone chips
- Cork and Paper (Organic): granular pored cork, off-white paper with a faint tooth
The existing test applies every material on the sample and checks it changes the composite;
each was also checked on the material ball.
2026-11-01 16:47:49 +07:00
bflatastic c8e26549b0 Geometry mask tool: click mesh parts
A Geometry mask tool (key 8) shows or hides the selected layer on the mesh part under a click,
so geometry masks can be set on the model instead of from the part list.

- Tool::GeometryMask; tool.geometryMask selects it and tool.click toggles the part under the
  point ({layer, part, shown, geometryMask}); showing every part again clears the mask; one
  undo step per click; refused on empty space, without a selected layer, or on a part of
  another texture set
- the tool shelf, the tool bar hint and Properties (the layer's parts, shown or hidden, and Show
  on all parts); the hint is translated in all eight UI languages
- test: clicks on a two-object OBJ hide, show and clear, undo, and a click on empty space
2026-11-01 15:53:49 +07:00
bflatastic afdea4a6dd Radial symmetry for brushes
Strokes can repeat around an axis through the mesh center, 2 to 32 copies, on their own or with
the X/Y/Z mirrors (each mirror is spread too).

- Symmetry gains radial (copies) and axis (X/Y/Z, default Y), serde defaults; sanitized clamps
- symmetry copies are marked and paint where symmetry puts them: the camera visibility and
  back-face tests apply to the stroke itself only, so copies on the far side of the model paint
  (mirror Z included); they still only paint surfaces facing the copy
- tool.brush {symmetryRadial, symmetryAxis}, shown in its result as radialSymmetry; Properties >
  Lazy mouse and symmetry: Radial copies slider and axis; translations in all eight languages
- tests: copies a quarter turn apart, with mirrors, clamping; an engine stroke paints the back of
  a sphere through radial symmetry
2026-11-01 15:04:23 +07:00
BFlat 27a695648d Merge pull request #22 from storytold/docs/roadmap-2026-11
Docs: roadmap and status after the November features
2026-11-01 15:03:36 +07:00
BFlat ff0b439912 Merge pull request #21 from storytold/export/more-presets
Export presets: Godot 4 (ORM) and OpenPBR
2026-11-01 14:45:20 +07:00
bflatastic 5fe56c8000 Docs: rewrap the shading and displacement paragraphs 2026-11-01 14:36:04 +07:00
bflatastic 052c8b2cff Docs: roadmap and status after the November features
- ROADMAP: parity estimate re-scored on 2026-11-01 (about 93%): layer stack (27 filters,
  geometry masks), materials and assets (21 smart materials, 18 smart masks), baking (FBX
  texture files), viewport (cameras from FBX, COLLADA and USD; displacement in shadows and the
  path tracers), shader, export (Godot 4 and OpenPBR presets, clear coat in USD); remaining gaps
  and current focus updated
- README: status date and estimate
- architecture: geometry masks in compositing, displacement in rendering and the path tracers
- features: filter list wrapped
2026-11-01 14:35:18 +07:00
BFlat 61ed084c2e Merge pull request #20 from storytold/assets/more-smart-masks
Eight smart masks and four smart materials
2026-11-01 14:34:36 +07:00
bflatastic faf3a1acab Export presets: Godot 4 (ORM) and OpenPBR
- Godot 4 (ORM): albedo (A = opacity), orm (R AO, G roughness, B metal), normal (OpenGL),
  emission, as StandardMaterial3D reads them
- OpenPBR (separate maps): one map per OpenPBR Surface input the set has, including the coat,
  fuzz (sheen), anisotropy, transmission and subsurface lobes, geometry normal (OpenGL) and a
  16-bit height; maps of channels a set lacks are skipped
- test: OpenPBR writes the lobe maps of a set that has them and skips them otherwise
2026-11-01 14:27:05 +07:00
BFlat f41a3126dd Merge pull request #19 from storytold/layers/geometry-mask
Geometry masks: layers on chosen mesh parts
2026-11-01 14:27:00 +07:00
bflatastic 2a3c31f321 Four more smart materials
17 -> 21 smart materials on the new smart masks: Stone Mossy (granite, dust in cavities, moss
from the top), Paint Sun Faded (faded where it faces the sky, sharp chipped edges), Steel Water
Stained (water stains) and Plastic Grimy (soft worn edges, grime in cavities). The existing test
applies every material on the sample and checks it changes the composite.
2026-11-01 14:04:33 +07:00
bflatastic 4df018753e Eight more smart masks
10 -> 18 procedural smart masks on the shelf and through mask.smart.apply: Edges Soft, Edges
Sharp, Exposed Areas, Thin Areas, Dust in Cavities, Moss from Top, Water Stains and Sun Faded,
built from the mesh-map generators and triplanar patterns like the others (any resolution).
The existing test applies each on the baked sample and checks it is not empty.
2026-11-01 14:04:33 +07:00
bflatastic e56022230b 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)
2026-11-01 14:00:16 +07:00
bflatastic e2637115df Displacement in the viewport's key-light shadows
The shadow pass draws the dense copy and displaces it like the 3D view, so a displaced surface
shadows itself instead of being shadowed as if it were still smooth.

- shaders/displace.wgsl: displace_by_height, shared by mesh.wgsl and shadow.wgsl
- the shadow pipeline takes the set bind group (height and sampler) and a displacement vec4
  (on, world units per unit of height with the height strength, vertex spacing)
- while it displaces, the cached shadow map is re-rendered when the set textures change
- test: with flat height, displaced shadows match the plain mesh's
2026-11-01 13:35:53 +07:00
bflatastic 8b8655a6f3 Displacement in the path tracers
Rendering mode traces displaced geometry when the display has displacement on, so path-traced
renders show the viewport's silhouettes and the displaced surface shadows itself.

- render::displace: the viewport's dense subdivision of the mesh, each vertex moved along its
  normal by its set's height (box-filtered to the mip the vertex shader samples) times the
  height strength, at the viewport's scale (world length per UV / 16)
- trace_geometry gives the GPU and CPU tracers the displaced mesh and BVH; Rendering mode,
  texturecraft-cli render --samples and MCP viewport_render use it
- Rendering mode keeps the traced geometry until the mesh, a set's content or a height
  strength changes (display tweaks don't rebuild it)
- subdivide::vertices shared by the renderer's mesh upload and displacement
- test: a uniform height lifts the dense plane by height x strength x world per UV / 16
2026-11-01 13:35:53 +07:00
BFlat ce4621273e Merge pull request #16 from storytold/filters/baked-lighting
Baked Lighting filter
2026-11-01 13:35:48 +07:00
BFlat cd336f2bb3 Merge pull request #15 from storytold/formats/file-cameras
Cameras from FBX, COLLADA and USD files
2026-11-01 13:32:35 +07:00
bflatastic 5dd12041c8 Baked Lighting filter
Paints a light into the base color for hand-painted and mobile looks: base color x (ambient x
ambient occlusion + light x max(n.l, 0)) on the mesh normals, with the light set by azimuth and
elevation. 26 -> 27 library filters.

- Filter::BakedLighting {azimuth, elevation, light, ambient, occlusion} and baked_light()
- the compositor reads the texel's normal and the baked AO (none baked: no occlusion) and
  lights the base color only; content only (Adjustments)
- effect.add.filter / effect.set / filter.list; property sliders; translations in all eight UI
  languages
- tests: lit from the normal side the color stays, from behind only ambient remains, roughness
  untouched; occlusion weighting
2026-11-01 13:15:47 +07:00
BFlat 4d86852950 Merge pull request #13 from storytold/filters/bevel-mosaic-glow
More filters: Bevel, Glow, Mosaic
2026-11-01 13:15:42 +07:00
bflatastic 4ddf6bb007 Cameras from FBX, COLLADA and USD files
Cameras in FBX, COLLADA and USD files join the project's camera list, as glTF cameras do.

- FBX 6/7: Camera Models (looking down +X) with the lens from their Camera NodeAttribute or
  the Model's own properties (focal length over film height, else FieldOfViewY /
  FieldOfView; CameraProjectionType 1 = orthographic); FBX 6 Producer views skipped
- COLLADA: instance_camera in scene nodes (perspective yfov or xfov + aspect_ratio,
  orthographic ymag or xmag + aspect_ratio); node transforms understand lookat
- USD: Camera prims (focalLength over verticalAperture with USD's fallbacks, orthographic
  projection), through xform ops and the hierarchy
- RawCamera::placed and lens_fov shared by every reader (glTF too); an orthographic view
  height follows its node's scale; at most 64 cameras per file
- tests: a camera in the FBX 7 binary/ASCII scene, a Producer view in the FBX 6 file, a
  lookat camera in the COLLADA scene, a perspective and an orthographic camera in the USD scene
2026-11-01 12:40:50 +07:00
BFlat 89555d9efb Merge pull request #10 from storytold/export/usd-clearcoat
Clear coat in USD export
2026-11-01 12:40:32 +07:00
bflatastic 4bcf04ff25 More filters: Bevel, Glow, Mosaic
The filter library grows from 23 to 26 filters for layer content and masks.

- Bevel (Blur and sharpen): values ramp from 0 at a shape's edge up to their own level over
  the width, from the coverage-weighted box blur; never raises a value
- Glow (Blur and sharpen): adds the blur of the values times the amount
- Mosaic (Distort): square cells, each the value at its center, sampled at absolute texel
  positions so cells line up across tiles
- effect.add.filter / effect.set / filter.list cover them; shelf thumbnails, property sliders
  and translations in all eight UI languages
- tests: compositor behaviour of each, the engine filter library test adds and composites them
2026-11-01 12:26:02 +07:00
bflatastic b5a659e6b8 Clear coat in USD export
The UsdPreviewSurface of each exported material gets clearcoat and clearcoatRoughness from two
more UsdUVTexture maps (Clearcoat, ClearcoatRoughness; raw), rendered from the Coat weight and
Coat roughness channels, as the GLB export already carries them.

- a set without coat channels produces no coat maps; a black coat drops both maps, like a
  black emissive map
- usda, usdc and usdz; File > Export mesh, file.exportMesh and the MCP mesh_export tool
- tests: the USD round trip exports a coated and an uncoated (black) material in all three
  encodings
2026-11-01 11:40:02 +07:00
bflatastic 1679cd4dd5 More filters: High Pass, Edge Detect, Warp Directional, Grayscale, Normal Invert
The filter library grows from 18 to 23 filters for layer content and masks.

- High Pass (Blur and sharpen): the detail finer than the radius around mid gray (0 for
  signed channels), sharing the box-blur path, premultiplied by coverage
- Edge Detect (Adjustments): gradient magnitude from coverage-weighted central differences;
  a side outside the UV island reads the texel itself, so seams are not edges
- Warp Directional (Distort): the warp's noise offset along one direction
- Grayscale and Normal Invert (Adjustments, content only): luminance for colors, flipped
  green for normal maps
- effect.add.filter / effect.set / filter.list cover them (CLI, control channel, MCP);
  shelf thumbnails, property sliders and translations in all eight UI languages
- tests: compositor behaviour of each new filter, the engine filter library test adds and
  composites them
2026-11-01 11:37:07 +07:00
bflatasticandClaude Opus 5.5 e1b0d22d50 Docs: roadmap, README status and release setup for v0.1.0
- ROADMAP: M4 baking done (high-poly textures beside a .gltf or USD layer); viewport gaps
  brought up to date (depth of field, subsurface blur and cameras landed; hardware ray tracing
  and FBX/COLLADA/USD cameras remain); hardware ray tracing waits on an owner decision (wgpu's
  ray queries need an unsafe opt-in); CI is green on main; the current focus is the v0.1.0
  release
- README status and docs/features.md: meshes with files beside them, the MCP mesh file tools
- docs/releasing.md: the release environment and ruleset now exist; secrets and the runner
  group are what's left

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 13:31:34 +07:00
bflatasticandClaude Opus 5.5 2ddb156d69 Neutral names in code and packaging; README in the Crafting Apps layout
- Code comments, crate descriptions, the MCP stroke schema and the Linux package descriptions
  describe features in their own words instead of naming the reference application or other
  vendors' products (file format names stay)
- The README follows the layout the other Crafting Apps use (VectorCraft): a look around, made
  in TextureCraft, why TextureCraft, quick start with the agent setup, status, downloads per
  platform, the Crafting Apps, star history, license; no trademark footer
- The detailed feature list moves to docs/features.md
- A new path-traced render of the built-in crate textured with smart materials

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 12:55:42 +07:00