mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-31 05:27:08 -06:00
Three small fixes from the review of the shadow commit: - light_settings switched a Classic 3D comp to Advanced 3D whenever the edited light was an Environment light (the resulting kind), so editing the intensity of one in a comp the user had switched back to Classic 3D dragged the renderer back. The switch now happens only on the non-Environment to Environment transition (the sources before and after), matching the docs; ordinary edits leave the renderer to the user. - dominant_direction's thresholds let NaN through (every NaN comparison is false): a NaN or infinite texel produced a NaN sun direction and NaN shading with it. A non-finite weight or length now returns no direction — garbage casts no shadow. - add_environment walked the full-resolution image for the dominant direction even when the light casts no shadows, where nothing reads it. Only a shadow-casting light pays for the pass now. Tests: editing an existing Environment light in a Classic 3D comp keeps the renderer and stays toast-silent; a NaN and an infinite environment image yield no sun direction.