Commit Graph
48 Commits
Author SHA1 Message Date
chasse20 a0905d8b4a Auto: Preserve bake repairs and finish pending main merge
Finish integration of main at 7550205 with all saved bake review repairs and cleanup intact.
2026-11-16 00:19:03 +00:00
Rebornim dafbdf3ec7 Bake mode: the Baking Visualization panel and neutral material, as in the reference
Every overlay gets the reference's colour swatch and eyedropper: the high poly, its
matching error, the cage's surface and wireframe (separate, each with an opacity), the
missing seams and the project mesh. The panel opens as the reference's does at first
launch; its eye hides the baking meshes and greys their rows. Show for selected texture
set only filters the cage and the high poly; a hidden high poly leaves the GPU.

The UV seam overlay now marks the hard edges the UV layout does not split, on the low
poly and the cage, in the 3D and 2D views.

The project mesh can show the neutral material, picked in the 3D view's view menu:
colour, roughness, metallic, baked AO, an optional baked bent normal, and Quality as
importance-sampled reflections per pixel.
2026-11-12 04:33:37 +00:00
chasse20 63043aa99e Fix GPU test setup and rendering cache lifetimes 2026-11-11 00:34:26 -05:00
chasse20 78425a2c2a Fix rendering regressions and merge main 2026-11-10 23:48:49 -05:00
chasse20 ca08fb7c3d Merge main and fix symmetry review issues 2026-11-10 20:22:40 -05:00
SteamSmithandClaude Sonnet 5.5 6f5c78d173 Rendering mode: no flash when the camera moves, steadier frames, less grain while orbiting
Orbiting in Rendering mode flashed a "Starting render" placeholder, got grainy
and stuttered once the GPU was busy. Now:
- the path tracer works at half size while the camera moves and keeps the last
  picture on screen until the full-size one has a few samples (no placeholder);
- previous-size accumulation buffers are kept, so switching size does not
  reallocate;
- the samples-per-frame controller uses a frame-time floor (1/75..1/30 s), cuts
  only when a frame takes 1.75x the floor and regrows after 6 frames;
- texture loading counts as motion and texture take-in is throttled, so the
  scene is not rebuilt every frame while materials load;
- environment lookups are cached.

Tests cover the controller, the held picture, size switching and the
quick-frames case.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 06:40:08 -05:00
chasse20 368731f7a4 Fix Clippy checks and clean up affected functions 2026-11-10 05:33:20 -05:00
chasse20 a5f09109ea Merge main into PR 234 2026-11-10 05:33:20 -05:00
MistyMystery 0c1f66d1f5 Live bake preview: update for the bake refactor, share streamed map buffers, narrow the cancel guarantee
Merge upstream main into the branch. The streamed bake now returns the same Arc buffers it handed to the preview, and the document stores those, so a preview never holds a second copy of a map. A cancel leaves the set being baked as it was; sets that finished earlier stay applied.
2026-11-09 19:49:07 +04:00
chasse20 4ed0d49a1c Move bake preview classification into the engine
Share visualization settings between scene shading and GPU sync, and use then_some for the conditional low-poly pass. Cover per-set distances, selected-set filtering, missing inputs and ownership with engine tests.
2026-11-08 19:13:06 -05:00
Chris Hassebrook 7b5cccf1af Fix bake preview safety, seams and visibility 2026-11-08 18:49:05 -05:00
Rebornim 74c9afcad9 Renderer: see-through overlay quads drawn after the mesh
Frames carry quads the 3D view draws depth-tested after the mesh (no depth
writes), so the mesh hides them per pixel; used for the symmetry plane, axis
and the line where the plane cuts the mesh.
2026-11-08 01:39:59 +00:00
vangel76 d8ecfb7d42 Merge upstream/main into fix/clippy-chunks-exact-to-as-chunks 2026-11-08 02:27:35 +01:00
Rebornim bac53688c1 Bake mode: draw the high poly, the cage and where the bake's rays miss
The 3D view in bake mode gets a Baking Visualization panel (high poly, cage,
UV seams, low poly, selected texture set only). The cage is built from the
bake's own ray starts (a RayFrame now shared by the bake and the view), so it
grows and shrinks with the distance sliders exactly as the rays do, and
high-poly vertices the transfer rays cannot reach are drawn red.

