Commit Graph
20 Commits
Author SHA1 Message Date
chasse20 b5d9abbb91 Auto: Fix texture set resize ownership and reduce memory peaks
Reject resize results from another project. Release stale pixels and caches before retrying a resize within the original project, preserving intervening edits and one-step undo.

Fix rectangular height sampling, seam-boundary coverage, malformed set selectors and saved channel ordering. Reduce temporary composite and mesh-partition storage, and pack mixed-aspect trace textures without changing their samples.

Keep channel actions reachable in short windows, strengthen export and modal regressions, document the control commands and remove unrelated formatting changes.
2026-11-29 08:04:24 +00:00
Rebornim 41b8a69818 Merge upstream main into the texture sets pass
# Conflicts:
#	crates/formats/src/mesh_import/external.rs
#	crates/ui-egui/build.rs
#	crates/ui-egui/i18n_build.rs
#	crates/ui-egui/src/lib.rs
#	crates/ui-egui/src/menus.rs
#	crates/ui-egui/src/shelf.rs
#	crates/ui-egui/src/shelf_updates.rs
#	crates/ui-egui/tests/i18n_build.rs
#	crates/ui-egui/tests/it/shelf_updates.rs
2026-11-29 06:30:40 +00:00
SteamSmithandClaude Sonnet 5.5 45ea33d09d fix(render): size-limit tests no longer assume wgpu's default 256 MiB buffer limit
The headless device now asks for the adapter's own limits, so on a desktop GPU the 8192x8192
reset in failed_reset_retains_the_active_render succeeds and the test failed. The test now uses a
device capped at 256 MiB (Headless::with_buffer_cap, test only). Also: ImageRes fields are private
on main, so the environment-usage test builds its image with ImageRes::new.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-28 19:21:36 -05:00
chasse20 c6a8a86247 Merge reviewed target into TextureCraft rectangular textures 2026-11-28 08:38:21 +00:00
Rebornim 138b4da099 Texture set size: width and height, so a set can be non-square, set by command and followed by the viewport, filters and export
textureSet.resolution takes an optional height (default: square). Old projects open
square as before; sets whose UV tiles have their own sizes stay square.
2026-11-27 06:14:29 +00:00
Rebornim 40830d0128 Texture set height to normal method: Sharp or Smooth (Sobel), set by command and followed by export, viewport and path tracers
textureSet.settings takes heightToNormal (sharp or smooth) as one undo step and
textureSet.inspect reports it. Smooth is the 3x3 Sobel filter export already used;
Sharp takes the two neighbours across, which the viewport and both path tracers
used until now. All four now read the set's method from one rule
(HeightToNormalMethod::slope, mirrored in mesh.wgsl and trace.wgsl). Projects
without the field stay Smooth, so their exports are unchanged; their viewport
normal now matches the export.
2026-11-27 05:10:45 +00:00
chasse20 d9926733a9 Auto: Preserve IOR edits across background saves
Track IOR-related display changes in the save revision and preserve the exact legacy reflectance scale at IOR 1.5. Improve the shader checkbox outline and cover its contrast and keyboard behavior.

Reuse wrapped CPU trace coordinates, shorten tracer staging lifetimes, and avoid per-set template channel ID allocations. Document the separate glass-interface Fresnel calculation.

Verified with local workspace gate coverage, affected release suites, software rendering, and the shader rail snapshot.
2026-11-27 04:53:09 +00:00
Rebornim 19d8ecf79c Texture set ambient occlusion mixing: set it by command, and None keeps the baked map out of the viewport
textureSet.settings takes aoMixing (multiply or none) and textureSet.inspect reports it.
The viewport's occlusion texture multiplied the baked ambient occlusion in whatever the
setting said, while export already followed it; display tiles now take the set's mixing,
and changing it (or undoing the change) resends that set's textures.
2026-11-26 21:53:48 +00:00
Rebornim e237eae4cb Texture set normal mixing: set it by command, and Replace keeps height out of the viewport normal
textureSet.settings takes normalMixing (combine or replace) as one undo step and
textureSet.inspect reports it. Replace already left the height slope out of exported
normals; the viewport, the normal view and both path tracers now follow it too, while
height still displaces. Projects without the field stay Combine.
2026-11-26 21:53:41 +00:00
vangel76 ce2718a139 Test the IOR specular setting across projects, templates, export and shading
Round-trips cover project save and reopen, older projects and templates without the
field, and template save and apply. The F0 export is checked against the CPU tracer's
Metallic/Roughness F0 at IOR 1.8 in both modes; the GPU tracer is compared with the
CPU tracer and the viewport with and without the setting. Specular/Glossiness export
and shading stay identical with the setting on.
2026-11-25 10:53:03 +01:00
vangel76 088aa4eb06 feat(render): add IOR-based dielectric reflection
Let Metallic/Roughness projects opt into dielectric F0 derived from the
index of refraction. Share the Specular Level multiplier across the
viewport, CPU and GPU path tracing, and the derived F0 texture export.

Store the choice with projects and templates. Keep the legacy factor
for existing projects and authored RGB F0 in Specular/Glossiness.
2026-11-21 22:00:14 +01:00
chasse20 050ec8c1a8 Auto: Fix save destinations and refresh viewer resources
Honor template and layout destinations, preserve the active layout mode, and update the template library after a successful write. Keep Log copy and selection, rotated fill feedback, and image-view restoration consistent with the visible session.

Refresh lighting when an imported environment changes or disappears. Share image resampling by resolution, skip unused headless uploads, bound tile conversion batches, and avoid cloning trace scenes per row slice. Keep the new display and shortcut types in dedicated files.
2026-11-19 23:38:04 +00:00
vangel76 3cbe724030 UI batch 3: view mode picker, display settings, shortcuts, 2D view, log, templates and Window menu
Combines issues #675, #676, #677, #678, #679, #682, #683, #680, #681 and #684.

- View mode combo with section titles, reference names, Other... image picker and an unlit switch
- Display Settings: environment picker grid and drop slot, reference slider ranges, background color, environment alignment, shadow computation mode and opacity
- Settings > Shortcuts with sections, Reset all to default, Delete to clear and conflict warnings; reference action names and default keys
- 2D view: rotate, snap rotate, drag zoom, F reset, wider zoom limits, UV tile grid, numbers, hover label and one mesh wireframe switch
- Log panel with sources, level colours, selection, copy and clear; the exported log keeps each entry's time, level and source
- Save as template, reference template names and a remembered template
- Window menu with Toolbars, per-mode layouts, Hide UI check mark and views per mode
2026-11-19 08:15:57 +01: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
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
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
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
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