Commit Graph
50 Commits
Author SHA1 Message Date
BFlat b1806e4010 Merge pull request #231 from vangel76/fix/217-generator-offset
Add an offset slider to mesh-map generators
2026-11-12 08:52:04 +07:00
chasse20 77a03ddcb3 Merge main and fix decal placement and input handling 2026-11-10 18:29:43 -05:00
Chris Hassebrook d664dc239c Revert "Show a whole material at once: coarse first look, then the exact result" 2026-11-10 16:08:27 -05:00
Chris Hassebrook 783cbdcb27 Merge pull request #381 from SteamSmith/perf/material-loading
Show a whole material at once: coarse first look, then the exact result
2026-11-10 16:07:09 -05:00
FredApps 26ddc8c256 Merge main and keep nested thumbnail controls accessible 2026-11-10 20:10:52 +01:00
SteamSmithandClaude Sonnet 5.5 208c645d0c Show a whole material at once: coarse first look, then the exact result
Applying a material filled the model in tile by tile, and each apply made the
next one slower. Now:
- a big recomposite first draws a coarse look of every tile (sampled texels
  repeated across blocks), then refines to the exact result;
- layers hidden behind an opaque layer are skipped (not when anchors or height
  masks are involved);
- compositing and upload budgets adapt: larger when idle, smaller while the
  user is interacting, and uploads reserve time for conversion;
- no coarse pass during a live stroke or with neighbourhood filters;
- blending at full weight returns the blended value exactly.

Tests: coarse-then-exact, hidden-layer culling gives identical pixels, coarse
pass covers every tile, no coarse pass while a stroke is live.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 06:40:11 -05:00
chasse20 2d0b8e6a48 Fix thumbnail previews and cache retention 2026-11-10 06:37:12 -05:00
chasse20 368731f7a4 Fix Clippy checks and clean up affected functions 2026-11-10 05:33:20 -05:00
MistyMystery 424ab64ce8 Merge upstream main into layers-panel-redesign 2026-11-09 23:54:51 +04:00
vangel76andClaude Opus 5.5 df86375a16 Merge upstream/main into fix/clippy-chunks-exact-to-as-chunks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:18:59 +01:00
vangel76andClaude Opus 5.5 07e94e1c86 Merge upstream/main into fix/217-generator-offset
Keep the curvature mode and detail sizes from upstream and route the
finished generator value through Generator::shape so the offset applies
to every generator kind. A non-finite offset now counts as 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 09:18:34 +01:00
Chris Hassebrook e8145421c3 Fix curvature detail handling and merge main 2026-11-08 07:31:13 +00:00
vangel76andClaude Opus 5.5 6c3e2f9625 Merge upstream/main into fix/217-generator-offset
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 08:17:31 +01:00
Rebornim cbe3c86acb Curvature detail: full-strength block borders, neutral raw curvature, stricter sizes
Divide each blurred detail size by the share of the blur window inside its
UV tile block, so texels near a block or map edge keep their strength
instead of fading toward zero. Raw mode reads mid gray when there is no
curvature to sample. The size cache keeps one layout per curvature map.
Mask previews of hidden layers build their sizes once before the tiles run
in parallel. effect.set rejects a sizes array with a non-numeric entry.
2026-11-08 01:38:20 +00:00
vangel76 d8ecfb7d42 Merge upstream/main into fix/clippy-chunks-exact-to-as-chunks 2026-11-08 02:27:35 +01:00
Rebornim 508c4bb2aa Keep the click that dismisses the image drop menu from painting
The views don't paint while a dropped image waits for its menu pick, so a click
on the mesh outside the menu only closes it. Also document Texel::source and
DecalDrop::menu_id.
2026-11-08 00:11:02 +00:00
Rebornim 1a0fc5fec8 Curvature detail: build only the sizes in use, map coverage on all cores 2026-11-08 00:10:40 +00:00
Rebornim 906dcf324e Curvature detail: name the tuned weights, clean up the effect plans and blur 2026-11-08 00:10:40 +00:00
Rebornim a1d010ccb2 Curvature generators: mode and detail sizes
Curvature and edge wear generators read the baked curvature map one
texel at a time, so they only marked the sharpest edges. They now take a
mode (edges, cavities, both, raw) and seven detail size weights: the map
itself and the map blurred at 1 to 32 texels at 2K, padded past the UV
islands and built once per map and layout. Each size's edges and
cavities combine like a screen blend.

