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 <noreply@anthropic.com>
This commit is contained in:
Leonid Pershin
2026-06-15 00:22:56 +03:00
co-authored by Claude Opus 4.8
parent d196437462
commit ccb7c960f9
2 changed files with 21 additions and 1 deletions
+10
View File
@@ -0,0 +1,10 @@
{
"Language": "ru",
"Fullscreen": false,
"VSync": true,
"Width": 1280,
"Height": 720,
"Volume": 1,
"UiScale": 1,
"DeveloperMode": true
}
+11 -1
View File
@@ -994,10 +994,20 @@ public sealed class WorldScene : Scene
return shore.ToArray(); return shore.ToArray();
} }
// Текущая сетка окклюдеров для лайтмапа: светонепроницаемый террейн (сейчас нет) + зрелые деревья. // Затеняют ли зрелые деревья землю. Сейчас выключено: одиночное дерево = 1 клетка-окклюдер, а спрайт
// кроны крупнее и смещён, плюс направленная тень тянется «хвостом» — на открытой почве это читается как
// странные оторванные пятна. Вернуть, когда у кроны будет настоящий многоклеточный след затенения.
private static readonly bool TreesCastShade = false;
// Сетка окклюдеров для лайтмапа: светонепроницаемый террейн (сейчас такого нет) + опц. зрелые деревья.
private bool[] BuildOccluders() private bool[] BuildOccluders()
{ {
Array.Copy(_cellOccluderBase, _cellOccluder, _cellOccluder.Length); Array.Copy(_cellOccluderBase, _cellOccluder, _cellOccluder.Length);
if (!TreesCastShade)
{
return _cellOccluder; // ровное освещение — без странных теней от отдельных деревьев
}
Store Store
.Query<PlantGrowth, Transform2D>() .Query<PlantGrowth, Transform2D>()
.ForEachEntity( .ForEachEntity(