16e062c739
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.
49 lines
1.4 KiB
GDScript
49 lines
1.4 KiB
GDScript
@tool
|
|
extends Node3D
|
|
|
|
# Provides baked lighting configuration guidance in the editor output panel.
|
|
# LightmapGI baking is editor-only in Godot 4.7 — use the Bake button.
|
|
#
|
|
# 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():
|
|
return
|
|
|
|
var lightmap = _find_lightmap_gi()
|
|
if not lightmap:
|
|
push_error("KitDemo: No LightmapGI node found in scene!")
|
|
return
|
|
|
|
if lightmap.light_data != null:
|
|
print("KitDemo: Lightmap baked ✓")
|
|
print(" To re-bake: Select LightmapGI → 'Bake Lightmap' button")
|
|
return
|
|
|
|
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("")
|
|
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:
|
|
for child in get_children():
|
|
if child is LightmapGI:
|
|
return child
|
|
return null
|