diff --git a/assets/bullet_cam.tscn b/assets/bullet_cam.tscn index 5de3282..68b7d4e 100644 --- a/assets/bullet_cam.tscn +++ b/assets/bullet_cam.tscn @@ -124,6 +124,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.789394) [node name="Camera3D" type="Camera3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1.35947) +top_level = true attributes = SubResource("CameraAttributesPractical_w2xv5") fov = 150.0 diff --git a/assets/dikhololo_night_4k.exr b/assets/dikhololo_night_4k.exr new file mode 100644 index 0000000..5b9c6f3 Binary files /dev/null and b/assets/dikhololo_night_4k.exr differ diff --git a/assets/dikhololo_night_4k.exr.import b/assets/dikhololo_night_4k.exr.import new file mode 100644 index 0000000..e2f5249 --- /dev/null +++ b/assets/dikhololo_night_4k.exr.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://do0nm3sn75gc3" +path.bptc="res://.godot/imported/dikhololo_night_4k.exr-bbe0ff05d471a8fec432c8d7b0c3b28e.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/dikhololo_night_4k.exr" +dest_files=["res://.godot/imported/dikhololo_night_4k.exr-bbe0ff05d471a8fec432c8d7b0c3b28e.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/realtime_day_night_cycle.tscn b/assets/realtime_day_night_cycle.tscn index 98cb377..3ad839c 100644 --- a/assets/realtime_day_night_cycle.tscn +++ b/assets/realtime_day_night_cycle.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=8 format=3 uid="uid://cwy8iv8nlwqrc"] +[gd_scene load_steps=9 format=3 uid="uid://cwy8iv8nlwqrc"] [ext_resource type="Script" uid="uid://dl780dimuvcms" path="res://scripts/realtime_day_night_cycle.gd" id="1_idjmm"] +[ext_resource type="Texture2D" uid="uid://do0nm3sn75gc3" path="res://assets/dikhololo_night_4k.exr" id="2_xp6wm"] [sub_resource type="Gradient" id="Gradient_idjmm"] offsets = PackedFloat32Array(0.00636943, 0.159236, 0.828025, 1) @@ -16,7 +17,10 @@ _data = [Vector2(5, 0), 0.0, 0.66, 0, 0, Vector2(12, 2), 0.0, 0.0, 0, 0, Vector2 point_count = 3 [sub_resource type="PhysicalSkyMaterial" id="PhysicalSkyMaterial_xp6wm"] +rayleigh_coefficient = 17.2 +rayleigh_color = Color(0.705144, 0.689027, 0.62083, 1) energy_multiplier = 5.0 +night_sky = ExtResource("2_xp6wm") [sub_resource type="Sky" id="Sky_6g0ku"] sky_material = SubResource("PhysicalSkyMaterial_xp6wm") @@ -42,6 +46,10 @@ sun_energy_over_time = SubResource("Curve_idjmm") environment = SubResource("Environment_ml2st") [node name="Sun" type="DirectionalLight3D" parent="."] -transform = Transform3D(0.997171, 0.0751772, 0, 0.0642699, -0.852493, 0.518773, 0.0389999, -0.517306, -0.854912, 0, 0, 0) -light_energy = 1.45936 +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) +shadow_enabled = true + +[node name="Moon" type="DirectionalLight3D" parent="Sun"] +transform = Transform3D(1, 0, 0, 0, -1, -8.74228e-08, 0, 8.74228e-08, -1, 0, 0, 0) +light_color = Color(0.5874, 0.804263, 0.89, 1) shadow_enabled = true diff --git a/scenes/test_level_2v2.tscn b/scenes/test_level_2v2.tscn index 456356b..fca44b1 100644 --- a/scenes/test_level_2v2.tscn +++ b/scenes/test_level_2v2.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=123 format=4 uid="uid://dyop6vk3rgkkb"] +[gd_scene load_steps=120 format=4 uid="uid://dyop6vk3rgkkb"] [ext_resource type="Script" uid="uid://bkii8jwf0k7tq" path="res://scripts/LevelManager.gd" id="1_orhgl"] [ext_resource type="Texture2D" uid="uid://dqs06ic3vjtwk" path="res://assets/Models/asphalt1.albedo.jpg" id="1_w4rag"] @@ -43,27 +43,7 @@ [ext_resource type="PackedScene" uid="uid://db7xqf12sayj0" path="res://assets/chest_spawner.tscn" id="43_480ap"] [ext_resource type="PackedScene" uid="uid://dgapcuvg0gtmm" path="res://assets/scene_changer.tscn" id="43_x54pr"] [ext_resource type="Resource" uid="uid://bxcxqt7rmfvdw" path="res://GameModes/hubworld.tres" id="44_1akso"] - -[sub_resource type="PhysicalSkyMaterial" id="PhysicalSkyMaterial_e2mk2"] - -[sub_resource type="Sky" id="Sky_1fe4l"] -sky_material = SubResource("PhysicalSkyMaterial_e2mk2") - -[sub_resource type="Environment" id="Environment_q2cfn"] -background_mode = 2 -sky = SubResource("Sky_1fe4l") -tonemap_mode = 2 -ssr_enabled = true -ssao_enabled = true -glow_enabled = true -glow_intensity = 3.32 -glow_bloom = 0.07 -volumetric_fog_density = 0.01 -adjustment_contrast = 1.5 - -[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_svyyv"] -dof_blur_near_distance = 0.7 -dof_blur_near_transition = 0.2 +[ext_resource type="PackedScene" uid="uid://cwy8iv8nlwqrc" path="res://assets/realtime_day_night_cycle.tscn" id="44_alxs4"] [sub_resource type="NavigationMesh" id="NavigationMesh_1kybg"] vertices = PackedVector3Array(-57.651, 0.499999, -8.7261, -55.901, 0.499999, -8.9761, -56.151, 0.499999, -35.2261, -115.901, 0.499999, 5.7739, -57.651, 0.499999, 5.5239, -115.901, 0.499999, -35.2261, -26.151, 0.499999, -8.9761, -25.901, 0.499999, -35.2261, -24.401, 0.499999, -0.476101, -23.901, 0.499999, -0.226101, -23.651, 0.499999, -8.2261, -24.401, 0.499999, -8.7261, 8.599, 0.499999, -8.2261, 24.099, 0.499999, -8.2261, 24.099, 0.499999, -35.2261, 7.849, 0.499999, -8.2261, 8.099, 0.499999, 0.0238991, 8.349, 0.499999, 0.0238991, 24.599, 0.499999, 7.5239, 28.849, 0.249999, 20.7739, 30.599, 0.249999, 21.0239, 24.599, 0.499999, -7.9761, 30.599, 0.249999, 25.0239, 40.599, 0.499999, 37.5239, 56.099, 0.499999, 37.5239, 115.849, 0.499999, 39.7739, 115.849, 0.499999, -35.2261, 56.349, 0.499999, 39.7739, -56.651, 7.75, -7.9761, -56.651, 7.75, 6.2739, -25.401, 7.75, 6.2739, -25.401, 7.75, -7.9761, -56.401, 0.499999, -7.7261, -56.401, 0.499999, 6.0239, -25.651, 0.499999, 6.0239, -25.651, 0.499999, -7.7261, -22.901, 7.75, -7.2261, -22.901, 7.75, 7.0239, -8.651, 7.75, 7.0239, -8.651, 7.75, -7.2261, -7.151, 4.5, -7.2261, -7.151, 4.5, 7.2739, 7.099, 4.5, 7.2739, 7.099, 4.5, -7.2261, 9.349, 20.25, -7.2261, 9.349, 20.25, 7.0239, 23.599, 20.25, 7.0239, 23.599, 20.25, -7.2261, -22.651, 0.499999, -6.9761, -22.651, 0.499999, 6.7739, -8.901, 0.499999, 6.7739, -8.901, 0.499999, -6.9761, -6.901, 0.499999, -6.9761, -6.901, 0.499999, 6.7739, 6.849, 0.499999, 6.7739, 6.849, 0.499999, -6.9761, 9.599, 0.499999, -6.9761, 9.599, 0.499999, 6.7739, 23.349, 0.499999, 6.7739, 23.349, 0.499999, -6.9761, -24.651, 0.499999, 7.2739, -23.901, 0.499999, 7.7739, -21.651, 0.499999, 36.5239, -55.651, 0.499999, 7.2739, -55.651, 0.499999, 36.5239, -21.651, 0.499999, 8.0239, 6.349, 0.499999, 37.5239, 6.599, 0.499999, 39.5239, 8.349, 0.499999, 39.5239, 8.599, 0.499999, 37.5239, 4.349, 0.499999, 8.0239, 4.349, 0.499999, 37.5239, 8.349, 0.499999, 7.7739, 8.099, 0.499999, 7.7739, 10.599, 0.499999, 8.0239, 10.599, 0.499999, 37.5239, -57.401, 0.499999, 36.5239, -57.401, 0.499999, 7.2739, -57.651, 0.499999, 38.2739, -115.901, 0.499999, 38.0239, 24.099, 0.499999, 8.0239, 28.349, 0.249999, 21.2739, -19.151, 0.499999, 36.5239, -19.151, 0.499999, 8.0239, -16.901, 0.499999, 39.0239, -9.651, 0.499999, 39.2739, -9.401, 0.499999, 37.5239, -16.901, 0.499999, 36.7739, -7.401, 0.499999, 37.5239, -7.151, 0.499999, 8.2739, 24.099, 0.499999, 37.5239, 28.349, 0.249999, 25.0239, 24.599, 0.499999, 38.0239, 28.849, 0.249999, 25.5239, 30.349, 0.249999, 25.5239, 40.099, 0.499999, 37.7739, 24.599, 0.499999, 39.7739, 40.099, 0.499999, 39.7739, -56.651, 7.75, 37.5239, -56.651, 7.75, 51.7739, -17.901, 7.75, 51.7739, -17.901, 7.75, 37.5239, -56.401, 0.499999, 37.7739, -56.401, 0.499999, 51.5239, -18.151, 0.499999, 51.5239, -18.151, 0.499999, 37.7739, -55.401, 0.499999, 80.2739, -55.401, 0.499999, 52.7739, -57.651, 0.499999, 52.5239, -115.901, 0.499999, 80.2739, -8.651, 7.75, 38.5239, -8.651, 7.75, 52.7739, 5.599, 7.75, 52.7739, 5.599, 7.75, 38.5239, 9.349, 20.25, 38.5239, 9.349, 20.25, 52.7739, 23.599, 20.25, 52.7739, 23.599, 20.25, 38.5239, 41.099, 4.75, 38.5239, 41.099, 4.75, 52.7739, 55.349, 4.75, 52.7739, 55.349, 4.75, 38.5239, -8.401, 0.499999, 38.7739, -8.401, 0.499999, 52.5239, 5.349, 0.499999, 52.5239, 5.349, 0.499999, 38.7739, 23.099, 0.499999, 52.5239, 23.349, 0.499999, 51.7739, 23.349, 0.499999, 38.7739, 9.599, 0.499999, 38.7739, 9.599, 0.499999, 52.5239, 41.349, 0.499999, 38.7739, 41.349, 0.499999, 51.5239, 41.849, 0.499999, 51.7739, 55.099, 0.499999, 52.5239, 55.099, 0.499999, 38.7739, 41.849, 0.499999, 52.5239, -16.901, 0.499999, 51.0239, -9.651, 0.499999, 51.2739, 8.349, 0.499999, 53.5239, 6.599, 0.499999, 53.5239, 4.349, 0.499999, 53.7739, 4.349, 0.499999, 80.2739, 10.599, 0.499999, 80.2739, 10.599, 0.499999, 53.7739, 24.599, 0.499999, 51.5239, 40.099, 0.499999, 51.5239, 56.349, 0.499999, 53.5239, 54.099, 0.499999, 53.7739, 54.099, 0.499999, 80.2739, 115.849, 0.499999, 80.2739, -17.151, 0.499999, 52.7739, -9.651, 0.499999, 53.5239, -19.151, 0.499999, 52.7739, -19.151, 0.499999, 80.2739, -7.401, 0.499999, 80.2739, -7.401, 0.499999, 53.7739, 40.349, 0.499999, 53.7739, 40.099, 0.499999, 53.0239, 24.599, 0.499999, 53.0239, 24.349, 0.499999, 53.7739, 22.349, 0.499999, 80.2739, 42.349, 0.499999, 80.2739, 22.349, 0.499999, 53.7739, 42.349, 0.499999, 53.7739) @@ -1159,24 +1139,14 @@ _data = { &"trainmove": SubResource("Animation_6nfej") } -[node name="Test Level 2" type="Node3D" node_paths=PackedStringArray("player", "time_based_sun")] +[node name="Test Level 2" type="Node3D" node_paths=PackedStringArray("player")] script = ExtResource("1_orhgl") gamemode = ExtResource("2_ynfvy") player = NodePath("Player") -time_based_sun = NodePath("DirectionalLight3D") [node name="Player" parent="." instance=ExtResource("2_f87c2")] transform = Transform3D(-0.866025, 0, -0.5, 0, 1, 0, 0.5, 0, -0.866025, -44.3464, 70.2562, -23.9068) -[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] -transform = Transform3D(-0.848049, 0.238103, 0.473415, 0, -0.893371, 0.449319, 0.52992, 0.381044, 0.757622, 0, 0, 0) -light_bake_mode = 1 -shadow_enabled = true - -[node name="WorldEnvironment" type="WorldEnvironment" parent="."] -environment = SubResource("Environment_q2cfn") -camera_attributes = SubResource("CameraAttributesPractical_svyyv") - [node name="NavigationRegion3D" type="NavigationRegion3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0157394, 0.0097332, 0.00448036) navigation_mesh = SubResource("NavigationMesh_1kybg") @@ -1628,3 +1598,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 32.9675, 15.717, -0.15157) [node name="ChestSpawner3" parent="." instance=ExtResource("43_480ap")] transform = Transform3D(-0.999819, 0, -0.0190229, 0, 1, 0, 0.0190229, 0, -0.999819, -0.87897, 5.93516, 4.28007) + +[node name="Realtime Day Night Cycle" parent="." instance=ExtResource("44_alxs4")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -45.8941, 1.0599, 29.0523) diff --git a/scripts/realtime_day_night_cycle.gd b/scripts/realtime_day_night_cycle.gd index 8ebb56b..2456ea1 100644 --- a/scripts/realtime_day_night_cycle.gd +++ b/scripts/realtime_day_night_cycle.gd @@ -6,8 +6,10 @@ extends Node3D @export var set_time = 17.0 @export var north_offset : float @export var sun_energy_over_time : Curve +@export var moon_energy_over_time : Curve @onready var sun: DirectionalLight3D = $Sun +@onready var moon: DirectionalLight3D = $Sun/Moon func _ready() -> void: change_sun() @@ -17,6 +19,7 @@ func change_sun(): sun.rotation.x = sun_details["angle"] sun.rotation.y = north_offset sun.light_energy = sun_details["energy"] + moon.light_energy = (2 - sun_details["energy"]) * .25 func sun_angle_from_time(): var time_dict = Time.get_time_dict_from_system()