New curvature and edge wear generators use detail sizes. Generators saved
without them, and smart masks, read the map exactly as before.
2026-11-08 00:10:40 +00:00
Rebornim c827d1b910 Drop a shelf image on the texture set under the cursor, as a channel or a mask
An image dragged over the 3D view highlights the texture set under the
cursor, as materials do. A drop opens a menu at the drop point: Mask, then
that set's channels. A pick selects the set and places the decal there
with the image in the picked channel, or as the gray mask of a new fill
layer. A click elsewhere places nothing; the background opens no menu.

layer.add.decal takes channel (a channel id, default baseColor, or
"mask") and adds the decal to the set under the point, selecting it, as
one undo step. layer.decal.set takes effect to edit a mask decal, so the
view's frame and handles work on it too, and a new image stays in the
channel the decal was placed in. One-value channels and masks read an
image's gray instead of its red.
2026-11-08 00:10:09 +00:00
Chris Hassebrook 30414caa6b Merge pull request #298 from Rebornim/feat/mask-filter-chain
Masks and content stacks run every neighbourhood filter
2026-11-06 10:40:45 -05:00
RebornimandClaude Opus 5.5 f6b2010109 Run every neighbourhood filter of a mask or content stack
Only the last neighbourhood filter of a stack ran; any below it was
skipped silently, so Blur then Warp gave the same result as Warp alone.
field() now runs each one in turn, continuing from the previous field,
over a region widened by what the filters above it read. Stacks with a
single neighbourhood filter are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 06:46:26 +00:00
chasse20 747068dbdf Fix bake settings and UV tile controls 2026-11-05 22:39:42 -05:00
chasse20 476d5ecc8b Guard preview inputs and optimize sparse mask reads 2026-11-05 18:54:07 -05:00
RebornimandClaude Opus 5.5 adcc43b077 Smart mask previews that show the mask
Shelf thumbnails now show each smart mask applied with mask.smart.apply to a
baked preview shape (geom::primitives::preview_orb) and read back from the
compositor (compose::mask_at, a sparse read sharing mask_image's per-tile
code), shaded flat white over a softly lit near-black surface. The shape bakes
once on a worker; preview::smart_mask's world-noise approximation is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 20:44:48 +00:00
MistyMystery 11d889dbf5 Redesign the Layers panel rows with live thumbnails
Layer rows are 48 points tall with alternating shades, hover, an accent edge on the selected
row and a divider under each layer. Each row shows its content thumbnail (the layer's own result
in the displayed channel) and its mask thumbnail, each selectable on its own; a subtitle names
the layer type and effect count; blend mode and opacity stack on the right. Effects hang under
their layer on tree lines in "Content effects" and "Mask effects" groups that fold without
touching the document, each with a thumbnail of the stack up to and including it (a hidden
effect shows what it bypasses, struck through). Folder contents indent with lines.

