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.
This commit is contained in:
Z User
2026-10-27 12:33:46 +00:00
parent 978ca419b9
commit eb34d10d21
4 changed files with 141 additions and 19 deletions
+8 -5
View File
@@ -215,12 +215,15 @@ Things that tripped up a long agent-driven session (a multi-scene 3D piece built
layer by layer id; with no source it uses the comp's Environment Layer (`layer.environment`),
or a default studio environment — bright above and toward the initial camera, dark below and
behind, at a dim 0.3 mean level — of the light's colour × intensity when there is none; either
way the light brightens the scene. It has `castsShadows`/`shadowDarkness`/`shadowDiffusion`
way the light brightens the scene. A selected Source or Environment Layer that fails to
render — a deleted layer, missing footage — lights nothing instead: the light never silently
falls back to the studio default. It has `castsShadows`/`shadowDarkness`/`shadowDiffusion`
like the other lights: Cast Shadows shades the scene from the image's dominant bright region
(the default environment's key, or a source image's brightest area; only a uniform image has
none, so it casts no shadow) — occluding only that key's share of the light, so the shadow
stays partial like After Effects' area-light shadows, and soft by default (a penumbra of at
least 8 pixels or four map texels, plus Shadow Diffusion). It only lights
(the default environment's key, or a source image's brightest area; an image without a
sufficiently strong dominant direction has none — a uniform one, or opposing bright regions
that cancel — so it casts no shadow) — occluding only that key's share of the light, so the
shadow stays partial like After Effects' area-light shadows, and soft by default (a penumbra
of at least 8 pixels or four map texels, plus Shadow Diffusion). It only lights
Advanced 3D comps, so creating one (or changing a light's type to Environment) switches a
Classic 3D comp to Advanced 3D
([#261](https://github.com/storytold/effectcraft/issues/261),
+6 -3
View File
@@ -163,10 +163,13 @@ camera, dark below and behind, at a dim 0.3 mean level — of the light's colour
when there is neither) is an equirectangular image (cosine irradiance map; roughness-indexed
mip chain with the split-sum environment BRDF fit), and percentage-closer-filtered shadow maps
(spot: perspective, parallel: orthographic over the scene, point: six cube faces, environment:
one orthographic from the image's dominant bright region — none only when the image is
directionless, as a uniform one is — occluding only the image's directional key fraction of
one orthographic from the image's dominant bright region — none only when the image lacks a
sufficiently strong dominant direction (a uniform one, or opposing bright regions that
cancel) — occluding only the image's directional key fraction of
the light, so the shadow stays partial like After Effects' area-light shadows, with a soft
default penumbra of at least eight pixels or four map texels). An Environment light only lights Advanced 3D comps,
default penumbra of at least eight pixels or four map texels). A Source or Environment Layer
that fails to render — a deleted layer, missing footage — lights nothing: no silent fallback
to the default studio environment. An Environment light only lights Advanced 3D comps,
so adding one (or changing a light's type to it) switches a Classic 3D comp to Advanced 3D,
as model layers do. Cards keep
Material Options (Accepts Lights/Shadows, Casts Shadows On/Only, Ambient, Diffuse, Specular);