Commit Graph
27 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 5214f3dbba Bake mode: list overlapping UVs and unpaired parts before baking
Above the bake bar, bake mode lists what would spoil the next bake of the included
texture sets: a UV layout overlapping by more than 1%, and under "By Mesh Name" the
low-poly parts no high-poly part matches and the high-poly parts that match no low-poly
part. The pairing comes from the bake's own name keys, now one helper the bake and the
list share.
2026-11-12 04:33:37 +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 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
vangel76 d8ecfb7d42 Merge upstream/main into fix/clippy-chunks-exact-to-as-chunks 2026-11-08 02:27:35 +01:00
Rebornim 346a0b24f5 Bake visualization: test every branch of VertexReach::missed
A table over distance starts (painted amount 1 and 2) and a cage-mesh
start covers both inclusive ends of the ray range, a name mismatch and
Ignore Backface both ways. Also test a request with no high poly.
2026-11-08 00:26:26 +00: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 eb9b736520 Merge pull request #311 from Rebornim/fix/curvature-default-mesh
Bake curvature from the mesh by default
2026-11-07 01:24:45 -05:00
Rebornim 56bbf26acf Bake: curvature from the normal map follows the surface, one band per edge
Curvature from the normal map took a 4-texel (at 2K) difference of the
tangent-space normal. The wide difference split each sharp normal change
into two thin peaks with rings around small details, and the tangent map
bends against a smooth-shaded low poly's own shading, so flat faces baked
as concave.

It now measures how fast the baked world normal turns along the surface
direction of each texel step (from each low-poly triangle's UV mapping),
with differences that never read uncovered texels or cross a UV tile, a
1-2-1 average across each derivative so lines are equally wide in every
direction, and a soft roll-off instead of clipping. Details keeps its
meaning; the default response is about 25% softer.

Fixes #316
2026-11-07 03:15:50 +00:00
Rebornim b1f377b8eb Bake curvature from the mesh by default
The normal-map method cannot see the low poly's own edges: a box baked
from itself gets flat curvature, and a box baked from a beveled high poly
gets a dark line along its convex edges. New projects now start on the
mesh method; projects that store a method keep it.
2026-11-06 23:46:46 +00:00
chasse20 747068dbdf Fix bake settings and UV tile controls 2026-11-05 22:39:42 -05: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 a2df25c956 Merge main and resolve Bake conflicts 2026-11-04 04:14:19 -05: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 7437962a3b refactor(bake): Prepared::correct takes the low-poly Surface instead of eight arguments 2026-11-02 16:21:40 +07:00
SteamSmithandClaude Sonnet 5.5 ea4a678a0a fix(bake): bound skew painting and image size, layout only in bake mode
- SkewMap::paint refuses a stroke whose dabs would visit more than 2^26 texels, before any
  texel changes; the dab count alone didn't bound the work of a big brush on a big map.
- bake.skew.set checks the image size from its header (decode_image_within) before decoding.
- The 2D view is shown for the skew brush in bake mode only, not in rendering mode.
- Prepared::correct allows its argument count for clippy; the skew test uses its own folder.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-02 01:22:14 -05:00
SteamSmithandClaude Sonnet 5.5 9bb2f91809 feat(bake): paint the skew map in the 2D view
A Skew correction section in the Bake panel turns on a brush (radius, value, hardness) that
paints the map in the 2D view; the map shows as an orange overlay while baking. The 2D view is
shown in bake mode while the brush is on. Strings in all ten languages.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 20:44:10 -05:00
SteamSmithandClaude Sonnet 5.5 e92e04ce50 feat(bake): paint the skew map with bake.skew.paint
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 20:24:02 -05:00
SteamSmithandClaude Sonnet 5.5 d1d925a4ad feat(bake): skew correction for high-poly transfer rays
A greyscale skew map over the UV atlas turns the transfer rays that start from the built-in
distance cage from the averaged direction towards the low poly's base normal (the vertex
normal, or each triangle's flat normal). 0 keeps the ray, 1 turns it fully, grey blends. Edge
protection fades the correction out near hard edges (faces more than about 30 degrees apart),
by distance as a fraction of the mesh diagonal and a contrast exponent.

New bake::SkewMap and BakeRequest::skew (a custom cage mesh sets its own rays and ignores it).
Engine: bake.skew.set {value | path, edgeDistance, edgeContrast, base} and bake.skew.clear;
the skew shows in bake.highPoly.list. The map is not saved in the project yet.

Tests: unit tests for sampling, validation, hard edges and the blend; an analytic baker test
(a leaning low poly under a plane: black unchanged, white equals the upright height, grey
between); an engine test through the commands including an image map and refused input.

Ported from SurfaceCraft's baker (MIT OR Apache-2.0) and adapted to this crate's Ctx.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 15:29:54 -05: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 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