Commit Graph
22 Commits
Author SHA1 Message Date
chasse20 6f8e984d7a Auto: Integrate main and reduce repeated procedural sampling work
Reuse two fur seed tables per worker, share knot noise, and skip invisible decay and brocade detail. Normalize each catalog lookup once while preserving label and saved-name aliases.

Consolidate periodic sampling helpers, move FurLock into its own module, and strengthen coverage of coarse-grid fallback and saved pattern names. Preserve main's project and Assets changes and document the expanded catalog.
2026-11-18 21:52:15 +00:00
Morion 77c39a8dd6 Read a pattern exactly when its coarse grid coordinate is not finite
plane_value blended four samples of a coarse grid, and a point so far out that the grid overflowed made the blend NaN although the pattern itself was finite there. It now reads the exact point in that case. The test checks every procedural at the extreme coordinates and fails without the fix (Cells at infinity gave NaN).
2026-11-18 11:50:53 -05:00
Morion 8e7bc663fd Fix knotty wood seam, replace coral maze with rotting flesh, test scale coverage
Knotty wood measured the ring a knot pulls towards from the copy of the unit the point was in, so a knot across the top or bottom edge left a horizontal mark when the unit repeated; it is now measured from the knot's own copy, and a test checks that no pattern is rougher across the edge of the unit than across its middle. Coral maze becomes Rotting flesh: folded wet tissue with branching veins and blistered patches of decay. The reptile scales test now asserts that a scale covers every point instead of reading a minimum brightness.
2026-11-18 11:31:25 -05:00
Morion 77eb6a2b85 Merge origin/main into feat/procedural-geometric-tilings 2026-11-18 10:53:50 -05:00
Morion 4993700189 Add organic, fabric, timber and camouflage procedurals
Thirteen seamless patterns: smooth fur, mackerel sky, soft billow, reptile scales, young bark, coral maze, camouflage, knit, basket weave, goose-eye twill, slub silk, strip flooring and knotty wood. Each repeats every unit and takes extreme and non-finite coordinates. Tests cover repetition, range, variation, the seed and the extremes, plus the specific structure of the scales, bark, maze, camouflage tones, weaves and boards.
2026-11-18 10:38:07 -05:00
chasse20 b85088526a Auto: Merge main and reconcile Tile Generator fill sources
Use the Tile Generator sampling context for gradient maps and retain pattern settings and gradient stops through fill edits. Keep the shared picker alongside the gradient, decal symmetry, and layer selection controls. Collect thumbnails after the dock and detached windows draw.

Update affected tests for the merged picker and cover image-backed and reduced-resolution gradients.
2026-11-18 07:25:28 +00:00
Morion 5907ad6a45 Merge origin/main into feat/procedural-geometric-tilings 2026-11-17 23:24:15 -05:00
chasse20 26490af2b9 Auto: Harden command and clone bounds and reduce mask allocations
Reject overflowing set indexes, saturate layer moves and clone offsets, and validate path corner flags before mutation. Clear discarded path caches and replace disabled-mask previews with a blank upload.

Reduce repeated selection allocations and temporary mask buffers. Preserve public reexports while separating types, and complete scoped comment and guard-spacing cleanup.

Validated paint and focused engine tests, workspace Clippy, production wasm checks, layering and formatting.
2026-11-18 04:14:11 +00:00
chasse20 f06c8acecf Auto: Integrate main and defer hidden picker previews
Create image and anchor previews only for visible picker tiles, advance
outside thumbnail frames so stale handles can expire, and reuse bilinear
corner samples. Add focused preview and lifetime regressions and complete
scoped comment, spacing, and slider-constant cleanup.

Preserve the prepared main integration. Validated with affected release
tests, workspace Clippy, layering, wasm, panic_hunt, formatting, and
offscreen UI snapshots.
2026-11-18 00:05:33 +00:00
vangel76 d9bdef92b2 TextureCraft UI parity batch: 45 changes in one commit
Combines 45 open pull requests so the Windows proof build runs once. Included:

