build: baked lighting pass on kit_demo test map
Restructured kit_demo.tscn from linear demo to enclosed 5.12x5.12 room: - 2x2 floor tiles, 8 wall segments (including doorway + window) - Pillar at room center, beam overhead, accent panels - West/east walls rotated 90° Y for proper enclosure Lighting infrastructure: - WorldEnvironment with ambient light - DirectionalLight3D (sun key light, 45° angle, shadows enabled) - OmniLight3D (warm interior fill light) - ReflectionProbe (box projection, room-sized extents) - LightmapGI (Quality=High, bounces=3, denoiser=true) - Tool script prints bake status in editor Scripts: - bake_lighting.gd: validates LightmapGI config from CLI - validate_scene.gd: full scene validation (17 checks, all pass) Note: Godot 4.7 removed LightmapGI.bake() from runtime API. Baking must be done in the editor: select LightmapGI node > Bake Lightmap.
This commit is contained in:
@@ -1,44 +1,44 @@
|
||||
@tool
|
||||
extends Node3D
|
||||
|
||||
# Auto-bakes the LightmapGI when opened in the Godot editor.
|
||||
# Only runs in editor mode — does nothing in exported builds.
|
||||
#
|
||||
# Manual bake:
|
||||
# Open the scene in the Godot editor, select LightmapGI node,
|
||||
# click "Bake Lightmap" in the inspector at the top of the node's properties.
|
||||
# Provides baked lighting configuration guidance in the editor output panel.
|
||||
# LightmapGI baking is editor-only in Godot 4.7 — use the Bake button.
|
||||
#
|
||||
# This script provides feedback in the editor Output panel.
|
||||
|
||||
@tool
|
||||
# To bake:
|
||||
# 1. Open this scene in the Godot editor
|
||||
# 2. Select the LightmapGI node in the Scene dock
|
||||
# 3. Click "Bake Lightmap" in the Inspector toolbar (top of inspector)
|
||||
#
|
||||
# Or: Scene menu > Bake LightmapGI (Ctrl+Shift+B)
|
||||
|
||||
func _ready():
|
||||
if not Engine.is_editor_hint():
|
||||
# Not in editor — nothing to do for runtime
|
||||
return
|
||||
|
||||
# Check if we have a LightmapGI node
|
||||
var lightmap = _find_lightmap_gi()
|
||||
if not lightmap:
|
||||
push_error("KitDemo: No LightmapGI node found in scene!")
|
||||
return
|
||||
|
||||
# Check if already baked
|
||||
if lightmap.light_data != null:
|
||||
print("KitDemo: Lightmap already baked. To re-bake:")
|
||||
print(" Select LightmapGI node → 'Bake Lightmap' button in Inspector")
|
||||
print("KitDemo: Lightmap baked ✓")
|
||||
print(" To re-bake: Select LightmapGI → 'Bake Lightmap' button")
|
||||
return
|
||||
|
||||
# Not baked — offer to bake
|
||||
print("KitDemo: LightmapGI found but not baked.")
|
||||
print(" To bake: Select LightmapGI → click 'Bake Lightmap' at top of Inspector")
|
||||
print(" Or right-click LightmapGI node → 'Bake Lightmap'")
|
||||
print("KitDemo: LightmapGI configured but not baked.")
|
||||
print(" To bake: Select LightmapGI → 'Bake Lightmap' in Inspector")
|
||||
print(" Or: Scene menu → Bake LightmapGI (Ctrl+Shift+B)")
|
||||
print("")
|
||||
print(" LightmapGI settings:")
|
||||
print(" Bounces: ", lightmap.bounces)
|
||||
print(" Texel Scale: ", lightmap.texel_scale)
|
||||
print(" Texel Subdiv: ", lightmap.texel_subdiv)
|
||||
print(" Max Texture Size: ", lightmap.max_texture_size)
|
||||
print(" Interior: ", lightmap.interior)
|
||||
match lightmap.quality:
|
||||
0: print(" Quality: Low")
|
||||
1: print(" Quality: Medium")
|
||||
2: print(" Quality: High")
|
||||
3: print(" Quality: Ultra")
|
||||
print(" Bounces: ", lightmap.bounces)
|
||||
print(" Texel Scale: ", lightmap.texel_scale)
|
||||
print(" Max Texture Size: ", lightmap.max_texture_size)
|
||||
print(" Interior: ", lightmap.interior)
|
||||
print(" Denoiser: ", lightmap.is_using_denoiser())
|
||||
|
||||
|
||||
func _find_lightmap_gi() -> LightmapGI:
|
||||
|
||||
Reference in New Issue
Block a user