Commit Graph
52 Commits
Author SHA1 Message Date
FredApps 46a7d647d2 Fix missing If/Else value branch types 2026-11-15 11:19:47 +01:00
chasse20 1a7225c8c2 Auto: Reuse SBS parsing and fix stale preview cache failures
Integrate main's read limits and preserve the font, evaluator, converter,
and measured preview repairs. Complete the scoped type, comment, and
spacing cleanup.

Reuse one validated XML document for library layout and graph reads.
Associate cache maintenance completion with its submitted revision so
old failures cannot consume new settings or clear requests.
2026-11-14 22:52:26 +00:00
Chris Hassebrook bb7434478c Matching CI to TextureCraft (#222)
* ci: port TextureCraft verification improvements

* fix: keep CI green on stable Rust
2026-11-14 08:52:48 +01:00
chasse20 e9b777bee2 CPR review #1 2026-11-14 03:45:23 +00:00
chasse20 2318d25a3a Improve clean-room SBS evaluation parity 2026-11-13 11:46:15 -05:00
chasse20 46802a44fc Merge latest SBS branch improvements
Preserve resource and rendering fixes alongside updated library previews, node UI, and function input support. Reconcile evaluator state and loop caching while retaining both sets of regression tests.
2026-11-12 18:52:32 -05:00
chasse20 3432f14b53 Fix SBS resource resolution and shared graph rendering
Use the supplied attributed resources, replace legacy surface and font references on import, and keep resource credits outside SBS files.

Correct function evaluation state, FX-Map roughness and regions, primitive rendering, gradient handling, and scalar luminosity validation. Add regression coverage for resource import and shared rendering behavior.
2026-11-12 18:46:34 -05:00
PiJellyPin cf0a32dd1c Fixing node pairity
loading images to slow
2026-11-13 00:12:41 +01:00
chasse20 bd0284959e Import SBS library and checkpoint compatibility work
Add 548 native library packages and 11 original resource substitutes,
with rewritten descriptions/layouts, shared resource references and
bundled assets for desktop and browser builds. Retain supplied graph
implementations; presentation changes are not an independent rewrite.

Preserve baseline SBS formatVersion and refresh updaterVersion on saves.
Fix foreign resource bindings, native parameter/port mappings, scalar
channel functions, FX-Map roughness and bounded graph expansion.

Validation: release core/formats/nodes/eval/engine tests, converter
tests, strict Clippy on Rust 1.96, layering, WASM, formatting and diff
checks passed during this work. All 560 library files reproduce exactly.
Bricks cooks without errors; the full library audit still reports 308
warning entries and 10 standalone function compilation failures.

Work in progress: node-local Set scope, remaining native parameter
support, primitive numerical parity and external save/reopen validation.
The motionblur identifier needs reference-runtime investigation.

Refs #191
2026-11-11 02:09:41 -05:00
chasse20 709cd7f86e Fix function instance inputs and cache refresh 2026-11-10 05:15:39 -05:00
chasse20 131c7b8853 Fix parameter defaults, sizing and tooltips 2026-11-10 04:54:21 -05:00
chasse20 85e0bf9247 Add parameter-owned function graphs 2026-11-10 04:07:54 -05:00
chasse20 a0032d6ac2 Add SBS function library and Explorer graph editing 2026-11-08 17:25:08 -05:00
chasse20 570bc528a6 Add linked graph instances 2026-11-07 18:23:51 -05:00
chasse20 8101e8da68 Refine graph outputs and Explorer 2026-11-07 17:00:36 -05:00
chasse20 b99ca7f361 Improve function editing and link swaps 2026-11-07 15:49:40 -05:00
Belligerently be871550c0 Keep black and white backgrounds in Color dodge and Color burn
The W3C color-dodge formula keeps a black background black even under a
white foreground, and color-burn keeps a white background white even
under a black foreground. blend_channel checked the foreground first, so
both edge cases came out inverted.

Fixes #135
2026-11-06 13:04:13 -05:00
d05d2bf0a9 Clamp enum and degenerate-range parameters to hard limits (#115)
A hostile file or binding could supply an out-of-range enum or degenerate-range numeric value that reaches a cook unclamped, breaking the hard-limits guarantee for node parameters.

Make clamp_params bound enum values even with no options and bound numeric values even when min is not below max, using the same hard-span limits as other parameters.

Test: clamp_params_bounds_enum_without_options failed before the change and passes after.

Co-authored-by: eliets2 <287273517+eliets2@users.noreply.github.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 10:10:32 +01:00
chasse20 2adbdf4aab Merge main while preserving native graph architecture 2026-11-06 00:58:56 -05:00
chasse20 fe88ee5c4d Unify graph editors and optimize material workflows 2026-11-06 00:13:10 -05:00
chasse20 d318484b41 Checkpoint native SBS primitive workflow
Replace the legacy Rust procedural library with clean-room native primitives, typed function execution and FX-Map graphs. Save supported content as native SBS and organize the model, evaluators, codecs and editors into focused modules.

Add shared graph editing behavior, flat filtered node menus, frame and comment editing, named Explorer outputs and an original atomic sample. Document the tested scope and remaining interoperability work.
2026-11-05 18:23:06 -05:00
FredApps 56407b9470 Revert the batch rollback and restore prior main 2026-11-05 22:04:58 +01:00
Rafael Mendes a7b9194820 Revert reviewed PR batch and cancel 0.1.3 preparation
Restore tracked files to 91bb53f07a, immediately before the batch, at the maintainer request. Preserve the existing history and earlier work, including PR #38. Revert the 50 reviewed PR merges and the version bump in 441092c. The published 0.1.2 release is unchanged.
2026-11-05 17:48:14 -03:00
Rafael Mendes f48a0b559e Merge pull request #94 from Belligerently/fix/distance-source-propagation
Fix Distance node edge artifacts with exact source propagation
2026-11-05 16:01:46 -03:00
Rafael Mendes cc9a5b3c82 Keep bitmap color-space requests unambiguous and inspectable 2026-11-05 15:19:39 -03:00
Rafael Mendes 0a561fa681 Integrate normal-to-height solver with the complete filter regression suite 2026-11-05 15:08:06 -03:00
Rafael Mendes 8e14183b8f Apply hard safety bounds during parameter resolution without restricting manual editing 2026-11-05 15:00:27 -03:00
Rafael Mendes cf7ffa16fa Merge branch 'review/pr-80' into review/pr-82 2026-11-05 14:52:27 -03:00
Rafael Mendes 9015d88f15 Register the shared filter regression module once 2026-11-05 14:52:25 -03:00
Rafael Mendes 3ad3e387c9 Merge branch 'fix/noise-tiling-seams' of https://github.com/SteamSmith/materialcraft into review/pr-82 2026-11-05 14:51:38 -03:00
Rafael Mendes 3ec7a33d4b Merge branch 'fix/splatter-bounded' of https://github.com/SteamSmith/materialcraft into review/pr-81 2026-11-05 14:51:00 -03:00
Rafael Mendes 2f0a595001 Preserve normal blend regression alongside bounded blur tests 2026-11-05 14:50:58 -03:00
Rafael Mendes 2748778c9f Merge branch 'fix/normal-blend-nan' of https://github.com/SteamSmith/materialcraft into review/pr-75 2026-11-05 14:38:54 -03:00
SteamSmithandClaude Sonnet 5.5 47b69c0f3a chore(merge): bring fix/bitmap-colour-space up to date with main
Upstream's ResourceBytes and decode limits kept; decode keeps the linear flag, and the
decoded-image memo is now keyed by (content hash, linear) so sRGB and data reads of the
same file don't collide.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 12:10:10 -05:00
Rafael Mendes cee6a7a38f Merge branch 'fix/18-function-math' of https://github.com/storytold/materialcraft into review/pr-69 2026-11-05 14:07:01 -03:00
Belligerently 61aec6f9ff Fix Distance source propagation with exact nearest-mask sites 2026-11-05 12:02:51 -05:00
SteamSmithandClaude Sonnet 5.5 fc1257baa4 chore(merge): bring fix/anisotropic-blur-bounded up to date with main
Kept this PR's O(1) horizontal Gaussian and upstream's non-finite sigma guard; dropped
upstream's pass/kernel caps, which the single pass makes redundant.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 11:57:51 -05:00
Rafael Mendes 82373ba8f7 Merge pull request #40 from simonhull/fix/enforce-param-ranges
Nodes: clamp parameters to hard limits before cooking
2026-11-05 10:35:51 -03:00
SteamSmithandClaude Sonnet 5.5 8c6fcf64f8 fix(nodes): scale the coarse levels of Normal to Height correctly
The multigrid solve divided the slope divergence by the level's scale where it
must multiply (one coarse pixel spans `scale` full-size pixels), so the coarse
levels contributed almost nothing and the broad shape was lost. A Gaussian bump
round-tripped through Height to Normal now correlates 0.99+ at 256 and 1024 px
(0.86 at 256 before).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 07:16:49 -05:00
SteamSmithandClaude Sonnet 5.5 84bd8f8b9d fix(nodes): clamp numeric parameters to their declared ranges
resolve_params only checked types, so a hand-edited file, a binding to an
exposed input or a dynamic function could pass any float or int to a cook
(including NaN and 1e30). Clamp Float, Int and Float2 parameters to the
declared min/max in resolve_params (new clamp_params; non-finite values fall
back to the default; angles are left alone) and again in eval after bindings
and functions have run.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 07:13:59 -05:00
SteamSmithandClaude Sonnet 5.5 98279937bc fix(nodes): make Anisotropic Noise, Grunge Map 3 and Leaks tile
Each used one noise period for both axes while the cell counts differed per
axis, leaving a seam. Add noise::value_xy (separate period per axis) and use
whole-number cell counts. The noises_tile test now checks the top/bottom edge
too, compares against the mean neighbour difference, and covers the three nodes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 07:05:29 -05:00
SteamSmithandClaude Sonnet 5.5 ee903c96ad fix(formats): choose sRGB or linear when reading bitmaps
decode() sRGB-decoded every 8/16-bit color bitmap, so an RGB normal map
(0.5, 0.5, 1) became (0.214, 0.214, 1). decode now takes a linear flag. The
Bitmap node gets a Color space choice (sRGB by default, so existing files cook
the same) and graph input preview images can be bound as linear data maps
(graph.input.bind linear: true, stored in input_images_linear).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 06:58:19 -05:00
SteamSmithandClaude Sonnet 5.5 4e21afda5f fix(nodes): cap the bin span in Splatter and Scratches
The grid-bin span was unbounded, so a large size or length visited billions of
bins per item, and Splatter also scanned each bin with contains. Cap the span
to one turn of bins per axis (as fx_map does), drop the contains scan, and
clamp Splatter's count to its declared maximum of 2000.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 06:57:14 -05:00
SteamSmithandClaude Sonnet 5.5 7cbdce8e63 fix(nodes): bound the anisotropic blur's horizontal pass
blur_xy made ceil(extra/2) full-image passes with an unclamped sigma, so a
large intensity at high resolution took ~1e11 ops and a hostile one never
ended. Clamp both sigmas to the image size and do the extra horizontal blur
as one Gaussian (new ops::gaussian_h, three box passes, O(1) per pixel).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 06:51:38 -05:00
SteamSmithandClaude Sonnet 5.5 d428d41c87 fix(nodes): Normal Blend no longer returns NaN for a base normal with z = -1
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 06:39:23 -05:00
Rafael Mendes dce9f30c5a Add base-two and Cartesian function primitives 2026-11-04 23:25:13 -03:00
Simon Hull eef9f5397f Nodes: clamp parameters to hard limits before cooking 2026-11-03 14:23:07 -06:00
Rafael MendesandClaude Opus 5.5 934c227774 feat(levels): histogram editor in the properties panel
Selecting a Levels node now shows a visual editor above its sliders: a
histogram of the node's input (256 bins; red, green and blue overlaid for a
color input; scaled to the tallest bin between pure black and white) with
the clipped ranges shaded and the levels transfer curve on top, draggable
input low/mid/high handles under it and output low/high handles under a
black-to-white bar.

Fixes in how Levels is edited: Level in mid is relative to the input range,
and its handle now sits where it acts and moves with the range; the input
low and high handles cannot cross. Parameters bound to inputs or driven by
functions keep their handles locked. Every drag is a graph.node.param
command, one undo step per handle. levels_fn no longer propagates NaN.

Tests cover the histogram, the handle constraints and the remap math; the
snapshots UI test renders the editor. Documented in docs/levels-editor.md.

Clean-room implementation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 15:03:08 -03:00
bflatasticandClaude Opus 5.5 cba0bd440a Add 25 nodes: FX-Map, SVG, Text, tileable 3D noises, weathering and filters
Clean-room implementations, all tileable when they generate:
- fx_map (Atomic): grid / random / random-quadtree instancer of up to three
  patterns with scale, rotation, position and luminance jitter and Max / Add /
  Alpha-over blending, on a shared binned splatting engine.
- svg (Atomic): SVG path data parser (M L H V C S Q T Z, absolute and relative,
  errors instead of panics) with even-odd / non-zero fill (exact horizontal
  coverage on 4 sub-scanlines) and anti-aliased stroke.
- text (Atomic): original single-stroke vector font rendered as capsules,
  with alignment, spacing, multi-line, rotation and edge wrapping.
- perlin_noise_3d, worley_noise_3d (periodic 3D lattice, z scrubs) and
  simplex_noise_3d (4D simplex on a flat torus).
- shape_splatter, paint_strokes, scratches_generator, cracks, rust, moss,
  leaks, edge_damage, tile_random, ambient_occlusion_fast,
  normal_from_height_hq, histogram_select, quantize_color, pixelate_color.

Every new node cooks under 100 ms at 1024x1024 in release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 05:02:19 +07:00
bflatasticandClaude Opus 5.5 0fc8a65bc3 Add 79 nodes: flood fill family, noises, patterns, filters, material blending and weathering
Clean-room implementations from public algorithms, all tileable and size-independent:
- Filters/Flood fill: tile-wrapping connected-component labeling into an index map, plus
  random grayscale/color, gradient, bbox size, position and sample-at-center nodes.
- Noises: value, ridged/voronoi/cells fractals, directional, fibers, messy fibers, leather,
  microscope, gaussian spots, crackle, sand dunes, wood grain, marble, stones, ripples,
  concrete, bark (per-axis lattice periods keep stretched noise seamless).
- Patterns: grid lines, dots, diamonds, herringbone, basketweave, chevron, fish scales,
  triangles, spiral, rings, axial/circular gradients, cross, rounded rectangle, ring,
  arc pavement, octagon tiles, planks, tread plate.
- Filters: remap, smoothstep, S-curve, per-channel levels/auto levels/invert/clamp, color
  variation (per flood fill region), lerp and two-input math, median, unsharp mask, Sobel,
  outer glow, inner/drop shadow, curvature from height, outline, whiteout normal combine,
  normal rotate, Sobel normals.
- Material filters: material blend and height blend (renormalized normals), edge wear,
  dirt and dust masks, base color adjust, measured metal base colors.

Tests: flood fill labeling and edge wrap, material blend picks material 2, pattern tiling,
new ids in the noise tiling test; catalog now has 203 nodes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 04:33:07 +07:00