Paint and fill thumbnails show their own coverage over a checkerboard; folders composite their
children. Every size derives from layer_panel::layer_preview_size, so a preview size setting
plugs in there. New strings are translated in every shipped language.
2026-11-05 06:53:21 +04:00
MistyMystery d4ea67703d Add an asynchronous thumbnail service for layer contents, masks and effect stages
The compositor renders a one-layer cut of the stack at 64 px (content in a channel, mask, or
the stack up to an effect); the engine keeps an immutable snapshot, a worker thread, an LRU
cache and stale-result rejection.
2026-11-05 06:53:21 +04:00
vangel76andClaude Sonnet 5.5 81281c1a0a Merge upstream/main into fix/clippy-chunks-exact-to-as-chunks
Upstream removed bake/maps.rs, engine/tests/auto_rebake.rs and read_skew
(moved elsewhere); take the deletions. Convert two new chunks_exact uses in
bake/test/setting.rs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 00:06:23 +01:00
chasse20 18a3c98176 Implement clean-room bake settings and improve map accuracy 2026-11-04 03:57:46 -05:00
vangel76andClaude Sonnet 5.5 715baf4760 Use as_chunks where the chunk size is a constant
Clippy 1.99 flags chunks_exact and chunks_exact_mut with a constant
chunk size (chunks_exact_to_as_chunks). Switch those call sites to
as_chunks / as_chunks_mut. Behaviour is unchanged: the trailing partial
chunk was already dropped.

Fixes #233

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 01:36:12 +01:00
vangel76andClaude Sonnet 5.5 e59bf5569e Add an offset to mesh-map generators
The generator panel had level, softness and noise but no way to lift or lower the finished mask. The new offset is added to the result and clamped to 0..1. The thresholding now lives in Generator::shape, shared by the compositor and the preview.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 23:36:50 +01:00
bflatastic 6dabe66324 Filter radii and height slopes follow each UV tile's own resolution
A UV tile with a lower resolution than its atlas block fills the block's
corner, so it has fewer texels per UV unit. Neighbourhood filters (blur,
sharpen, warps, bevel, glow, ...) and height-to-normal slopes used the block's
texel density for every tile, so such a tile blurred twice as wide and showed
twice as steep slopes in UV space.

