From 5c12249c7b0e410d3920a078bbc60a8a899bd962 Mon Sep 17 00:00:00 2001 From: Jens Pitkanen Date: Sun, 26 Jul 2026 18:34:02 +0300 Subject: [PATCH] Share same env between player camera and the maps --- godot/maps/diner/diner.tscn | 4 ++++ godot/maps/two_towers/two_towers.tscn | 4 ++++ godot/scenes/player/local_player.tscn | 6 ++---- godot/scenes/player/local_player_env.tres | 4 ++++ 4 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 godot/scenes/player/local_player_env.tres diff --git a/godot/maps/diner/diner.tscn b/godot/maps/diner/diner.tscn index b560c8b..3369d26 100644 --- a/godot/maps/diner/diner.tscn +++ b/godot/maps/diner/diner.tscn @@ -13,6 +13,7 @@ [ext_resource type="PackedScene" uid="uid://c1r8nk58cci3a" path="res://scenes/misc/goal.tscn" id="11_1d2sd"] [ext_resource type="Script" uid="uid://chhq2pb2quwg6" path="res://maps/entities/spawn_entity.gd" id="12_v6ly3"] [ext_resource type="Material" uid="uid://duhcpuu670mxw" path="res://maps/materials/str_blood_large.tres" id="13_1sdvq"] +[ext_resource type="Environment" uid="uid://dy2rpg3tdiiv5" path="res://scenes/player/local_player_env.tres" id="14_1sdvq"] [sub_resource type="ArrayMesh" id="ArrayMesh_1d2sd"] lightmap_size_hint = Vector2i(298, 302) @@ -489,3 +490,6 @@ shape = SubResource("ConvexPolygonShape3D_41emq") [node name="directional_light_3d" type="DirectionalLight3D" parent="." unique_id=1962171543] transform = Transform3D(0.8660254, -0.43301272, 0.25, 0.1294095, 0.6770772, 0.7244444, -0.4829629, -0.59503484, 0.642402, 0, 3, 0) shadow_enabled = true + +[node name="world_environment" type="WorldEnvironment" parent="." unique_id=842016761] +environment = ExtResource("14_1sdvq") diff --git a/godot/maps/two_towers/two_towers.tscn b/godot/maps/two_towers/two_towers.tscn index 472a40f..29f5bfa 100644 --- a/godot/maps/two_towers/two_towers.tscn +++ b/godot/maps/two_towers/two_towers.tscn @@ -13,6 +13,7 @@ [ext_resource type="Script" uid="uid://chhq2pb2quwg6" path="res://maps/entities/spawn_entity.gd" id="11_26faa"] [ext_resource type="Material" uid="uid://1a350wgaavgt" path="res://maps/materials/str_stoneflr1.tres" id="11_mw7l8"] [ext_resource type="PackedScene" uid="uid://c1r8nk58cci3a" path="res://scenes/misc/goal.tscn" id="12_2spb1"] +[ext_resource type="Environment" uid="uid://dy2rpg3tdiiv5" path="res://scenes/player/local_player_env.tres" id="14_ldmbn"] [sub_resource type="ArrayMesh" id="ArrayMesh_mw7l8"] _surfaces = [{ @@ -713,3 +714,6 @@ shape = SubResource("ConvexPolygonShape3D_8ugwd") [node name="directional_light_3d" type="DirectionalLight3D" parent="." unique_id=1461274044] transform = Transform3D(0.99328005, -0.09338135, 0.068372406, 0.019120537, 0.7150448, 0.6988171, -0.11414584, -0.6928138, 0.7120252, 0, 8, 0) shadow_enabled = true + +[node name="world_environment" type="WorldEnvironment" parent="." unique_id=850026555] +environment = ExtResource("14_ldmbn") diff --git a/godot/scenes/player/local_player.tscn b/godot/scenes/player/local_player.tscn index fe26c3d..38d4d37 100644 --- a/godot/scenes/player/local_player.tscn +++ b/godot/scenes/player/local_player.tscn @@ -1,5 +1,6 @@ [gd_scene format=3 uid="uid://ct70bpbca8one"] +[ext_resource type="Environment" uid="uid://dy2rpg3tdiiv5" path="res://scenes/player/local_player_env.tres" id="1_3nqsm"] [ext_resource type="PackedScene" uid="uid://bod6b3befmyt5" path="res://scenes/player/soldier_m.tscn" id="1_jd651"] [ext_resource type="PackedScene" uid="uid://cl66unms2gim0" path="res://scenes/player/effects.tscn" id="2_ywmwa"] [ext_resource type="PackedScene" uid="uid://n3u0jr4wiib1" path="res://scenes/ui/settings.tscn" id="3_beej8"] @@ -8,9 +9,6 @@ [ext_resource type="Texture2D" uid="uid://bdfqu6p74pfwe" path="res://raw_assets/crosshair/Crosshair 1.png" id="6_7awel"] [ext_resource type="AudioStream" uid="uid://bfg31e3s4jv8c" path="res://raw_assets/sfx/Hit.mp3" id="7_dguuj"] -[sub_resource type="Environment" id="Environment_3nx84"] -glow_enabled = true - [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_oh8vq"] [sub_resource type="LabelSettings" id="LabelSettings_7awel"] @@ -43,7 +41,7 @@ collision_mask = 4 [node name="camera_3d" type="Camera3D" parent="." unique_id=1773137418] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.8724979, -0.2644562) -environment = SubResource("Environment_3nx84") +environment = ExtResource("1_3nqsm") current = true fov = 90.0 diff --git a/godot/scenes/player/local_player_env.tres b/godot/scenes/player/local_player_env.tres new file mode 100644 index 0000000..88363a4 --- /dev/null +++ b/godot/scenes/player/local_player_env.tres @@ -0,0 +1,4 @@ +[gd_resource type="Environment" format=3 uid="uid://dy2rpg3tdiiv5"] + +[resource] +glow_enabled = true