Repository navigation
Conversation
…t 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.
…ps 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.
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
|
…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.
…y command and followed by the viewport and export textureSet.settings takes uvPadding (3d or 2d) as one undo step and textureSet.inspect reports it. 2D Space Neighbor is the padding we always had: each texel outside the UV islands repeats the nearest covered texel. 3D Space Neighbor continues the surface across UV seams: a texel just outside a seam takes the texel as far inside the seam's other island (UvSeam finds the edges two triangles share in 3D but not in UV space), up to 32 texels out, and falls back to the nearest covered texel elsewhere. Tangent-space normals always pad in 2D, since they turn with their island. New texture sets use 3D Space Neighbor; projects without the field keep 2D, so they open and export as before.
…y 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.
Rebornim
force-pushed
the
feat/texture-sets-pass
branch
3 times, most recently
from
November 26, 2026 23:12
99dbd21 to
358ae7c
Compare
…ange what the composite holds
textureSet.channel.format {channel, format} stores a channel in sRGB8, L8, RGB8, L16, RGB16, L16F,
RGB16F, L32F or RGB32F, as one undo step. The composite keeps 256 steps for 8-bit formats (sRGB8
spaced for gamma) and one grey value for L formats; 16-bit and float formats keep the tiles' 16 bits,
and the command says so for floats. Layer data keeps its precision, so a wider format brings back
what was painted.
Until a format is set, every channel keeps the 16 bits TextureCraft always stored (shown as RGB16 /
L16), so new and saved projects render as before; setting one channel's format keeps the others at
16 bits.
Rebornim
force-pushed
the
feat/texture-sets-pass
branch
from
November 26, 2026 23:12
358ae7c to
8a33d75
Compare
…xported, with inspect marking the ones the shader ignores
Rebornim
force-pushed
the
feat/texture-sets-pass
branch
from
November 26, 2026 23:42
801d829 to
81dc529
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: work in progress. One commit lands per item of #861; the unticked items below are still to build. The panel layout itself comes last, after the engine items.
Texture Set list and Texture Set Settings: the missing settings and controls, built to work the same from the panels and from automation
Closes #861.
What the user saw
The Texture Set list showed a row per set with an eye and a size, and the Texture Set Settings panel had a square size, a fixed "Main shader" text, a plain channel list and a mesh map list. Several settings the project file already stored (normal mixing, ambient occlusion mixing) could not be changed, and the viewport ignored them.
Checklist
One commit per item.
textureSet.settings normalMixing), reported bytextureSet.inspect; Replace keeps the height slope out of the viewport normal, the normal view and both path tracers (export already did this). Height still displaces.textureSet.settings aoMixing), reported bytextureSet.inspect; the viewport used to multiply the baked map in whatever the setting said (export already followed it). Changing it, or undoing that, resends the set's textures.textureSet.settings heightToNormal), reported bytextureSet.inspect. Export always used Sobel and the viewport and path tracers always used the plain neighbour difference; all four now follow the set's method. Projects without the field stay Smooth, so exports are unchanged and the viewport normal now matches them (a slight softening of single-texel height detail in the viewport of old projects).textureSet.settings uvPadding 3d|2d), reported bytextureSet.inspect, followed by the viewport and export. 3D continues the surface across UV seams; tangent-space normals always pad in 2D. New sets use 3D (the reference default); projects without the field keep 2D, the padding they were made with, so they open and export as before.textureSet.resolutiontakes an optionalheight(default: square),textureSet.inspectreportsheight,export.planreportsheightandsourceHeight. Paint resamples to the new shape; the viewport, padding, Mirror and Transform filters, mask export and file export follow both sides (the export size option sets the width, the height keeps the set's shape). A set whose UV tiles have their own sizes stays square (per-tile sizes are square, as in the reference), and the command says so. Projects without the field open square, as before. The width / lock / height controls come with the settings layout; until then picking a size in the panel keeps the set's shape.textureSet.channel.format {channel, format}(sRGB8, L8, RGB8, L16, RGB16, L16F, RGB16F, L32F, RGB32F, one undo step), reported bytextureSet.inspect. 8-bit formats keep 256 steps of the channel's composite (sRGB8 spaced for gamma, so darks keep more), L formats keep one grey value; 16-bit and float formats keep the 16 bits every channel had. The float formats are no wider than that yet, and values stay in the channel's range: they are offered so a set can name the format it exports for, and the command result does not pretend otherwise. Layer data keeps its precision, so going back to a wider format brings back what was painted. Until a format is set, every channel keeps the 16 bits TextureCraft always stored, shown as RGB16 / L16, in new and saved projects alike, so nothing renders differently until someone picks a format; setting one channel's format keeps the others at 16 bits. (The reference starts Base color at sRGB8 and scalars at L8; starting new sets there would quietly drop precision everyone has today, so 8 bits is a choice here, not the default.) The format picker comes with the settings layout.What changed
TextureSet::height_in_normalis the one rule for normal mixing; export, the raster shader (disp.w, previously unused) and the path tracers (TraceSet::height_in_normal) read it.compose::display::tile_bytestakes the set'sAoMixing;Session::invalidate_changedresends a set whose AO mixing an undo or redo changed. Both fields already had serde defaults (Combine, Multiply), so old projects open and render as before.HeightToNormalMethod::slopeis the one height slope filter;mesh.wgsl(uv_rotation.w, previously unused) andtrace.wgsl(bit 8 of a set's placeholder mask word) mirror it.geom::UvSeam::of_materialfinds a material's UV seams (edges two triangles share in 3D but not in UV space);compose::PaddingMapsholds a set's padding map plus a 2D one for tangent-space normals, used bypad_tiles(viewport, rebuilt bysync_cacheswhen the mode changes) and export (ExportInput::seams).TextureSet::formats()gives each channel's stored format (format_precision, false until a format is set, maps 8-bit labels to 16-bit);compose::channel_store::storedapplies it wherecomposite_blockencodes a texel, andSetCache::formatsrecomposites a set whose formats change (also on undo).TextureSet::resolution_height(None = square) withheight(),set_size()andblock_size();size()followsblock_size(). Export's sampler, padding and diffusion take the block's two sides; the height slope scales each axis by its own side, which is the old value on square sets.Tests
set_cmds::tests::channel_format_changes_what_the_viewport_holds_and_undoeschannel_store::tests(8-bit steps, sRGB8 darks, grey formats, signed channels)project::tests::sets_keep_16_bits_until_a_format_is_set_also_in_older_filesset_cmds::tests::normal_mixing_replace_keeps_height_out_of_the_normal_and_undoesset_cmds::tests::ao_mixing_resends_the_set_to_the_viewport_and_undoesit::bake_resolution(the viewport's occlusion texture with mixing None vs Multiply)set_cmds::tests::height_to_normal_method_is_set_by_command_and_undoesexport::tests::height_to_normal_method_smooth_reaches_the_diagonal_neighboursset_cmds::tests::uv_padding_rebuilds_the_viewport_padding_and_undoesseam_padding::tests::padding_past_a_seam_continues_from_its_other_side_and_normals_stay_flatexport::tests::padding_past_a_seam_takes_the_far_island_except_for_normalsuv_seam::tests::a_closed_mesh_has_seams_and_a_single_island_has_noneproject::tests::non_square_sets_are_wider_than_tall_per_block_and_stay_square_with_tile_sizesuv_tile_cmds::tests::non_square_sets_keep_their_paint_export_wide_tiles_and_refuse_tile_sizeseval::tests::a_mirror_on_a_wide_set_reflects_across_its_own_heightWhat ran
cargo check --workspace --tests(local, Rust 1.95.0).cargo test -p texturecraft-engine --lib set_cmds,-p texturecraft-engine --test it bake_resolution,-p texturecraft-compose --lib display: passed (runs 45901291322, 45901294088, 45901297355 on Rebornim/texturecraft-builds).cargo test -p texturecraft-engine --lib set_cmds,-p texturecraft-formats --lib export, and-p texturecraft-render --libon a software GPU (the mesh and trace shaders compile there): passed (runs 45902594791, 45902598062, 45902675420).cargo fmt --all --checkandcargo clippy --all-targets -D warningson core, render, formats, engine, automation, ui-egui (Rust 1.96.0, run 45903224104): fmt clean; clippy's only finding isnonminimal_boolatcrates/ui-egui/src/settings_window.rs:159, which is onmaintoo (not this PR), so ui-egui's test targets were not linted in that run.cargo test -p texturecraft-geom -p texturecraft-compose --lib,-p texturecraft-formats --lib,-p texturecraft-engine(whole crate, includingpanic_hunt): passed (runs 45904820040, 45904822799, 45904826852);cargo fmt --all --checkandcargo clippy --all-targets -D warningson geom, compose, core, formats, engine: clean (run 45904909453).cargo test -p texturecraft-core -p texturecraft-compose -p texturecraft-formats --liband-p texturecraft-engine(whole crate, includingpanic_hunt): passed (runs 45906991594, 45906995061);cargo fmt --all --checkclean;cargo clippy --all-targets -D warningsstopped atsettings_window.rs:159(nonminimal_bool), which is onmainalready (fd39434) and not part of this PR, so clippy on ui-egui did not finish, and no other crate reported anything (run 45906998608);cargo xtask layers: passed (run 45907495768).cargo test -p texturecraft-core -p texturecraft-compose -p texturecraft-formats --liband-p texturecraft-engine(whole crate, includingpanic_hunt): passed (runs 45909563553, 45909574976);cargo clippy -p texturecraft-core -p texturecraft-compose -p texturecraft-engine --all-targets -D warnings: clean (run 45908719661, whose one fmt finding, module order in compose's lib.rs, is fixed in the commit).