From ccb7c960f9a74e82246a9a18afcf952e15ca912c Mon Sep 17 00:00:00 2001 From: Leonid Pershin Date: Mon, 15 Jun 2026 00:22:56 +0300 Subject: [PATCH] Disable tree light occlusion (fixes strange isolated shadows on open ground) A mature tree marked a single lightmap cell as an occluder (shaded to 35% + a directional sun-shadow tail up to 7 cells). With mountains gone, trees were the only occluders, so on open soil these showed up as strange dark blobs detached from the (larger, offset) tree sprite. Gated tree occlusion behind TreesCastShade (off) so the forest is evenly lit; the occluder infra stays for light-blocking terrain and re-enabling once tree canopies have a real multi-cell shade footprint. Trade-off: understory shade no longer dims growth under canopy (minor). Engine lighting constants are untouched (would need the submodule workflow). Build clean. Co-Authored-By: Claude Opus 4.8 --- settings.json | 10 ++++++++++ src/LittleSim/Scenes/WorldScene.cs | 12 +++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 settings.json diff --git a/settings.json b/settings.json new file mode 100644 index 0000000..edf9814 --- /dev/null +++ b/settings.json @@ -0,0 +1,10 @@ +{ + "Language": "ru", + "Fullscreen": false, + "VSync": true, + "Width": 1280, + "Height": 720, + "Volume": 1, + "UiScale": 1, + "DeveloperMode": true +} \ No newline at end of file diff --git a/src/LittleSim/Scenes/WorldScene.cs b/src/LittleSim/Scenes/WorldScene.cs index e939bed..7142043 100644 --- a/src/LittleSim/Scenes/WorldScene.cs +++ b/src/LittleSim/Scenes/WorldScene.cs @@ -994,10 +994,20 @@ public sealed class WorldScene : Scene return shore.ToArray(); } - // Текущая сетка окклюдеров для лайтмапа: светонепроницаемый террейн (сейчас нет) + зрелые деревья. + // Затеняют ли зрелые деревья землю. Сейчас выключено: одиночное дерево = 1 клетка-окклюдер, а спрайт + // кроны крупнее и смещён, плюс направленная тень тянется «хвостом» — на открытой почве это читается как + // странные оторванные пятна. Вернуть, когда у кроны будет настоящий многоклеточный след затенения. + private static readonly bool TreesCastShade = false; + + // Сетка окклюдеров для лайтмапа: светонепроницаемый террейн (сейчас такого нет) + опц. зрелые деревья. private bool[] BuildOccluders() { Array.Copy(_cellOccluderBase, _cellOccluder, _cellOccluder.Length); + if (!TreesCastShade) + { + return _cellOccluder; // ровное освещение — без странных теней от отдельных деревьев + } + Store .Query() .ForEachEntity(