TextureSet::block_scales gives each block's share; the compositor filters each
block at its tile's radius, texture export and the CPU path tracer scale the
slope by it, and the display packs it into the Extra texture's alpha for the
viewport and GPU path tracer shaders (parallax too).
2026-11-02 21:08:35 +07:00
bflatastic fe02cd266d Fill normal images can be marked DirectX: their green flips where a normal channel samples them 2026-11-02 17:52:31 +07:00
Justin JohnandClaude Opus 5.5 07b5aaa0c1 Make paths non-destructive with path sublayers (#113)
Committed paths are stored in a new path sublayer (EffectKind::Path) on the
layer content or mask and the sublayer is repainted from its paths whenever one
is added, edited or removed. path.edit loads a path (with its brush and
material) into the Path tool; changes repaint live as one merged undo step.
path.remove deletes one. Manual strokes are refused on path sublayers, so they
can't be painted over by accident. The sublayer properties list its paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 10:30:59 +05:30
bflatastic 332cfa4070 Levels histogram: bound the neighbourhood work under a filter
A neighbourhood field covers the bounding box of its tiles, and a
scattered sample spans the whole set, so on an 8K set a blur below the
levels effect evaluated everything. With such a filter below, each
sampled tile now builds its own field.
2026-11-02 10:00:24 +07:00
bflatastic 83b8a13131 Levels histogram: sample every column, and read masks of empty layers
An odd tile stride: a power of two divides the row length on
power-of-two sets and read the same few columns. A mask is planned on
its own, so a paint layer with nothing painted still shows its mask's
histogram.
2026-11-02 09:44:28 +07:00
bflatastic d736ffa9af Levels: a histogram of what the effect reads
The Levels effect's properties now show a histogram of its input, the
mask below it or (on layer content) a channel picked above it, with the
input range marked. effect.histogram {effect, channel?, bins?} gives
agents the same counts. Large sets are sampled (at most 256 tiles), so
the cost stays flat up to 8K.
2026-11-02 09:23:59 +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 056a089551 Viewport: show the baked normal map
The viewport's normal texture held only the painted Normal channel, so
a baked normal map changed the export but not the view. Display tiles
now re-orient the painted normal onto the baked one, as export does
(core::blend::rnm, now public).

Fixes #54.
2026-11-02 06:11:11 +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 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 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
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 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 6bf3cb83d4 Format the workspace (cargo fmt)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 11:28:37 +07:00
bflatasticandClaude Opus 5.5 55387bf0fd GPU baking, Alembic, templates, translations and 8K responsiveness
- Baking: per-map ray settings (AO, thickness, bent normals), GPU ray-traced baking with CPU
  fallback (~12x), color map from textured glTF high polys
- Files: Alembic (Ogawa) and FBX 6 import, per-tile UDIM resolution, converting a set to UV
  tiles, project templates, preserving painted strokes on mesh reimport
- UI: translations (French, German, Spanish, Portuguese, Italian, Japanese, Chinese, Korean)
  with a live language picker and CJK fonts, closed panels reopen where they were, viewport
  texture resolution setting, frame-budgeted scene sync for 8K sets
- Web: loading screen, WebGL2 notice, app-captured shortcuts, touch navigation

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 11:23:28 +07:00
bflatasticandClaude Opus 5.5 81d3f5c14c GPU path tracing, depth of field, cameras, glass, filters and decals
- Rendering mode traces on the GPU (compute shaders, ~25x the CPU tracer) with CPU fallback;
  CLI/MCP render --samples uses the GPU unless --cpu
- Depth of field in the viewport and the path tracer; multiple cameras with glTF import;
  transmission/IOR, coat normal and screen-space subsurface blur; exact 8-bit normal decode
- Filter library (18 filters incl. warp, color balance, gradient map, posterize, MatFinish)
  with a Filters shelf tab; geometry decals; clone from the current layer; anchors inside a
  content stack; instances across texture-set resolutions; drag saved smart materials

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 09:06:22 +07:00
bflatasticandClaude Opus 5.5 bdbb52c9b6 UDIM tiles, USD import/export, coat/sheen/anisotropy/subsurface shading
- UV tiles: auto-detected UDIM texture sets as one atlas per set, padding kept inside tiles,
  one file per tile with the $udim export token, builtin:udim_plane
- USD: usda/usdc/usdz import (Crate reader with LZ4) and export with UsdPreviewSurface
- Shader lobes: clear coat, sheen, anisotropy and subsurface scattering channels in the
  viewport and the path tracer; car paint, velvet, brushed steel, skin and wax materials;
  glTF clearcoat/sheen export
- Color swatch popups no longer stay open

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 19:45:14 +07:00
bflatasticandClaude Opus 5.5 2e74013c3e Painting performance, alpha library, export template editor
- Compositor caches the stack below and replays what lies above the layer being painted,
  also inside folders: painting under a smart material is ~10-25x faster per frame and the
  stroke commit 12-30x faster, bit-identical to a full composite
- Paint shows in the frame it is drawn; parallel stamp rasterizing and stroke commit;
  camera visibility reused between strokes
- 67 procedural brush alphas with an Alphas shelf tab; drag materials, smart masks and
  alphas from the shelf onto the layer stack, layers and viewport
- Export output template editor: user presets with per-channel packing, converted maps,
  import/export as JSON, validated at load
- Shift+right drag turns the environment; S+drag no longer orbits while moving the stencil
- Frame profiler and scripted paint test on the control channel (debug.frames, debug.paintTest)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 15:15:26 +07:00
bflatasticandClaude Opus 5.5 ec859420d5 TextureCraft: clean-room 3D texture painting in pure Rust
An open-source, clean-room implementation of a Substance 3D Painter-style texturing
workflow, written in pure Rust with egui and wgpu.

- Layer stack with 32 blend modes, masks, generators, content effects and anchor points
- Painting, projection, smudge, clone, path, lasso fill, particle brush and quick mask
- 43 procedural materials, 17 smart materials and 10 smart masks
- Mesh map baking with high-poly, cage and match-by-name support
- PBR viewport with HDR environments, TAA and a path-traced Rendering mode
- glTF, FBX, COLLADA, OBJ, PLY and STL import; texture export presets; OBJ and GLB export
- Dockable Painter-style UI, shortcut editor, web build, MCP server and CLI

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 01:33:13 +07:00