- Fill layers can color from dark to light with a gradient map (PR #535, fixes #482)
- Front, side and top views, and F5/F6 switch between perspective and orthographic (PR #539, part of #241)
- Textures export as DDS, with compressed normal and grayscale maps for game engines (PR #543, fixes #354)
- The active layer and the eye in the Layers panel are much easier to see (PR #561, fixes #553)
- Export dialog can also write a MaterialX file for each texture set (PR #563, fixes #558)
- Layers toolbar stays on one row and cut-off layer names show on hover in small windows (PR #564, fixes #560)
- Save a layer's mask as an image file or copy it to the clipboard from the layer menu (PR #565, fixes #559)
- Shift + wheel and Ctrl + wheel change the brush size, and Ctrl+drag brush changes have a fine mode (PR #566, part of #545)
- Select several layers in the Layers panel with Shift+click, Ctrl+click and Ctrl+A (PR #567, fixes #247)
- Pressing F frames the object you are painting, so a floor plane no longer throws off the view (PR #568, fixes #478)
- Save a mask as your own smart mask and reuse it on other layers and projects (PR #569, fixes #562)
- Show one layer alone in the viewport, with or without its mask (PR #570, fixes #544)
- On-screen orbit, pan and zoom buttons let a pen tablet move the 3D and 2D views (PR #573, fixes #288)
- Decals can be mirrored to the opposite side of the mesh across X, Y or Z, with optional U or V flip (PR #576, fixes #272)
- Shift+click lines in the 3D view start at the spot you last painted, even after turning the view (PR #578, fixes #574)
- History steps now name the tool and layer and appear in the interface language (PR #580, fixes #572)
- Path tool keeps your points when you click in the other view and tells you why (PR #582, fixes #575)
- Brush, symmetry and tool settings stay when you open another project or restart the app (PR #584, fixes #571)
- Reset only the panel layout from the Window menu, and Reset UI now asks first (PR #586, fixes #577)
- Output templates ask before deleting and before dropping an unfinished edit (PR #588, fixes #579)
- Clone tool shows its source in the 2D view, forgets it when you switch texture set, and can restart at the source each stroke (PR #590, fixes #581)
- Move the symmetry plane to the model's middle or to a clicked point in one click (PR #591, fixes #585)
- Projection stencil can be dropped in from Assets, moved and reset with fields, turned in snapped steps, and the 2D view says projection works in 3D (PR #593, fixes #583)
- Smudge now shows which channels it drags and lets you switch them (PR #594, fixes #587)
- Save panel layouts under a name and switch between them from the Window menu (PR #595, fixes #589)
- Clone and Smudge now work on layer masks (PR #596, fixes #592)
- A layer image menu test no longer fails when another test switches the interface language (PR #597)
- Clicking a material in the shelf now paints with it instead of adding a layer (PR #599, fixes #305)
- Alt+click on a mask thumbnail now labels the mask view and blanks the other texture sets (PR #605, fixes #600)
- Painting on a texture set that is not active now shows a hint why nothing happens (PR #607, fixes #601)
- Ctrl+Shift+click draws straight lines that snap to 15 degree steps (PR #609, fixes #604)
- Output template channels can be inverted (PR #611, fixes #603)
- Smudge now follows the mirror and radial symmetry planes (PR #613, fixes #602)
- The shortcut list now shows the stencil, clone source, straight line and path gestures (PR #614, fixes #608)
- Symmetry now also mirrors strokes painted in the 2D view (PR #615, fixes #610)
- Decals keep their image's proportions while sizing and can be flipped (PR #617, fixes #606)
- Polygon fill now also fills the mirrored side when symmetry is on (PR #619, fixes #612)
- A decal dragged over a curved or differently facing surface now turns with it instead of tilting or flipping (PR #622, fixes #616)
- Every brush alpha now has size, roundness, contrast and invert settings (PR #623, part of #598)
- Decals placed as a mask can now be sized, turned and moved from Properties like decal layers (PR #624, fixes #618)
- Renaming effects and linking fills to mask anchor points are now tested in the interface (PR #626, fixes #621)
- Path points can be corners, so paths can have hard edges (PR #627, fixes #620)
- Layer menu can apply a layer's blending mode and opacity to all channels, and copy/paste channel blending (PR #631, fixes #629)
- Display Settings can now set glow, vignette, sharpen and film grain (PR #632, fixes #630)
- Every command a key can run can now get a keyboard shortcut (PR #633, fixes #628)

Fixes found while combining them: the named layouts window is drawn again, layer remove/duplicate/group/visibility stay bindable to keys, the Clone tool's Aligned switch is kept with the other tool settings, smudge copies in the 2D view keep their own trails, and a UI or control-channel camera command during a view glide is no longer undone by the glide.
2026-11-17 22:51:06 +01:00
Rebornim 7c28d4f5f5 Tile Generator image inputs
The Custom image input shape draws one of the pattern's input images in each tile, picked at random or by tile number, through the shape's tiling, angle, scale and turns; the background image shows under the shapes instead of the background value. Patterns read images through a PatternContext (its resolution and the image resources), which the compositor passes; procedural() keeps evaluating without images.
2026-11-17 16:27:37 +00:00
Rebornim 37edd3c44b Tile Generator pattern and pattern resolution
A Tile Generator pattern kind lays shapes out in a grid of tiles: 15 shapes and image inputs, tile counts, row or column offset, middle size, interstice, size modes, scale, free and quarter-turn rotation, mirroring, per-tile random scale, position, rotation and luminance, masks, Add/Max/Add sub blending, background, opacity and a position/contrast window. Its settings are a TileGenerator on Procedural (saved only for that kind).

Every pattern gets an output resolution like generators: below the UV tile's resolution it is read from an image of that size, bilinearly. Patterns saved before keep their form and render unchanged.
2026-11-17 16:26:06 +00:00
chasse20 c5f7f17380 Auto: Preserve HDR fills and adapt benchmarks to main
Integrate main and adapt the performance suite to current bake settings,
map selection and undo APIs.

Preserve full triplanar image weighting for floating-point resources and
add a regression for lost HDR contributions. Use hardware floor when
SSE4.1 is enabled, retaining the portable fallback.

Split Report and Row into their own files and complete scoped naming,
spacing and comment cleanup.

Validated with 132 release tests, workspace Clippy, wasm and layering
checks, formatting, and retained targeted noise and performance probes.
2026-11-17 07:57:09 +00:00
Morion a1fd0120c3 Geometric tilings: take extreme coordinates; halftone dots stay continuous
Review findings on #421:

- A huge but finite coordinate saturated a cell index to i32::MAX, and the
  next neighbour index overflowed, which panics in debug builds; an infinite
  one gave NaN. As the six tilings repeat every unit, each now first moves
  the point into the unit square, which also keeps far coordinates precise.
  Coordinates that are not finite become 0.
- Halftone dots picked a single center by rounding, so on the line halfway
  between two centers the dot jumped from one size to the other. Each texel
  now takes the dot that covers it most among the four nearest centers, and
  skips the tone of centers no dot could reach from there.

New tests feed extreme coordinates to every tiling and check that the
halftone has no jump where two dots meet; both fail without the change.
Halftone dots now take about 97 ns per texel in release.

Part of #409
2026-11-11 10:48:34 -05:00
Morion f7a7c11de4 Procedural patterns: halftone dots, diamond brocade and Truchet arcs
Three more geometric tilings:

- Halftone dots: dots on a grid turned 45 degrees, sized by a cloudy tone.
- Diamond brocade: raised diamonds of concentric rings on a twill ground.
- Truchet arcs: quarter-circle arcs that join into winding paths.

The halftone tone comes from a new value noise whose lattice indices wrap,
summed over octaves with a whole number of cells per unit, so the noise and
the dots repeat every unit. All six tilings are now in the seamless test.
Their labels are added to the nine translation tables. In release they take
38 to 85 ns per texel.

Part of #409
2026-11-11 09:44:11 -05:00
Morion 9378d2fe11 Procedural patterns: hexagon tiles, wave scales and herringbone planks
Fills and masks had few geometric tilings. Three new procedurals, generated
in code like the others:

- Hexagon tiles: hexagons with joints and a tone per tile.
- Wave scales: rows of overlapping fans of concentric arcs.
- Herringbone planks: planks three times as long as wide, with gaps, a tone
  and a grain per plank.

Each repeats every unit, tones included, so it tiles without seams; a test
checks that, and another one the joints between hexagons and planks. Their
labels are added to the nine translation tables. In release they take 43 to
62 ns per texel, like Bricks and Twill.

Part of #409
2026-11-11 09:17:14 -05:00
pavlos vasilantonakis 3a76d10b06 Triplanar keeps every plane when all three fall under the skip threshold
Above a sharpness of about 27, the three weights of a near-diagonal normal sum to less than
the 1e-6 floor of their normalization, so they no longer sum to 1: at sharpness 47 each is
about 6e-6, under the skip threshold, but together about 1.8e-5, more than a u16 step.
Skipping all three dropped that; now no plane is skipped when every one would be, which
gives the same weights as before plane skipping.
2026-11-03 14:29:08 +01:00
pavlos vasilantonakis 8389d53844 Noise lookups avoid libm floor, gradient branches and fn pointers
Profiling the sample project's composite put 89% of the time in procedural noise. Three
costs in it had nothing to do with the patterns themselves:
- `f32::floor` is a libm call on x86-64 without SSE4.1 (6% of the composite): the lattice cell
  now comes from truncation, with the plain definition kept for NaN, infinities and values
  already integral.
- Perlin picked its gradient with a 12-way `match` on a random hash, which mispredicts: it is
  now a dot product with a table of the 12 edge gradients.
- `fbm` took its base noise as a `fn` pointer, so it could not be inlined: it is generic now.

The noise stays bit for bit identical: a new test checks a checksum of every noise over points
across signs, lattice boundaries, −0 and huge values against the old implementation. The
triplanar blend weights also raise the normal to whole sharpnesses by repeated squaring
instead of `powf` (within 1e-6 of it).

Neighbouring lattice cells wrap around: a coordinate past the i32 range puts its cell at
i32::MAX or MIN, and the `+ 1` to the next cell overflowed, which panics in debug builds
(the new test reaches it; main has the same sums). Release builds already wrapped, so the
output is unchanged.

Sample project at 2K (release, 20 threads, back to back): cold full recomposite 4.16 s →
3.78 s, warm 2.41 s → 2.11 s, budgeted (30 ms frames) 6.47 s → 5.19 s.
2026-11-03 14:08:45 +01:00
pavlos vasilantonakis 9fae2fe006 Triplanar patterns skip planes too light to change a texel
Triplanar projections evaluated the pattern on all three planes for every texel, whatever the
blend weights. With the sharp blends smart materials use (sharpness 8), one plane carries the
texel almost everywhere: on the sample's cast iron set 57% of plane evaluations weighed under
1/65535. A plane whose weight, times the gain applied after blending (a pattern's contrast,
sRGB decoding for images), stays under 1/131072 is now neither evaluated nor sampled, so even
two skipped planes move a value by less than one u16 step; results are unchanged when no
plane is skipped.

Sample project (release, 20 threads), from the headless perf suite:
- 2K full recomposite: cold 4.42 s → 2.80 s, warm 2.37 s → 1.33 s
- 4K full recomposite: cold 16.2 s → 11.0 s; budgeted (30 ms frames) 25.5 s → 14.0 s
- recomposite after a 1K bake: 1.05 s → 0.73 s
2026-11-03 13:34:58 +01: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
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 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