Repository navigation
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
Rebornim
force-pushed
the
feat/textures-2
branch
15 times, most recently
from
December 3, 2026 10:52
e9fe15b to
def8607
Compare
A pattern can now carry a look: its kind's own controls, drawn so it repeats seamlessly at whole-number scales. Clouds gets a new look, and Soft clouds and Dark clouds are added. Picking a kind gives it its look; patterns saved before and every built-in (smart masks, materials, finish filters) keep drawing as they did, and lookDefaults switches a saved pattern over. Refs storytold#927
…st; tidy the seam test
…at tile, with their own controls
…ushed's seam test allows rounding on its hard row edges
…seam off its row edges
…ft dark folds that tiles
…es, Faint cells and Cell patches
A new pattern of square blocks in three flat tones, painted by layers of block rectangles so same-tone rectangles merge into stepped blobs and bars rather than random salt (Blocks, Shape size, Dark, Light, Layers). Drawn in the tile look family on the GPU, the same as the CPU.
Camouflage gets a look: three fields of warped noise, each cut hard into dark, mid and light blobs over a base, eight blob fields per UV tile by default so the blobs sit at the size a woodland pattern has. Coverage sets how much of the base the blobs cover; Wobble how much their edges wander. It draws on the GPU as a look family of its own (opcode 93). Patterns saved without a look keep their earlier drawing.
Knit's stitch columns ran dead straight. The jersey references' columns drift sideways in long S-curves over a few stitch rows, neighbours pinching and widening, with each stitch's leg a little thicker or thinner. A new Wander control (0 to 1, 0.5 by default) bends the stitch lattice with smooth noise that repeats with the stitches and varies each stitch's thickness and tone; 0 draws the straight columns as before. CPU and GPU draw it the same way (knit_matches_the_cpu).
Rebornim
force-pushed
the
feat/textures-2
branch
from
December 3, 2026 11:54
7bcbf51 to
eeb6504
Compare
The skin pores look did not reach its reference and moves to the image-based pass. Pores draws as it did before this pass; Moss stays in the spots family, which now carries its three controls without a style word.
Rows of square cells left joints running straight across the whole repeat. Now every grid corner is a T, the joint running through it taking turns between across and down, and every joint is two cells long and moved off its line at random, so tiles come in many widths and heights. Tiles longer than a cell may be split again (Splits, default 1). Two cells per repeat, so the weave always meets itself; default scale 5.
…ference measures Each row (hard edges, centred on whole steps) runs one smooth curve along the brushing through random tones at evenly spaced knots, shifted by the row's own random share of a knot. Streak length now reaches 1/512 of the repeat (fine grain) and starts at 0.25 (four knots).
Rebornim
force-pushed
the
feat/textures-2
branch
from
December 3, 2026 12:55
23fe219 to
c3e2f6b
Compare
…drawn as slivers at its corners
…the look lowering without its dead branches
…apshots cover every toggle
… tests check relations
…first UV tile, as the CPU draws it On later UV tiles the GPU laid the coarse grid out from the far-out point, so it could round apart from the CPU export there.
…int at the lowering's own file
Rebornim
force-pushed
the
feat/textures-2
branch
from
December 3, 2026 13:37
4d5ed67 to
01fbcf3
Compare
…d for translators The options reach tr() through their enums' labels, not as literals, so the translation coverage report never listed Straight, Flowing, Parted, Ramp, Mirrored, Cloudy, Up, Right, Down or Left; they join the other enum labels in catalog_keys.
The tone-and-grain measure the look tests share was a struct inside pattern.rs's tests module; it now lives in pattern/tone_and_grain.rs (test builds only) as ToneAndGrain::of, one type per file.
docs/features.md counted 58 procedurals but listed none of the kinds this branch adds and never mentioned looks: whole-number scales that tile, the kind's own controls, and the earlier drawing kept for saved patterns.
…values panic_hunt_pattern_looks sends 1e30, -1e30, 0, null, a string, an array, an object and true to each control of every pattern with a look (and to an unknown control, to look itself and to lookDefaults) through layer.fill.set and effect.set, renders after each, and checks that a refused edit leaves the project and the undo history as they were.
… cells into the period once per row and column
… lean is read only when it reaches the point
…nce per row and column
…e its list is open
Wrapping the 25 cells once per row and column measured no faster on a UV tile and two thirds slower on triplanar (codegen), so the fold loop reads each cell as it did
Rebornim
force-pushed
the
feat/textures-2
branch
from
December 3, 2026 16:33
aa7abc7 to
0c072cf
Compare
Pores draws grainy, mottled skin again, crossed by three bent networks of fine broken creases. Its pores are now small, evenly sized and placed only along the middle network's creases, instead of scattered over the skin at random. Pores is now the share of places along those creases that hold one (0.85 by default). The look rejoins Moss in its family, which carries a style word again.
Rebornim
force-pushed
the
feat/textures-2
branch
from
December 3, 2026 16:37
0c072cf to
3687b9c
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft. The pattern looks are done and reviewed: every look below was approved in review except Skin pores, whose redrawn pores are still in review. It stays a draft until the measuring question on storytold/craft-contrib#85 is settled. Done: rebased onto main (after #897); the GPU viewport's opcode range and side-table record for patterns drawn with a look; #930's Clouds, Fine noise, Cells, Crumpled foil and weave looks drawn on the GPU; new or reworked looks for Perlin noise, Voronoi, Smooth fur, Ridged noise, Hammered, Brushed lines, Moss, Pores (skin), Tiles, Bricks, Hexagon tiles, Random tiles, Tread plate, Checker, Stripes, Halftone dots, Wave scales, Gradient, Round gradient, Strip flooring, Herringbone planks, Goose-eye twill, Diamond brocade, Houndstooth, Chevron, Knit, Camouflage and Digital camo, each drawn on the CPU and on the GPU.
Closes #927, closes #943. Carries the commits of closed #930 (pattern looks), rebased onto main.
Not in this PR
What changes
Tests
gpu_composite::looks::tests::*_matches_the_cpu: each family on the GPU against the CPU oracle at a UV fill and a triplanar mask (128²), run on Lavapipe.a_pattern_with_a_look_never_composites_as_its_kinds_earlier_drawing.cloud_stacks_match_the_cpu,cells_match_the_cpu,crumpled_foil_matches_the_cpu,weaves_match_the_cpu,smooth_noise_matches_the_cpu,domed_cells_match_the_cpu,fur_matches_the_cpu,a_pattern_with_a_look_never_composites_as_its_kinds_earlier_drawing,material_patterns_match_cpu_as_fills_and_masks(unchanged, every kind),package_shaders_validate_and_write_glsl_without_an_adapter: all pass.cargo test -p texturecraft-compose --lib,cargo test -p texturecraft-core --liband the Lavapipe list above: pass. Keep resized paint sharp and accelerate mask generators and live painting #897's generator opcode 47 and these look opcodes (81..127) are separate ranges.cargo test -p texturecraft-core -p texturecraft-texel --libandcargo test -p texturecraft-engine --test it pattern_looks: pass.xtask layersandxtask wasm: pass. Clippy (-D warnings, Rust 1.95.0) on texel, core, compose, engine: pass; on render and ui-egui it stops at one existing line not touched here (gpu_composite_projection.rs:403,nonminimal_bool), so those two are not fully linted by this run.cargo test -p texturecraft-compose --lib: pass (Fine noise is now a one-octave preset of the cloud stack; same values).spots_match_the_cpuand the whole Lavapipe look list above,cargo test -p texturecraft-compose --lib,cargo test -p texturecraft-engine --test it pattern_looks,--test session panic_huntandxtask layers: pass. Clippy (Rust 1.95.0) stops at one existing line not touched here (crates/geom/src/bvh.rs:451,nonminimal_bool), so this change is not linted by that run;xtask wasmnot run.tiles_match_the_cpu,lines_dots_and_ramps_match_the_cpu,boards_match_the_cpu),cargo test -p texturecraft-compose -p texturecraft-core --lib,xtask layers,cargo test -p texturecraft-engine --test it pattern_looksand--test session panic_hunt: pass. Clippy (--no-deps -D warnings, Rust 1.95.0): texel, core, compose and render pass; it stops at two existing lines not touched here (gpu_composite_projection.rs:403nonminimal_bool,layer_pick_list.rs:126collapsible_match), so ui-egui and engine are not fully linted. These runs caught test gaps in the tile and line commits, fixed in them: looks with no random part at their defaults are no longer asked to change with the seed, the control sweep samples an odd grid so thin mortar and bars aren't missed, and two drawing functions take fewer arguments.xtask wasmnot run.prints_match_the_cpu: pass (on 2eb5259, same drawing code).cargo test -p texturecraft-compose -p texturecraft-core --lib: pass. The first compose run caught Diamond brocade's diagonal edges falling exactly on the seam test's sample points (rounding then picked a different side one tile over); every print's motif now sits a fraction of a texel off those points. Engine, ui-egui and clippy: upstream's gate on this PR.knit_matches_the_cpu: pass;cargo test -p texturecraft-compose -p texturecraft-core --lib: pass (on 58dc5af; the amend only renamed a shader parameterfrom, a reserved WGSL word, which the first Lavapipe run caught), and the knit unit tests on ebceca8: pass. Engine, ui-egui and clippy: upstream's gate on this PR.digital_camo_matches_the_cpu,camouflage_matches_the_cpuandknit_matches_the_cpu(47100380025),cargo test -p texturecraft-compose -p texturecraft-core --lib(47100386391),cargo test -p texturecraft-engine --test it -- layers pattern_looks(47100394256): pass. Clippy on the fork runner did not get to our crates: it stops at anonminimal_boollint incrates/geom/src/bvh.rs, unchanged from main; clippy for this PR is upstream's gate, which passed on ubuntu-24.04 at eeb6504 (run 47100393657; its Windows leg still running when this was written). Before the removal, on 7bcbf51:cargo test -p texturecraft-compose -p texturecraft-core --lib(47099040402) andcargo test -p texturecraft-engine --test it -- layers pattern_looks(47099124708): pass; on 6c4405d the Lavapipe look list withdigital_camo_matches_the_cpuandcamouflage_matches_the_cpu: pass (47093246975). Knit's CPU port checked against the prototype: p99 0.5/255. CPU export cost at 4096 against Clouds: Camouflage 1.7x, Digital camo 2.1x. Upstream's gate on 7bcbf51 failed atcargo fmt --check(three files formatted without the repository's rustfmt.toml); fixed in the Knit Wander commit.brushed_matches_the_cpunow allows 0.5 % of texels to round into the next row at a hard row edge):cargo test --release -p texturecraft-compose -p texturecraft-core --libpassed on 2a3de80 (47106741708). On 23fe219: compose + core lib (47108323934),xtask layers,--test it pattern_looksand--test session panic_hunt(47108337233): pass; the Lavapipe look list failed there because the brushed shader named a variablefrom(a reserved WGSL word), renamed in the same commit (now c3e2f6b), where the Lavapipe look list passes (47110370714). Brushed's export checked against the reference by its statistics (tone spread, streak and row correlation), not pixel for pixel.layer.fill.set(a_signed_whole_number_control_crosses_zero_both_ways, fails without the fix); Tread plate's outer bars with no room in their cell are left out instead of drawn as corner slivers (tread_plate_outer_bars_with_no_room_leave_the_corners_bare, fails without it); the GPU viewport lays a reduced-resolution look's grid inside its first UV tile as the CPU does (a_reduced_look_a_whole_uv_tile_over_matches_the_cpuchecks the two agree a whole UV tile over; it also passed with the shader change reverted, so it guards the parity and does not show the rounding case); the rest is naming, named constants on both sides, files split one type each, and docs. On e27efe5: the Lavapipe look list (47113388661) andcargo test --release -p texturecraft-compose -p texturecraft-core --lib(47113393563): pass. On 01fbcf3: the Lavapipe look list (47117733252), compose + core lib (47117740225),--test it -- layers pattern_looksand--test session panic_hunt(47117746421) and the fork's full CI (fmt, layers, clippy-D warnings, tests, wasm; ubuntu and Windows, 47117752620): pass.ToneAndGraintest helper moves to its own file;docs/features.mdnames the new patterns; a new crash-input sweep,panic_hunt_pattern_looks, sends hostile values to every look control of every pattern. Fork's full CI on 478f77a (ubuntu and Windows, 47122384046): pass. Known and not changed here: dropdowns announce their value rather than their label to screen readers (an older widget, not this PR).cargo test --release -p texturecraft-composeon e1c7337 (47137664856) and the ui-eguifill_material_rowstests on b1012cb (47133132026): pass. On the final head e1c7337: the Lavapipe look list (47141343927), the fork's full CI (fmt, layers, clippy-D warnings, tests, wasm; ubuntu and Windows, 47141351781) and upstream's gate and parity checks on this PR (ubuntu-24.04 and windows-latest): pass.moss_matches_the_cpunow also checking three Skin pores settings, plus shader validation (47152742253), andcargo test --release -p texturecraft-compose --libwith the two new skin pores tests (47152749319): pass. On the same code before two comment and test-only edits (aa7abc7):cargo test --release -p texturecraft-compose -p texturecraft-core --lib(47151060397),xtask layersand--test session panic_hunt(47151068039): pass. The ui-egui filter in that run matched no tests, so the panel rows were not tested. On the final head 3687b9c: the fork's full CI (fmt, layers, clippy-D warnings, the whole workspace's tests, wasm; ubuntu and Windows, 47156510421), upstream's gate and parity checks on this PR (ubuntu-24.04 and windows-latest) and the ui-eguipattern_look_snapshotsset with the dark and light themes on a software GPU (47156516967): pass. The Memory section was measured before Skin pores came back.Optimization
Each row compares the PR code right before the optimization commits (478f77a) with the PR head (e1c7337) on the same workload; release build, GitHub ubuntu-24.04, 4 cores, median of 3 interleaved runs (GitHub run 47137658347). The panel row compares b87ee7b with the same code plus b1012cb (run 47133237775).
Output: the FNV hash of every output float matched before and after, for every look on both projections and for the four 4096² fills. Every run lies within 1.51% of its median. Tradeoff: Moss on triplanar is 3.01% slower. Triplanar has no period, so nothing is saved there and the change only alters codegen. It stays for the 10.36% on the tiling projections that fills use by default. The other looks, whose code is unchanged, moved within ±1.25%. The panel row is one
Vecper frame (24 B) and negligible against egui's ~25,000 allocations per frame. That change stays because the code is one line shorter.Rejected: wrapping Crumpled foil's 25 crease cells once per row and column (1% faster on a UV tile, 66% slower on triplanar; reverted in e1c7337). Rejected: reading a pattern's look and repeats from one lookup per texel (the flat looks went from 27-35 ns to 34-50 ns per texel).
Not measured: the GPU (the WGSL mirrors are unchanged), Windows and the browser. The 4096² fills call
pattern::proceduralfor every texel (rayon over rows), not the whole layer compositor.Memory
Drawing a look allocates nothing: 0 allocation calls over 5 × 65,536 texels for every look on both projections, in both versions. Across 300 warm frames the live heap grew by the same 8,960 B in every panel case (uniform source, a look without rows, Moss's three sliders, Smooth fur's choice row). The look rows keep nothing per frame. The GPU lowering appends a few words per look to the program's side table, which is rebuilt with the program. No leak was found, and nothing changed here.