added realtime day night cycle based on system time
This commit is contained in:
35
assets/realtime_day_night_cycle.tscn
Normal file
35
assets/realtime_day_night_cycle.tscn
Normal file
@@ -0,0 +1,35 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://cwy8iv8nlwqrc"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dl780dimuvcms" path="res://scripts/realtime_day_night_cycle.gd" id="1_idjmm"]
|
||||
|
||||
[sub_resource type="Curve" id="Curve_idjmm"]
|
||||
_limits = [0.0, 2.0, 0.0, 24.0]
|
||||
_data = [Vector2(5, 0), 0.0, 0.66, 0, 0, Vector2(12, 2), 0.0, 0.0, 0, 0, Vector2(19, 0), -0.66, 0.0, 0, 0]
|
||||
point_count = 3
|
||||
|
||||
[sub_resource type="PhysicalSkyMaterial" id="PhysicalSkyMaterial_xp6wm"]
|
||||
energy_multiplier = 5.0
|
||||
|
||||
[sub_resource type="Sky" id="Sky_6g0ku"]
|
||||
sky_material = SubResource("PhysicalSkyMaterial_xp6wm")
|
||||
process_mode = 3
|
||||
|
||||
[sub_resource type="Environment" id="Environment_ml2st"]
|
||||
background_mode = 2
|
||||
sky = SubResource("Sky_6g0ku")
|
||||
ssr_enabled = true
|
||||
ssao_enabled = true
|
||||
sdfgi_enabled = true
|
||||
glow_enabled = true
|
||||
fog_density = 0.0005
|
||||
|
||||
[node name="Realtime Day Night Cycle" type="Node3D"]
|
||||
script = ExtResource("1_idjmm")
|
||||
sun_energy_over_time = SubResource("Curve_idjmm")
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_ml2st")
|
||||
|
||||
[node name="Sun" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(0.603876, -0.0397012, 0.796089, -0.797078, -0.0300781, 0.603127, -2.96845e-10, -0.998759, -0.0498085, 0, 0, 0)
|
||||
shadow_enabled = true
|
||||
Reference in New Issue
Block a user