Commit Graph
2653 Commits
Author SHA1 Message Date
minhero 9cdce36f9f Merge branch 'storytold:main' into fix/environment-light-no-effect-cast-shadows 2026-10-27 21:23:56 +01:00
aiongg dd12ed8f9c Merge pull request #2518 from Silvertree2010/perf/export-speed
Export: encode while the next batch renders, skip transparent pixels when compositing
2026-10-27 13:42:31 -04:00
NetterSilverandClaude Opus 5.5 94399e62ff Pin movie export bytes
H.264 and ProRes exports of a 60-frame comp (several render batches, a
rotating stroked ring, a fading solid at a fractional position, a
Screen-mode shape, 8 bpc) must keep the exact bytes main wrote before the
two previous commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 17:40:41 +01:00
NetterSilverandClaude Opus 5.5 db41fa7980 Skip transparent pixels and quantise while compositing
Much of a layer buffer is often transparent (a stroked ring, a glow-padded
text layer, a precomp canvas), yet every destination pixel sampled it
bilinearly, and 8/16 bpc comps then re-quantised the layer's whole rotated
bounding box.

- Bilinear warps skip 16x16 source tiles whose pixels (and a one-pixel
  apron) all have zero alpha: their samples are transparent and were never
  drawn.
- The fast affine warp reports the rectangle it changed and, given the
  comp's levels, quantises each pixel as it blends it, so draw_comp has
  nothing left to re-quantise for that layer. quantize_px moves to
  effectcraft-raster for this.
- quantize_rect skips runs of four all-zero (+0.0) pixels, which quantise
  to themselves.
- to_rgba8 / to_rgba8_over convert row by row instead of per 4-byte item.

Every pixel stays bit-identical: tests compare the warp against the
reference path, fused quantising against quantising after blending, and
the zero-run skip against per-pixel quantising.

With the previous commit, demo comp to H.264 (`cargo xtask bench --scenario
demo --format h264 --frames 300`, 11 interleaved runs on a 16-thread Ryzen):
wall 9.26 s -> 6.97 s median (-24.8%), 8.55 s -> 6.55 s min (-23.3%); CPU
time -23%. Output byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 17:40:41 +01:00
NetterSilverandClaude Opus 5.5 d8bca3cdd9 Overlap movie encoding with rendering
Movie exports (H.264, HEVC, AV1, ProRes, uncompressed) rendered a batch of
frames on every core, then encoded it frame by frame while the render
threads waited. Each batch now encodes on a pool shared by all exports while the
next batch renders (Cx::frames_beside). With deferred GPU readbacks, or
where no thread can be started (wasm without threads), the two still take
turns. A panicking encoder becomes an export error.

H.264 frames are converted to 4:2:0 on the render threads, per frame, instead
of on the encoder's critical path. The conversion reads 8-bit levels from a
table and rounds without a libm call; both give the same values as before
(tested against the previous formula).

