From 50c2014361a6acd8ebdf390d2dd375572d170342 Mon Sep 17 00:00:00 2001 From: Josh Creek <8179928+jcreek@users.noreply.github.com> Date: Mon, 3 Aug 2026 21:29:59 +0100 Subject: [PATCH] feat: enable SDFGI/reflection probes and fresnel glass boundary Adds sdfgi_enabled and a ReflectionProbe to all three arenas' Environment setup so surfaces get real bounce lighting/reflections instead of flat ambient. Converts arena_boundary.tscn's shared glass field material from unshaded to a shaded, rim-lit material so it reads as glass (dim face-on, highlighted at grazing angles) rather than a flat tinted overlay. --- Game/objects/arena_boundary.tscn | 5 ++++- Game/scenes/arena_01.tscn | 7 +++++++ Game/scenes/arena_02.tscn | 7 +++++++ Game/scenes/arena_03.tscn | 7 +++++++ TODO.md | 2 +- 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Game/objects/arena_boundary.tscn b/Game/objects/arena_boundary.tscn index d0005580..e6cd33c0 100644 --- a/Game/objects/arena_boundary.tscn +++ b/Game/objects/arena_boundary.tscn @@ -9,8 +9,11 @@ roughness = 0.6 [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_field"] transparency = 1 -shading_mode = 0 albedo_color = Color(0.6, 0.75, 1, 0.035) +roughness = 0.05 +rim_enabled = true +rim = 1.0 +rim_tint = 0.6 [sub_resource type="BoxMesh" id="BoxMesh_floor"] material = SubResource("StandardMaterial3D_floor") diff --git a/Game/scenes/arena_01.tscn b/Game/scenes/arena_01.tscn index 1e699c7c..70b6513f 100644 --- a/Game/scenes/arena_01.tscn +++ b/Game/scenes/arena_01.tscn @@ -33,6 +33,7 @@ sky_material = SubResource("ShaderMaterial_stars") [sub_resource type="Environment" id="Environment_space"] background_mode = 2 sky = SubResource("Sky_space") +sdfgi_enabled = true ambient_light_source = 2 ambient_light_color = Color(0.55, 0.6, 0.75, 1) ambient_light_energy = 0.4 @@ -65,6 +66,12 @@ shadow_enabled = true [node name="WorldEnvironment" type="WorldEnvironment" parent="."] environment = SubResource("Environment_space") +[node name="ReflectionProbe" type="ReflectionProbe" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 6, 0) +size = Vector3(26, 14, 40) +box_projection = true +update_mode = 0 + [node name="GoalTeam0" parent="." instance=ExtResource("6_p57ef")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.79, 18) diff --git a/Game/scenes/arena_02.tscn b/Game/scenes/arena_02.tscn index ebed875d..a190fb82 100644 --- a/Game/scenes/arena_02.tscn +++ b/Game/scenes/arena_02.tscn @@ -18,6 +18,7 @@ sky_material = SubResource("PanoramaSkyMaterial_nebula") [sub_resource type="Environment" id="Environment_nebula"] background_mode = 2 sky = SubResource("Sky_nebula") +sdfgi_enabled = true ambient_light_source = 2 ambient_light_color = Color(0.65, 0.35, 0.75, 1) ambient_light_energy = 0.45 @@ -90,6 +91,12 @@ shadow_enabled = true [node name="WorldEnvironment" type="WorldEnvironment" parent="."] environment = SubResource("Environment_nebula") +[node name="ReflectionProbe" type="ReflectionProbe" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 6, 0) +size = Vector3(26, 14, 40) +box_projection = true +update_mode = 0 + [node name="GoalTeam0" parent="." instance=ExtResource("6_p57ef")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.79, 18) diff --git a/Game/scenes/arena_03.tscn b/Game/scenes/arena_03.tscn index b0e9f112..b45882a6 100644 --- a/Game/scenes/arena_03.tscn +++ b/Game/scenes/arena_03.tscn @@ -14,6 +14,7 @@ sky_material = SubResource("ShaderMaterial_asteroid") [sub_resource type="Environment" id="Environment_asteroid"] background_mode = 2 sky = SubResource("Sky_asteroid") +sdfgi_enabled = true ambient_light_source = 2 ambient_light_color = Color(0.6, 0.45, 0.3, 1) ambient_light_energy = 0.3 @@ -47,6 +48,12 @@ shadow_enabled = true [node name="WorldEnvironment" type="WorldEnvironment" parent="."] environment = SubResource("Environment_asteroid") +[node name="ReflectionProbe" type="ReflectionProbe" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 6, 0) +size = Vector3(26, 14, 40) +box_projection = true +update_mode = 0 + [node name="GoalTeam0" parent="." instance=ExtResource("6_p57ef")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.79, 18) diff --git a/TODO.md b/TODO.md index c446554f..a0b0b630 100644 --- a/TODO.md +++ b/TODO.md @@ -35,7 +35,7 @@ A subagent ran the game and critiqued arena_02 head-on against Rocket League 2 i - [x] **De-duplicate the nebula sky's star sprites**. Every bright star in `sky_nebula.png` is the exact same diffraction-spike stamp at the same size/brightness, just relocated — called out as "the single most amateur-looking tell in the whole scene" once you look for more than a second. Fixed: the generator is now committed at `tools/textures/gen_nebula_sky.py`; the hero-star loop randomizes rotation, arm count (4 or 8), spike length, and brightness per star, and `sky_nebula.png` was regenerated/reimported and confirmed via in-game screenshot. Prompt: "Commit the nebula sky texture generator (currently only in an ephemeral scratchpad — recreate it if needed: numpy/Pillow script generating a 4096x2048 equirect nebula via layered FFT/domain-warped noise, color-graded, with drawn hero stars) into the repo at `tools/textures/gen_nebula_sky.py`. Fix the hero-star drawing loop so each star's diffraction-spike stamp gets randomized rotation, spike length, and brightness instead of reusing one identical stamp at every location. Regenerate `Game/assets/textures/sky_nebula.png`, reimport, and confirm via an in-game screenshot that the repeated-stamp tell is gone." -- [ ] **Real PBR lighting + materials, fresnel glass boundary** (no new models — material/lighting setup only). Everything is flat-shaded/unshaded with a single directional light: no GI, no reflections, no bounce/AO, and the "glass" boundary is a flat unshaded tinted overlay with no fresnel rim or reflection. +- [x] **Real PBR lighting + materials, fresnel glass boundary**: SDFGI enabled and a `ReflectionProbe` added to all three arenas (`arena_01`/`02`/`03.tscn`); `arena_boundary.tscn`'s shared `StandardMaterial3D_field` converted from unshaded to shaded (roughness 0.05, rim-enabled fresnel highlight, alpha still near-invisible face-on). Verified via godot-mcp screenshots (60 FPS / 17ms frame time, no measurable cost) and zero-error headless runs of `free_play`/`match`/`spectate`/`training`. Prompt: "In Cosmic Clash, enable SDFGI and add reflection probes to the arena scenes (start with `arena_02.tscn`) so surfaces get real bounce lighting/reflections instead of flat ambient. Convert `arena_boundary.tscn`'s `StandardMaterial3D_field` from unshaded to a proper shaded material with a fresnel-based rim highlight (bright at grazing angles, near-invisible face-on) so it reads as glass rather than a tinted overlay — check the performance impact of moving it off unshaded, given it's a large always-visible surface. Verify visually via godot-mcp screenshots, and confirm headless runs (`free_play`/`match`/`spectate`/`training`) still show zero errors." - [ ] **Greeble/detail pass on the station + debris models** (Blender remodel — explicit models to redo). `nebula_station.glb`/`nebula_debris.glb` are unmistakably Blender primitive kitbashes up close: plain boxes/cylinders with bevel modifiers, no panel lines, damage decals, or surface detail, and debris chunks look undifferentiated from the station.