[gd_scene load_steps=21 format=3]

; === External Resources (modular kit pieces) ===
[ext_resource type="PackedScene" path="res://assets/scenes/modular/wall_straight_01.tscn" id="1"]
[ext_resource type="PackedScene" path="res://assets/scenes/modular/wall_corner_01.tscn" id="3"]
[ext_resource type="PackedScene" path="res://assets/scenes/modular/wall_doorway_01.tscn" id="4"]
[ext_resource type="PackedScene" path="res://assets/scenes/modular/wall_window_01.tscn" id="5"]
[ext_resource type="PackedScene" path="res://assets/scenes/modular/wall_endcap_01.tscn" id="6"]
[ext_resource type="PackedScene" path="res://assets/scenes/modular/floor_tile_01.tscn" id="7"]
[ext_resource type="PackedScene" path="res://assets/scenes/modular/floor_tile_ceramic_01.tscn" id="9"]
[ext_resource type="PackedScene" path="res://assets/scenes/modular/pillar_01.tscn" id="11"]
[ext_resource type="PackedScene" path="res://assets/scenes/modular/beam_01.tscn" id="13"]
[ext_resource type="PackedScene" path="res://assets/scenes/modular/accent_blue_panel.tscn" id="15"]
[ext_resource type="PackedScene" path="res://assets/scenes/modular/accent_red_panel.tscn" id="17"]

; === External Resources (materials) ===
[ext_resource type="Material" path="res://assets/materials/wall_concrete_01.tres" id="2"]
[ext_resource type="Material" path="res://assets/materials/floor_concrete_01.tres" id="8"]
[ext_resource type="Material" path="res://assets/materials/floor_tile_01.tres" id="10"]
[ext_resource type="Material" path="res://assets/materials/wall_concrete_02.tres" id="12"]
[ext_resource type="Material" path="res://assets/materials/metal_structural_01.tres" id="14"]
[ext_resource type="Material" path="res://assets/materials/accent_team_blue.tres" id="16"]
[ext_resource type="Material" path="res://assets/materials/accent_team_red.tres" id="18"]
; === Script ===
[ext_resource type="Script" path="res://assets/scenes/modular/kit_demo.gd" id="19"]

; === Subresources ===
[sub_resource type="Environment" id="Env"]
background_mode = 0
tonemap_mode = 0
glow_enabled = false
ambient_light_color = Color(0.25, 0.25, 0.3, 1.0)
ambient_light_energy = 0.4
ambient_light_sky_contribution = 0.0

; === Scene Root ===
[node name="KitDemo" type="Node3D"]
script = ExtResource("19")

; ============ FLOOR ============
; 2x2 grid of floor tiles (5.12 x 5.12)
[node name="FloorNW" type="Node3D" parent="."]
instance = ExtResource("7")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.28, 0, -1.28)

[node name="FloorNE" type="Node3D" parent="."]
instance = ExtResource("7")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.28, 0, -1.28)

[node name="FloorSW" type="Node3D" parent="."]
instance = ExtResource("9")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.28, 0, 1.28)

[node name="FloorSE" type="Node3D" parent="."]
instance = ExtResource("7")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.28, 0, 1.28)

; ============ WALLS ============

; --- South Wall (Z=2.56, along X from -2.56 to +2.56) ---
; Straight segment left of doorway
[node name="SouthWall" type="Node3D" parent="."]
instance = ExtResource("1")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.28, 0, 2.56)

; Doorway segment right
[node name="SouthDoorway" type="Node3D" parent="."]
instance = ExtResource("4")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.28, 0, 2.56)

; --- North Wall (Z=-2.56, along X from -2.56 to +2.56) ---
; Window segment left
[node name="NorthWindow" type="Node3D" parent="."]
instance = ExtResource("5")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.28, 0, -2.56)

; Straight segment right
[node name="NorthWall" type="Node3D" parent="."]
instance = ExtResource("1")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.28, 0, -2.56)

; --- West Wall (X=-2.56, along Z from -2.56 to +2.56) ---
; Rotated 90° Y so width runs along Z instead of X
; Basis: local X → global -Z, local Z → global X
[node name="WestLower" type="Node3D" parent="."]
instance = ExtResource("1")
transform = Transform3D(0, 0, -1, 0, 1, 0, 1, 0, 0, -2.56, 0, -1.28)

[node name="WestUpper" type="Node3D" parent="."]
instance = ExtResource("1")
transform = Transform3D(0, 0, -1, 0, 1, 0, 1, 0, 0, -2.56, 0, 1.28)

; --- East Wall (X=2.56, along Z from -2.56 to +2.56) ---
; Rotated 90° Y so width runs along Z, thickness along -X
[node name="EastLower" type="Node3D" parent="."]
instance = ExtResource("1")
transform = Transform3D(0, 0, 1, 0, 1, 0, -1, 0, 0, 2.56, 0, -1.28)

[node name="EastUpper" type="Node3D" parent="."]
instance = ExtResource("1")
transform = Transform3D(0, 0, 1, 0, 1, 0, -1, 0, 0, 2.56, 0, 1.28)

; ============ INTERIOR ============

; Pillar at room center
[node name="Pillar" type="Node3D" parent="."]
instance = ExtResource("11")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)

; Beam overhead spanning the room
[node name="Beam" type="Node3D" parent="."]
instance = ExtResource("13")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.40, 0)

; Accent red panel on south wall straight segment
[node name="AccentRed" type="Node3D" parent="."]
instance = ExtResource("17")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.28, 1.28, 2.52)

; Accent blue panel on east wall upper segment
[node name="AccentBlue" type="Node3D" parent="."]
instance = ExtResource("15")
transform = Transform3D(0, 0, 1, 0, 1, 0, -1, 0, 0, 2.52, 1.28, 0)

; ============ LIGHTING ============

; --- WorldEnvironment: skybox + ambient ---
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Env")

; --- DirectionalLight: sun/moon key light from high angle ---
; Tilted ~45° down, rotated ~30° Y for directional angle
[node name="SunLight" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.866, 0, -0.5, -0.354, 0.707, -0.612, 0.354, 0.707, 0.612, 0, 5, 0)
light_energy = 1.2
light_indirect_energy = 0.8
light_color = Color(1.0, 0.95, 0.9, 1.0)
shadow_enabled = true
light_bake_mode = 2
directional_shadow_max_distance = 30.0
directional_shadow_split_1 = 0.1
directional_shadow_split_2 = 0.3
directional_shadow_split_3 = 0.6
directional_shadow_blend_splits = true

; --- OmniLight: warm interior fill ---
[node name="FillLight" type="OmniLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 2.4, 1.5)
light_energy = 0.4
light_indirect_energy = 0.5
light_color = Color(1.0, 0.85, 0.7, 1.0)
light_bake_mode = 2
omni_range = 6.0
omni_attenuation = 0.8
shadow_enabled = false

; --- ReflectionProbe for interior specular reflections ---
[node name="ReflectionProbe" type="ReflectionProbe" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.28, 0)
box_projection = true
interior = true
extents = Vector3(2.8, 1.4, 2.8)
intensity = 1.0
max_distance = 10.0

; --- LightmapGI: baked global illumination ---
[node name="LightmapGI" type="LightmapGI" parent="."]
quality = 2
bounces = 3
bounce_indirect_energy = 1.0
texel_scale = 1.0
max_texture_size = 2048
use_denoiser = true
interior = true