Demo comp (1920x1080, 300 frames) to H.264 on a 16-thread Ryzen, export
wall time -6% (median of 7 interleaved runs); output byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 17:40:41 +01:00
aiongg bc4b48f67d fix(ui): dropdown menus grow back after a search with no matches (#2511)
* fix(ui-egui): craft_ui::ComboBox for every combo box, so open menus grow back (egui#5225)

Repins craft-libs to aiongg/craft-libs 60d60d48 (storytold main with the shared
dropdown) and bans egui::ComboBox in clippy.toml.

* fix(ui-egui): font menu under the font field is a craft_ui combo menu that grows back

The filter row is the menu's header and only the font list scrolls, so a search
that matched nothing grows the menu back when it is cleared.

* chore(deps): craft-libs 4d7b82f7 (dropdown fixes)

* chore(deps): craft-libs 92d392cf (#387 merged)

* chore(xtask): pdf-deps expects craft-libs 92d392cf
2026-10-27 10:27:52 -04:00
Z User a8cba23edc Review fixes: the environment shadow follows the tinted radiance (#2436)
dominant_direction weighted texels by their raw channel sum before the
light's colour tinted the radiance, so equally bright red and blue regions
on opposite sides cancelled to no sun and no key — while a red Environment
light's tint removed the blue contribution and left the scene lit
directionally red, with no shadow for its Cast Shadows to show. The tint
now weights the direction sum (a white light weights [1; 3], a coloured
one its normalised colour), so the sun and key are derived from the
radiance the light actually emits; add_environment computes the tint once,
before the direction pass, and reuses it for the texel tinting. An
achromatic image is unaffected (its weights scale uniformly), so the
default studio and white-lit scenes keep their shadows exactly.

Tests: opposed red and blue texels cancel to a white light but a red tint
points the sun straight at the red one (a blue tint, at the blue one); end
to end, a red Environment light over an image with equally bright red and
blue regions on exactly antipodal positions casts the shadow a white light
over the same image does not — and the shadow falls opposite the red
region, the side the tinted radiance comes from.
2026-10-27 14:11:55 +00:00
Z User eb34d10d21 Review fixes: a failed environment source lights nothing (#2436)
Two review points on the merge:

- env_pixels returned None both for an unconfigured light (no Source, no
  Environment Layer) and for a failed source (a deleted layer, missing
  footage, a failed decode), so a selected source that failed silently
  swapped in the default studio environment — relighting and reshadowing
  the scene behind the user's back. It now tells the three apart
  (EnvPixels::Absent/Image/Failed): only the unconfigured light uses the
  default; a failed source contributes nothing, exactly like a layer whose
  source fails renders nothing. The repair the user can act on stays where
  it already lives — missing footage is flagged on the item, with the
  relink commands to fix it.

- The docs claimed only a uniform image casts no shadow. A non-uniform one
  can be directionless too: opposing bright regions cancel, and anything
  under 1% directional is rejected. agents.md, architecture.md and the
  sun/dominant_direction doc comments now say an image without a
  sufficiently strong dominant direction.

Tests: an unreadable Environment Layer (auto-picked), an unreadable
selected Source and a deleted one all light nothing — pixel-equal to the
unlit render, no studio default, no default-environment shadow — while an
unconfigured light still lights; two equal bright spots at opposite
azimuths cancel to no sun and no key, and tilting the balance re-emerges
pointing at the brighter spot.
2026-10-27 12:33:46 +00:00
Z User 978ca419b9 Merge remote-tracking branch 'origin/main' into fix/environment-light-no-effect-cast-shadows 2026-10-27 08:54:33 +00:00
aiongg 01c904b041 Merge pull request #2491 from aiongg/layout
refactor: shared module layout (craft-contrib#20)
2026-10-26 21:30:46 -04:00
Minher0 743119d6e5 Give the Environment light After Effects' look (#2436)
The default studio environment's level-preserving mean of 1 acted like a
100% white Ambient light: with only the Environment light on, a white floor
rendered at full white (95% of the frame saturated) while its shadow core
went to pitch black — a fog over the scene, nothing like After Effects'
default. Three changes bring the look in line, CPU and GPU alike:

- The default environment is a dim studio now: a solid-angle-weighted mean
  of 0.3 (and a stronger key gradient), so a white floor reads a mid gray
  and the light's colour x intensity still scales the level.
- The shadow occludes only the image's directional (key) fraction of the
  light — |sum of dir x radiance| / sum of radiance, computed beside the
  dominant direction and carried in the scene — so the fill keeps shining
  inside the shadow: an area-light shadow, partial like After Effects'
  (a lone bright spot on black still shadows almost fully; a uniform image
  not at all).
- The environment shadow map's penumbra has a floor — eight output pixels,
  or four map texels where those are coarser — because the map covers the
  whole scene bounding sphere rather than the view, and its texels would
  otherwise stair-step the edge (all the more in a draft render's flat 512
  budget). Shadow Diffusion widens it further, as before.

Tests: the key fraction tracks directionality; the default keeps its dim
level, its direction and its key; the default and a bright key both shadow
the floor (the default partial, the key deep) with Cast Shadows off lit
everywhere; and the full look — a mid-gray lit floor (no fog), a partial
core, and a soft edge ramp in quality and draft renders alike.
2026-10-26 23:36:19 +00:00
skylar taylor-barrick cca8ce06f3 Merge pull request #2487 from storytold/fix/nextest-0.9.150
ci: require nextest 0.9.150
2026-10-26 17:34:58 -06:00
aiongg b7b75ed37a style: cargo fmt on the moved files 2026-10-26 21:54:30 +00:00
aiongg 3e38bd7349 refactor(pdf): split the PostScript interpreter ps.rs into ps/*.rs 2026-10-26 21:49:12 +00:00
aiongg 5cb742591c refactor(effects): split ocio.rs into ocio/*.rs 2026-10-26 21:49:12 +00:00
aiongg 13fe6e5c03 refactor(effects): split sim.rs into sim/*.rs 2026-10-26 21:49:12 +00:00
aiongg 67ef9ad93c refactor(effects): split sim2.rs into sim2/*.rs 2026-10-26 21:49:12 +00:00
aiongg b05467e47f refactor(effects): split generate3.rs into generate3/*.rs 2026-10-26 21:49:12 +00:00
aiongg f5f51f8db8 refactor(ui-egui): move viewer frame, geometry, gestures, shapes, tools and view parts to panels/viewer/*.rs 2026-10-26 21:49:12 +00:00
aiongg 9b52c71a71 refactor(ui-egui): move viewer tests to panels/viewer/tests.rs 2026-10-26 21:49:12 +00:00
aiongg 319d2cba3b refactor(ui-egui): move menu commands, dispatch, entries, shortcuts and the menu bar to menus/*.rs 2026-10-26 21:49:11 +00:00
aiongg 03f5ba581d refactor(ui-egui): move EffectcraftApp methods to app/*.rs 2026-10-26 21:49:11 +00:00
aiongg 0eea2d67ab refactor(ui-egui): move app constructors and eframe::App to app.rs, clock and hooks to their own files, screenshot and playback state to state.rs 2026-10-26 21:49:11 +00:00
aiongg da99df18b4 refactor(ui-egui): move lifecycle_tests to lifecycle_tests.rs 2026-10-26 21:49:11 +00:00
aiongg e59048107a refactor(ui-egui): move Effect Controls panel parts to panels/effect_controls/*.rs 2026-10-26 21:49:11 +00:00
aiongg 5c6375c7ea refactor(psd): move limits, model, parsing and pixel decoding out of lib.rs 2026-10-26 21:49:11 +00:00
aiongg 80453e8673 refactor(psd): move the test counters module to counters.rs 2026-10-26 21:49:11 +00:00
aiongg 55ab7b556c refactor(project): move settings, comp, layer, footage and item types out of lib.rs 2026-10-26 21:49:11 +00:00
aiongg cbce15f069 refactor(render): move footage, effect host, accelerators, options, pipeline, layers and frames out of lib.rs 2026-10-26 21:49:11 +00:00
aiongg 4a5562c35b refactor(engine): move layer commands to cmd/layer/*.rs 2026-10-26 21:49:11 +00:00
aiongg 770e30d3ed refactor(engine): move settings model, page types and schema to settings/prefs/*.rs 2026-10-26 21:49:11 +00:00
aiongg bba3291b24 refactor(engine): move Session methods to session/{dispatch,edit,comps,render}.rs 2026-10-26 21:49:11 +00:00
aiongg 2b4fcdd3db refactor(engine): move error, services, document state, event, fonts and Session methods out of lib.rs 2026-10-26 21:49:11 +00:00
aiongg d76cfc7c45 refactor(engine): move cmd.rs helpers to cmd/{schema,enabled,params}.rs 2026-10-26 21:49:11 +00:00
aiongg eea1f50cd3 refactor(engine): move guard, logging, perf, sysinfo, storage to system/ 2026-10-26 21:49:11 +00:00
aiongg a7660a1e37 refactor(engine): move jobs, offload, remote to background/ 2026-10-26 21:49:11 +00:00
aiongg 85e26db57d refactor(engine): move learn, templates, demo, links to home/ 2026-10-26 21:49:11 +00:00
aiongg 1c565ba2df refactor(engine): move psd_import, vector, xml_project to interchange/ 2026-10-26 21:49:11 +00:00
aiongg d6b53650db refactor(engine): move doc_path, footage_check, footage_reload, sequence, media_browser, media_cache to footage/ 2026-10-26 21:49:11 +00:00
aiongg 9991466ff1 refactor(engine): move prefs, session_settings, config, shortcuts, autosave to settings/ 2026-10-26 21:49:11 +00:00
aiongg 3b5e19027e refactor(engine): move tracking, camera_track, mask_track, warp, roto, models to analysis/ 2026-10-26 21:49:11 +00:00
aiongg 3559c9bb3d docs(gpu): name the moved test module in a comment 2026-10-26 21:49:11 +00:00
aiongg 03c6dfa7a9 refactor(model): move src/fbx_tests.rs to src/fbx/tests.rs 2026-10-26 21:49:11 +00:00
aiongg 140b8d911c refactor(psd): move tests_<topic>.rs files to src/tests/ 2026-10-26 21:49:11 +00:00
aiongg 576f1d1706 refactor(pdf): move loose test files to src/tests/ 2026-10-26 21:49:11 +00:00
aiongg 48253ff5e1 refactor(script): move loose test files to src/tests/ 2026-10-26 21:49:11 +00:00
aiongg 9526833a62 refactor(render): move loose test files to src/tests/ 2026-10-26 21:49:11 +00:00
aiongg 959322dc38 refactor(gpu): move loose test files to src/tests/ 2026-10-26 21:49:11 +00:00
aiongg 35e66b17a6 refactor(engine): move tests_<topic>.rs files to src/tests/, tests.rs content to tests/session.rs 2026-10-26 21:49:11 +00:00
aiongg bcf34a087c refactor(ui-egui): move src/workspace_state.rs tests to src/workspace_state/tests.rs 2026-10-26 21:49:11 +00:00