Refs #330
2026-11-07 13:26:38 +00:00
Chris Hassebrook 21c71667c4 Merge pull request #293 from storytold/256-bake-settings-edits-only-apply-to-the-active-texture-set
256 bake settings edits only apply to the active texture set
2026-11-06 00:50:38 -05:00
chasse20 747068dbdf Fix bake settings and UV tile controls 2026-11-05 22:39:42 -05:00
RebornimandClaude Opus 5.5 a4b62d6e08 Drop a shelf material on the texture set under the cursor
While a material or smart material is dragged over the 3D view, the
texture set under the cursor shows its mesh edges in the accent color;
a drop selects that set and applies the material there. A drop on the
background does nothing. The whole-view outline is gone for materials
in the 3D view; image drops, the 2D view and the brush zone are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 03:05:47 +00:00
MistyMystery d60fb856c9 Live bake preview: the 3D view shows each mesh map as it finishes
A bake started in the app bakes the set's maps one after another (BakeTask::run_streaming, one bake per map, same pixels as a single bake) and streams each finished map from the worker thread. One map is installed per UI poll into the session's bake preview (not the document); the 3D view follows the newest map raw on the model, with maps and sets not baked yet shown neutral, and the bake bar names the stage. The bake bar picks Follow Newest Map, a finished map or Material. The previous view mode comes back when the bake ends, is cancelled or Bake mode is left; painting is paused while a bake is shown. bake.preview, ui.bake.start and ui.bake.cancel expose it on the control channel. New strings are translated in every shipped language.
2026-11-05 13:20:38 +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
chasse20 e4405760f1 Major refactor of Bake Mode settings and some UI, lots of cleanup for parity 2026-11-04 02:15:08 -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
RebornimandClaude Opus 5.5 132f5d1f06 Bake: ambient occlusion defaults of 64 rays and a tenth of the diagonal, linear falloff
The secondary-ray maps now start from 64 rays reaching a tenth of the
bounding-box diagonal (was 32 rays and a quarter), the defaults common to
mesh-map bakers. Occlusion falls off linearly with the hit distance instead
of with its square, on the CPU and in the GPU shader, so a hit halfway to the
max distance counts half. Thickness keeps its 0.1 reach and also gets 64 rays;
bent normals still share the occlusion rays.

Tests: a floor under a ceiling at half the max distance bakes 0.5 occlusion
(0.25 with the squared falloff), and the default ray settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 21:27:42 +00:00
RebornimandClaude Opus 5.5 bced280aa1 Bake: curvature from short rays around each texel, on the GPU when there is one
Replace the per-vertex mesh curvature with short ray rings around each
texel, so triangle size no longer decides the result: walls beside the
point (concave), hard edges (convex), the spread of the smooth normals and
true curvature where shading and faces agree. A high poly uses a small
true-curvature radius, and with match by mesh name a part only reads
itself. Rays go through RayScene::closest in bounded chunks, so they run
on the GPU tracer when there is one. Ray is laid out as the shader reads
it and uploads without a copy. Output stays 0..1 with 0.5 flat;
curvatureStrength and curvature_from_normal keep their meaning.
Clean-room implementation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 07:02:23 +00:00
bflatastic 30c359ce8c The viewport reads the tile scale unfiltered
Neighbouring blocks and coarser mips blended Extra's alpha into a scale that
belongs to neither tile; parallax and height-to-normal now load it at mip 0.
2026-11-02 21:27:28 +07: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 63b54f1cec fix(render): the GPU bake test's BakeRequest names the new skew field 2026-11-02 16:21:40 +07:00
BFlat 558168d09a Merge pull request #55 from Agapenordev/fix/import-gpu-oom
Never crash importing meshes with many materials
2026-11-02 12:33:22 +07:00
bflatastic 8efd62aeaa Viewport: no ghost edges in the subsurface blur
Skin and other scattering materials showed copies of the silhouette
running parallel to it: the blur's taps sit pixels apart when the mean
free path is wide on screen, and a tap that left the mesh dropped out
of the sum, so the light stepped at every tap spacing from the edge.
Taps are now shifted per pixel and per accumulated frame, and a tap
across a depth discontinuity takes the centre's light instead of
dropping out.

Fixes #86.
2026-11-02 07:59:35 +07:00
Agapenordev fd9768a28d Merge remote-tracking branch 'origin/main' into fix/import-gpu-oom 2026-11-02 01:24:39 +01:00
bflatastic 963008635c display.set: refuse unknown environment names
The built-in environment list moves to core (render re-exports it), so
the engine can name the valid ones in the error.

