From 240bad9af1774264f1ea619618a52b24cbb8a60c Mon Sep 17 00:00:00 2001 From: Zwitschi Date: Sat, 7 Nov 2026 18:08:49 +0100 Subject: [PATCH] lighting: dynamic-only lights so no lighting build is required The editor warned 'LIGHTING NEEDS TO BE REBUILT' (Build Lighting Only / BuildLighting) because the sun and sky were Stationary with no baked lightmap. The demo is a fixed daytime scene lit entirely dynamically, so: - Config/DefaultEngine.ini: r.AllowStaticLighting=False - nothing to build. - DemoMap + ReviewMap builders: sun, sky light, height fog and the staged mesh components are set to ComponentMobility.MOVABLE. Also clears the Android File Server SecurityToken in DefaultEngine.ini: the plugin is disabled and excluded from shipping, and the value is a credential that must not be committed. All 14 screenshots re-rendered; no lighting warnings in the build or run logs. --- Game/GigLine/Config/DefaultEngine.ini | 11 ++++++-- Game/GigLine/Content/Hollywood/DemoMap.umap | 4 +-- Game/GigLine/Content/Test/ReviewMap.umap | 4 +-- MEMORY.md | 2 ++ Screenshots/demo/review-demo-crossing.png | 4 +-- .../demo/review-demo-north-buildings.png | 4 +-- Screenshots/demo/review-demo-spawn-view.png | 4 +-- Screenshots/demo/review-demo-street-level.png | 4 +-- Screenshots/review-character.png | 4 +-- Screenshots/review-ground-contact.png | 4 +-- Screenshots/review-hero-facade-front.png | 4 +-- Screenshots/review-hero-facade-oblique.png | 4 +-- Screenshots/review-hero-portals.png | 4 +-- Screenshots/review-npc-prefab.png | 4 +-- Screenshots/review-overview.png | 4 +-- Screenshots/review-player-placement.png | 4 +-- Screenshots/review-scale-cubes.png | 4 +-- Screenshots/review-shadow-compare.png | 4 +-- Tools/ue_build_demo_map.py | 18 +++++++++++-- Tools/ue_build_review_map.py | 27 +++++++++++++++---- 20 files changed, 81 insertions(+), 41 deletions(-) diff --git a/Game/GigLine/Config/DefaultEngine.ini b/Game/GigLine/Config/DefaultEngine.ini index 22075f3..80015db 100644 --- a/Game/GigLine/Config/DefaultEngine.ini +++ b/Game/GigLine/Config/DefaultEngine.ini @@ -2,7 +2,12 @@ GlobalDefaultGameMode="/Script/GigLine.GigLineGameModeBase" [/Script/Engine.RendererSettings] -; Leave defaults for 0.1.0; quality preset is documented at release time. +; Dynamic-only lighting. With static lighting allowed, the stationary sun and +; sky light demanded a baked lighting build and the editor warned +; "LIGHTING NEEDS TO BE REBUILT" (Build Lighting Only / BuildLighting) on every +; map. The demo is a fixed daytime scene lit entirely dynamically, so disable +; static lighting outright — nothing to build, no warning. +r.AllowStaticLighting=False [URL] GameName=GigLine @@ -10,7 +15,9 @@ GameName=GigLine [/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings] bEnablePlugin=False bAllowNetworkConnection=False -SecurityToken=01A1B5CDAFDE7AAEB5DFBB48880D25DE +; SecurityToken intentionally empty: it is a credential, and the plugin is +; disabled and excluded from shipping. Never commit a real token here. +SecurityToken= bIncludeInShipping=False bAllowExternalStartInShipping=False bCompileAFSProject=False diff --git a/Game/GigLine/Content/Hollywood/DemoMap.umap b/Game/GigLine/Content/Hollywood/DemoMap.umap index adfeb64..b3426fd 100644 --- a/Game/GigLine/Content/Hollywood/DemoMap.umap +++ b/Game/GigLine/Content/Hollywood/DemoMap.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3f3925238751bd1cfd9b145a7bc3a12945392434b7ea3f345bc822116f4f5a51 -size 44553 +oid sha256:db7e2632a0e5c75d7722f0aab9f727a931fed942c0ee870892da02c2e4c79710 +size 44952 diff --git a/Game/GigLine/Content/Test/ReviewMap.umap b/Game/GigLine/Content/Test/ReviewMap.umap index 1f0d7e8..5fee868 100644 --- a/Game/GigLine/Content/Test/ReviewMap.umap +++ b/Game/GigLine/Content/Test/ReviewMap.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:18fafef3a73b195fdbc21ff1c6e9a8d55f691ae3626e2f588d64871554297b31 -size 28613 +oid sha256:ed3baf3965562bea42fd99f8a47438491d86b383a77a0620c592a5964197c198 +size 28715 diff --git a/MEMORY.md b/MEMORY.md index e19febc..ba707ff 100644 --- a/MEMORY.md +++ b/MEMORY.md @@ -183,3 +183,5 @@ Scope: facts and traps that cost time to establish. Planned work lives in [TODO. - **One band per object loses geometry downstream.** `crossing_band()` created `Crossing_Markings` each call, so Blender renamed the second and third to `.001`/`.002`; `site_assembly.py` appends by exact name, so only one crossing ever reached the game. Build all bands into a single mesh instead of one object per band. - **Street arc length -> UE X:** s=0 is the west end of the block (UE X −27966 cm) and s increases eastward, so the designated mid-block crossing at s=130.1 m is UE X ≈ −14956, not the −24291 used by an earlier camera (that is the s=36.6 crossing). - **Camera placement in the demo map needs the mesh bounds, not intuition.** The hero façade body spans UE Y −1457..−200, so a "street level" camera at Y −400 is *inside* the building and renders its unlit back face. Read `get_bounding_box()` on the staged meshes before choosing a camera. +- **"LIGHTING NEEDS TO BE REBUILT" (Build Lighting Only / `BuildLighting`) appears whenever a map has Stationary/Static lights and no baked lightmap.** For a fully dynamic scene the clean fix is `r.AllowStaticLighting=False` in `Config/DefaultEngine.ini` plus `set_mobility(ComponentMobility.MOVABLE)` on the directional light, sky light and height fog (and MOVABLE on the staged mesh components). Nothing to build, warning gone. Note the cvar is read at startup, so each new commandlet/game run picks it up. +- The Android File Server `SecurityToken` kept reappearing in `Config/DefaultEngine.ini`; the plugin is disabled and excluded from shipping, so the value is cleared and must stay empty — it is a credential and must not be committed. diff --git a/Screenshots/demo/review-demo-crossing.png b/Screenshots/demo/review-demo-crossing.png index f9523d8..ae841f7 100644 --- a/Screenshots/demo/review-demo-crossing.png +++ b/Screenshots/demo/review-demo-crossing.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:90b3f9e5aa44b2bd5f446c0532e1ecc7947e005188e909748f1d6520abf1648d -size 1568849 +oid sha256:7f70435845fa5e34a04ba2e3ca193b54db655791076e8cb80d88546ada3af143 +size 1570518 diff --git a/Screenshots/demo/review-demo-north-buildings.png b/Screenshots/demo/review-demo-north-buildings.png index 4ffe045..515855f 100644 --- a/Screenshots/demo/review-demo-north-buildings.png +++ b/Screenshots/demo/review-demo-north-buildings.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1b3eb0d7831dcd3fe83cf2e0b65dc6b8f20b21ebf3d03ae538ad60565f5a5037 -size 1390196 +oid sha256:807dc31930ffcbcf3c2449f34eb731a7694c8142afe0252666425cb7d385caa8 +size 1536544 diff --git a/Screenshots/demo/review-demo-spawn-view.png b/Screenshots/demo/review-demo-spawn-view.png index 9635de1..81376d8 100644 --- a/Screenshots/demo/review-demo-spawn-view.png +++ b/Screenshots/demo/review-demo-spawn-view.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a9106c7c915119e4df4bedc22404028ed060a71e309ff1662931890b55469644 -size 1573928 +oid sha256:5970fb86c28990883a15745305f1a1ca4419b8c5a450dbe3fb39e6f24b19f59d +size 1587231 diff --git a/Screenshots/demo/review-demo-street-level.png b/Screenshots/demo/review-demo-street-level.png index 22d99fc..6c21f6a 100644 --- a/Screenshots/demo/review-demo-street-level.png +++ b/Screenshots/demo/review-demo-street-level.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fd5e854bfce63b51d573817bd86ca897b06cbf231b02c0302f7e99b1bb7c6870 -size 1783060 +oid sha256:0214e624ebacd17c430cada10a4446c1977a17a380d54e720a48bbb8babc5ac0 +size 1763767 diff --git a/Screenshots/review-character.png b/Screenshots/review-character.png index 7aed33b..7fb4c72 100644 --- a/Screenshots/review-character.png +++ b/Screenshots/review-character.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f314dcc5211758e70c0fde67ece08eaeef863cc27596eefb15fd706ed20d6ce8 -size 2476490 +oid sha256:806dba0d9bf0ee00d4174d0834babcd2bfa83b4c2132955565ff2759b555b337 +size 2519676 diff --git a/Screenshots/review-ground-contact.png b/Screenshots/review-ground-contact.png index 04fba20..23b215c 100644 --- a/Screenshots/review-ground-contact.png +++ b/Screenshots/review-ground-contact.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ef80c5c6eb63b79e97ba41d8a79793b2215b71c854966c093904016aa3eb47da -size 1793304 +oid sha256:c7b403af87a3f50a394bcfd7d997b714553c1580912cffa5bc868b4503104d01 +size 1729770 diff --git a/Screenshots/review-hero-facade-front.png b/Screenshots/review-hero-facade-front.png index 24fbb72..f73dbf5 100644 --- a/Screenshots/review-hero-facade-front.png +++ b/Screenshots/review-hero-facade-front.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6a6b384911d4f07d1e165545ee6c78338869df8a8d30231d1194e7b89a6349df -size 2051886 +oid sha256:da3ac44e5fd1bf0f9c0675e7582014b871f5ec2ea74543fed201d686c1d307dd +size 2075675 diff --git a/Screenshots/review-hero-facade-oblique.png b/Screenshots/review-hero-facade-oblique.png index 1da0b73..1f39b90 100644 --- a/Screenshots/review-hero-facade-oblique.png +++ b/Screenshots/review-hero-facade-oblique.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9d47147cd5b8c4959ce61da5b7ea72c6bf4dab21bebfd9a2426809f873e72938 -size 1932092 +oid sha256:81cab701b528d7ad97225384d966c8282c6e2b3c22ad90e37a3fac4b72473ca5 +size 1939088 diff --git a/Screenshots/review-hero-portals.png b/Screenshots/review-hero-portals.png index 87dcc4a..6863b08 100644 --- a/Screenshots/review-hero-portals.png +++ b/Screenshots/review-hero-portals.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ce2496abd2848ae5d73c17e4eb7c2ccb9bd39437f0f47ee1f2e81b75a64974c6 -size 1778660 +oid sha256:29a42347337c797a696b795f594d7eebc58c51a3258cd1726bce0475d3b3ebcc +size 1757866 diff --git a/Screenshots/review-npc-prefab.png b/Screenshots/review-npc-prefab.png index 3003951..d874e8d 100644 --- a/Screenshots/review-npc-prefab.png +++ b/Screenshots/review-npc-prefab.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8de11af89103a6ab42531adbcab2985e29f239e0a2122972d1308d1ca98edba3 -size 1721002 +oid sha256:1cbd2acd364eb35a5802393d5d3f94036948a054020c2c9e967f5c2153ee3792 +size 1722019 diff --git a/Screenshots/review-overview.png b/Screenshots/review-overview.png index 76dcd69..7839f02 100644 --- a/Screenshots/review-overview.png +++ b/Screenshots/review-overview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:50c31d72e9149efbd61e4dd454f2671342162a1a3aa58140c1427d523e2091a5 -size 2608909 +oid sha256:91b3c428b7118df3ff9d11d0b114130b7380c6fa49834f8bac6eb9747a9e5f15 +size 3164110 diff --git a/Screenshots/review-player-placement.png b/Screenshots/review-player-placement.png index d86b002..3ff2e11 100644 --- a/Screenshots/review-player-placement.png +++ b/Screenshots/review-player-placement.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4c21d2f5f92612cca6963b3217ae9f2ebf45c94837a09b6f0e8398622a9bc040 -size 1964636 +oid sha256:836ddf77b91575b61eb54d11981a0d6b8fad6e0ff82e54143d863e48b906921d +size 2009205 diff --git a/Screenshots/review-scale-cubes.png b/Screenshots/review-scale-cubes.png index 9ca844c..ce4f357 100644 --- a/Screenshots/review-scale-cubes.png +++ b/Screenshots/review-scale-cubes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:daad42906dd5ee802051d09ca813a293a4b73927dd68adc876fc6612ce8ef951 -size 1902016 +oid sha256:07f91984000f49c7960e87829fac422351942ddda08b56f47a2addeb428f08f3 +size 2027852 diff --git a/Screenshots/review-shadow-compare.png b/Screenshots/review-shadow-compare.png index f5555bc..9aeac8d 100644 --- a/Screenshots/review-shadow-compare.png +++ b/Screenshots/review-shadow-compare.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:79123a8f37fd95b617decda35469f7c629f89bbe5f64c063f8b087b27f2615ce -size 1731317 +oid sha256:aa8b21c253851de43194647be76a5c8bd69fdda315a1f163f7f16566c45e1a62 +size 1684025 diff --git a/Tools/ue_build_demo_map.py b/Tools/ue_build_demo_map.py index cbbde45..2883931 100644 --- a/Tools/ue_build_demo_map.py +++ b/Tools/ue_build_demo_map.py @@ -123,6 +123,12 @@ def build(): comp.set_editor_property(prop, value) except Exception as exc: # noqa: BLE001 log(f"sun.{prop} not set: {exc!r}") + # Movable: static lighting is disabled (r.AllowStaticLighting=False), + # so nothing needs a lighting build. + try: + comp.set_mobility(unreal.ComponentMobility.MOVABLE) + except Exception as exc: # noqa: BLE001 + log(f"sun mobility not set: {exc!r}") log("staged: Demo_Sun (pitch -50, yaw 120, intensity 4, warm)") sky = spawn(unreal.SkyLight, unreal.Vector(0, 0, 2000), "Demo_SkyLight") @@ -134,6 +140,10 @@ def build(): comp.set_editor_property(prop, value) except Exception as exc: # noqa: BLE001 log(f"sky.{prop} not set: {exc!r}") + try: + comp.set_mobility(unreal.ComponentMobility.MOVABLE) + except Exception as exc: # noqa: BLE001 + log(f"sky mobility not set: {exc!r}") log("staged: Demo_SkyLight (intensity 2.6, real-time capture)") spawn(unreal.SkyAtmosphere, unreal.Vector(0, 0, 0), "Demo_Sky") @@ -152,6 +162,10 @@ def build(): comp.set_editor_property(prop, value) except Exception as exc: # noqa: BLE001 log(f"fog.{prop} not set: {exc!r}") + try: + comp.set_mobility(unreal.ComponentMobility.MOVABLE) + except Exception as exc: # noqa: BLE001 + log(f"fog mobility not set: {exc!r}") log("staged: Demo_Fog (height fog, density 0.008)") # Fixed exposure: without this the same road renders washed out or black @@ -185,7 +199,7 @@ def build(): actor = spawn(unreal.StaticMeshActor, unreal.Vector(-10722.5, -1443.0, 0.0), "Hero_Facade") if actor: actor.static_mesh_component.set_static_mesh(hero) - actor.static_mesh_component.set_mobility(unreal.ComponentMobility.STATIC) + actor.static_mesh_component.set_mobility(unreal.ComponentMobility.MOVABLE) log("staged: Hero_Facade at the building line") else: log("MISSING: SM_HeroFacade — run Tools/ue_hero_facade_import.py") @@ -212,7 +226,7 @@ def build(): actor = spawn(unreal.StaticMeshActor, unreal.Vector(0, 0, 0), f"Demo_{name}") if actor: actor.static_mesh_component.set_static_mesh(mesh) - actor.static_mesh_component.set_mobility(unreal.ComponentMobility.STATIC) + actor.static_mesh_component.set_mobility(unreal.ComponentMobility.MOVABLE) mat = ensure_material(mat_name, rgb) if mat: actor.static_mesh_component.set_material(0, mat) diff --git a/Tools/ue_build_review_map.py b/Tools/ue_build_review_map.py index edd3ce9..55a9baf 100644 --- a/Tools/ue_build_review_map.py +++ b/Tools/ue_build_review_map.py @@ -96,11 +96,28 @@ try: else: log("floor spawn failed") - if spawn(unreal.DirectionalLight, unreal.Vector(0, 0, 900), "RenderKeyLight", - rot=unreal.Rotator(pitch=-38.0, yaw=35.0, roll=0.0)): - log("staged: DirectionalLight") - if spawn(unreal.SkyLight, unreal.Vector(0, 0, 1200), "RenderFillSky"): - log("staged: SkyLight") + # Lights are Movable and the project disables static lighting + # (r.AllowStaticLighting=False), so no baked lighting build is needed and + # the editor stops asking to rebuild lighting. + sun = spawn(unreal.DirectionalLight, unreal.Vector(0, 0, 900), "RenderKeyLight", + rot=unreal.Rotator(pitch=-38.0, yaw=35.0, roll=0.0)) + if sun: + comp = sun.get_component_by_class(unreal.DirectionalLightComponent) + if comp: + try: + comp.set_mobility(unreal.ComponentMobility.MOVABLE) + except Exception as exc: # noqa: BLE001 + log(f"key light mobility not set: {exc!r}") + log("staged: DirectionalLight (movable)") + sky = spawn(unreal.SkyLight, unreal.Vector(0, 0, 1200), "RenderFillSky") + if sky: + comp = sky.get_component_by_class(unreal.SkyLightComponent) + if comp: + try: + comp.set_mobility(unreal.ComponentMobility.MOVABLE) + except Exception as exc: # noqa: BLE001 + log(f"fill sky mobility not set: {exc!r}") + log("staged: SkyLight (movable)") if spawn(unreal.SkyAtmosphere, unreal.Vector(0, 0, 0), "RenderSky"): log("staged: SkyAtmosphere")