Fixes #65.
2026-11-02 05:34:40 +07:00
Agapenordev b0cd961e90 Merge remote-tracking branch 'origin/main' into fix/import-gpu-oom 2026-11-01 22:23:11 +01:00
AgapenordevandClaude Opus 5.5 3591e02758 Address review: WebGPU verdicts, repaints, lasting memory notice
- Allocation checks never take an unanswered error scope as success:
  native backends block on the verdict; the browser's WebGPU answers
  later, so the full-size texture waits beside the bound placeholder
  (tiles go into it under discarded scopes) and Renderer::prepare
  installs it on success, or keeps the placeholder and reports the set
  on failure. The UI keeps drawing frames while a verdict is pending.
- The GPU side wakes the UI when it records an uncaptured error or an
  allocation failure, so the notice shows even when the app is idle;
  failures are collected after prepare, where late verdicts land.
- Sets the GPU could not hold share one sticky notice (dismissible,
  listing them) instead of a six-second toast each, since they are not
  retried.
- The out-of-memory error is reported as the cause rather than the
  follow-on invalid-texture error.
- The notice no longer uses "▸", which the UI fonts lack (egui panics
  on a missing glyph).

Tests: a late texture stays unbound until accepted; a late rejection
keeps the placeholder and is reported once; a verdict that never comes
counts as a failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 22:12:12 +01: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
AgapenordevandClaude Opus 5.5 098602ec49 Never crash importing meshes with many materials
Every texture set (one per mesh material) allocated full-size display
textures (base color, emissive, ORM, normal, height, aux, with mips) as
soon as it was created: ~130 MB of GPU memory per set at the default
2048 import size. A 16-material OBJ ran a 4 GB laptop GPU out of memory
and wgpu's default error handler panicked, closing the app.

- Display and aux textures start as 1×1 neutral placeholders and get
  their full size with the first non-neutral tile (or aux image), so an
  import costs no GPU memory until its sets are painted.
- That allocation runs in an error scope: on failure the texture keeps
  its placeholder (no retry per tile), the failure is logged and the UI
  shows a toast naming the texture set and the Viewport ▸ Texture
  resolution setting. Painting and export are unaffected.
- The app installs an uncaptured-error handler that logs and reports
  wgpu errors as toasts instead of panicking.
- The GPU path tracer takes each set's size from its largest texture,
  since any kind (base color included) may now be a placeholder.

Tests: 40 sets of 2048 allocate nothing until painted, one painted kind
allocates alone, the aux texture allocates on its first upload, painted
placeholders render, and the GPU tracer matches the CPU with a default
base color beside varying roughness (fails with the old size logic).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 21:05:50 +01:00
bflatastic 814765d96d Viewport backdrop in the interface's slate
The views' studio backdrop is a cool slate, lighter at the top, matching the panels around them (post pass, CPU and GPU path tracers), and the viewport token and its lettering follow it.
2026-11-01 19:46:15 +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
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
bflatasticandClaude Opus 5.5 3bab36ec84 Accumulate effect frames with an exact per-pixel copy (no filtered read)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 16:15:23 +07:00
bflatasticandClaude Opus 5.5 f4496037ea Sample opens ready to paint; exact per-pixel reads in the DoF and subsurface passes
- The startup sample adds an empty paint layer on top of each stack and selects it (strokes on
  the bottom layer were hidden under the smart material)
- Depth of field and subsurface blur read same-size targets by pixel, not by filtered UV, so
  inert settings change nothing on any adapter (software adapters blended neighbours)
- CLI help lists .abc and builtin:udim_plane

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 15:38:44 +07:00
bflatasticandClaude Opus 5.5 cd65c8ebfd Headless render tests: compare inert-feature renders within one level (software adapters)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 14:43:00 +07:00
bflatasticandClaude Opus 5.5 1e88b9041f Smooth 8K strokes, decal handles, displacement, refraction, release readiness
- Strokes pre-blend their commit while painting and recompose committed tiles at low
  priority: the 8K stroke-end frame drops from 30-42 ms to 12-19 ms
- Texture set resize runs in the background (8K: 3 s to 0.5 s, UV padding map from island
  borders only)
- Decal move/scale/rotate handles; FBX and USD high-poly textures for the color map;
  viewport displacement from the height channel; screen-space refraction of the scene
- CI pinned to Rust 1.96.0; FreeBSD VM sized for hosted runners; release builds embed
  craft-fonts; file associations for FBX, COLLADA, USD and Alembic on every platform
- README, release checklist, NOTICE and attribution brought up to date

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 13:25:10 +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 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