pretty happy with fog and cloud tweaks, still need to make bigger clouds

This commit is contained in:
derek
2025-04-01 11:43:48 -05:00
parent 8999a68854
commit ca5cfba827
8 changed files with 120 additions and 95 deletions

View File

@@ -22,6 +22,71 @@
[ext_resource type="PackedScene" uid="uid://b6d8oy7iuad4a" path="res://cloud1.tscn" id="20_wqead"]
[ext_resource type="Script" uid="uid://1q8lyvac5gft" path="res://scripts/cloudSpawner.gd" id="21_mlcq0"]
[sub_resource type="Gradient" id="Gradient_vr1m7"]
offsets = PackedFloat32Array(0.2, 1)
colors = PackedColorArray(1, 1, 1, 1, 0, 0, 0, 1)
[sub_resource type="FastNoiseLite" id="FastNoiseLite_d8lcj"]
noise_type = 2
frequency = 0.03
cellular_jitter = 3.0
cellular_return_type = 0
domain_warp_enabled = true
domain_warp_type = 1
domain_warp_amplitude = 50.0
domain_warp_fractal_type = 2
domain_warp_fractal_lacunarity = 1.5
domain_warp_fractal_gain = 1.0
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_bov7h"]
seamless = true
color_ramp = SubResource("Gradient_vr1m7")
noise = SubResource("FastNoiseLite_d8lcj")
[sub_resource type="Terrain3DMaterial" id="Terrain3DMaterial_mlcq0"]
_shader_parameters = {
"_mouse_layer": 2147483648,
"auto_base_texture": 0,
"auto_height_reduction": 0.0,
"auto_overlay_texture": 1,
"auto_slope": 1.0,
&"bias_distance": 512.0,
"blend_sharpness": 0.87,
&"depth_blur": 0.0,
"dual_scale_far": 170.0,
"dual_scale_near": 100.0,
"dual_scale_reduction": 0.3,
"dual_scale_texture": 0,
&"enable_macro_variation": true,
&"enable_projection": true,
"height_blending": true,
"macro_variation1": Color(0.855, 0.8625, 0.9, 1),
"macro_variation2": Color(0.9, 0.885, 0.81, 1),
&"macro_variation_slope": 0.333,
&"mipmap_bias": 1.0,
"noise1_angle": 0.1,
"noise1_offset": Vector2(0.5, 0.5),
"noise1_scale": 0.04,
"noise2_scale": 0.076,
"noise3_scale": 0.225,
"noise_texture": SubResource("NoiseTexture2D_bov7h"),
&"projection_angular_division": 2.0,
&"projection_threshold": 0.8,
"tri_scale_reduction": 0.3,
&"world_noise_fragment_normals": false,
"world_noise_height": 34.0,
"world_noise_lod_distance": 7500.0,
"world_noise_max_octaves": 4,
"world_noise_min_octaves": 2,
"world_noise_offset": Vector3(2.17, -1.225, 1.9),
"world_noise_region_blend": 0.33,
"world_noise_scale": 9.85,
&"world_space_normal_blend": true
}
world_background = 2
auto_shader = true
dual_scaling = true
[sub_resource type="Animation" id="Animation_v0ka4"]
length = 0.001
tracks/0/type = "position_3d"
@@ -92,71 +157,6 @@ _data = {
&"movetargets": SubResource("Animation_sibpp")
}
[sub_resource type="Gradient" id="Gradient_vr1m7"]
offsets = PackedFloat32Array(0.2, 1)
colors = PackedColorArray(1, 1, 1, 1, 0, 0, 0, 1)
[sub_resource type="FastNoiseLite" id="FastNoiseLite_d8lcj"]
noise_type = 2
frequency = 0.03
cellular_jitter = 3.0
cellular_return_type = 0
domain_warp_enabled = true
domain_warp_type = 1
domain_warp_amplitude = 50.0
domain_warp_fractal_type = 2
domain_warp_fractal_lacunarity = 1.5
domain_warp_fractal_gain = 1.0
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_bov7h"]
seamless = true
color_ramp = SubResource("Gradient_vr1m7")
noise = SubResource("FastNoiseLite_d8lcj")
[sub_resource type="Terrain3DMaterial" id="Terrain3DMaterial_mlcq0"]
_shader_parameters = {
"_mouse_layer": 2147483648,
"auto_base_texture": 0,
"auto_height_reduction": 0.0,
"auto_overlay_texture": 1,
"auto_slope": 1.0,
&"bias_distance": 512.0,
"blend_sharpness": 0.87,
&"depth_blur": 0.0,
"dual_scale_far": 170.0,
"dual_scale_near": 100.0,
"dual_scale_reduction": 0.3,
"dual_scale_texture": 0,
&"enable_macro_variation": true,
&"enable_projection": true,
"height_blending": true,
"macro_variation1": Color(0.855, 0.8625, 0.9, 1),
"macro_variation2": Color(0.9, 0.885, 0.81, 1),
&"macro_variation_slope": 0.333,
&"mipmap_bias": 1.0,
"noise1_angle": 0.1,
"noise1_offset": Vector2(0.5, 0.5),
"noise1_scale": 0.04,
"noise2_scale": 0.076,
"noise3_scale": 0.225,
"noise_texture": SubResource("NoiseTexture2D_bov7h"),
&"projection_angular_division": 2.0,
&"projection_threshold": 0.8,
"tri_scale_reduction": 0.3,
&"world_noise_fragment_normals": false,
"world_noise_height": 34.0,
"world_noise_lod_distance": 7500.0,
"world_noise_max_octaves": 4,
"world_noise_min_octaves": 2,
"world_noise_offset": Vector3(2.17, -1.225, 1.9),
"world_noise_region_blend": 0.33,
"world_noise_scale": 9.85,
&"world_space_normal_blend": true
}
world_background = 2
auto_shader = true
dual_scaling = true
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_hthjk"]
transparency = 1
shading_mode = 0
@@ -167,6 +167,14 @@ script = ExtResource("1_v17bv")
map_name = "Hub 1"
gamemode = ExtResource("2_pxx7p")
[node name="Terrain3D" type="Terrain3D" parent="."]
data_directory = "res://demo/data"
material = SubResource("Terrain3DMaterial_mlcq0")
assets = ExtResource("19_wqead")
collision_mode = 2
top_level = true
metadata/_edit_lock_ = true
[node name="Realtime Day Night Cycle" parent="." instance=ExtResource("3_cyqa2")]
transform = Transform3D(-0.513781, 0, -0.857921, 0, 1, 0, 0.857921, 0, -0.513781, 0, 0, 0)
set_time = 22.0
@@ -391,19 +399,12 @@ light_energy = 11.615
shadow_enabled = true
spot_range = 17.4054
[node name="Terrain3D" type="Terrain3D" parent="."]
data_directory = "res://demo/data"
material = SubResource("Terrain3DMaterial_mlcq0")
assets = ExtResource("19_wqead")
collision_mode = 2
top_level = true
metadata/_edit_lock_ = true
[node name="Node3D" parent="." instance=ExtResource("20_wqead")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -48.9581, 103.525, 58.8201)
[node name="CloudSpawner2" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.999695, 0.0246939, 0, -0.0246939, 0.999695, -45.7803, 141.291, -87.7143)
size = Vector3(408.771, 87.5078, 254.602)
transform = Transform3D(1, 0, 0, 0, 0.999695, 0.0246939, 0, -0.0246939, 0.999695, -320.383, 250.481, -90.4114)
size = Vector3(1424.45, 305.954, 1949.74)
material = SubResource("StandardMaterial3D_hthjk")
script = ExtResource("21_mlcq0")
number_of_clouds = 300

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

View File

@@ -1,4 +1,4 @@
[gd_resource type="VisualShader" load_steps=31 format=3 uid="uid://bootgg1o64ovr"]
[gd_resource type="VisualShader" load_steps=31 format=3 uid="uid://cx7x7p52eqtv2"]
[sub_resource type="VisualShaderNodeFresnel" id="VisualShaderNodeFresnel_jqdis"]
default_input_values = [2, false, 3, 1.5]

View File

@@ -39,8 +39,12 @@ glow_enabled = true
glow_intensity = 1.2
fog_mode = 1
fog_density = 0.1
volumetric_fog_density = 0.006
volumetric_fog_albedo = Color(0.530013, 0.696854, 0.82526, 1)
volumetric_fog_enabled = true
volumetric_fog_density = 0.001
volumetric_fog_albedo = Color(0.6384, 0.74256, 0.84, 1)
volumetric_fog_length = 3000.0
volumetric_fog_ambient_inject = 1.0
volumetric_fog_sky_affect = 0.25
[node name="Realtime Day Night Cycle" type="Node3D"]
script = ExtResource("1_idjmm")
@@ -62,3 +66,10 @@ transform = Transform3D(1, 0, 0, 0, -1, -8.74228e-08, 0, 8.74228e-08, -1, 0, 0,
light_color = Color(0.5874, 0.804263, 0.89, 1)
light_energy = 0.0
shadow_enabled = true
[node name="Timer" type="Timer" parent="."]
wait_time = 60.0
autostart = true
ignore_time_scale = true
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]

View File

@@ -4,7 +4,9 @@
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_017xs"]
emission_shape = 3
emission_box_extents = Vector3(20, 10, 20)
emission_box_extents = Vector3(20, 10, 15)
angle_min = 1.07288e-05
angle_max = 360.0
gravity = Vector3(0, 0, 0)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_7tvac"]
@@ -15,10 +17,10 @@ billboard_mode = 1
[sub_resource type="QuadMesh" id="QuadMesh_0l02b"]
material = SubResource("StandardMaterial3D_7tvac")
size = Vector2(50, 50)
size = Vector2(30, 30)
[node name="Node3D" type="GPUParticles3D"]
amount = 50
amount = 20
lifetime = 60.0
explosiveness = 0.98
process_material = SubResource("ParticleProcessMaterial_017xs")

File diff suppressed because one or more lines are too long

View File

@@ -7,7 +7,6 @@ func _ready() -> void:
spawn_clouds()
func spawn_clouds():
print("SPAWNING CLOUDS")
while number_of_clouds >= 0:
number_of_clouds -= 1
@@ -19,4 +18,3 @@ func spawn_clouds():
var cloud = cloud.instantiate()
add_child(cloud)
cloud.global_position = self.global_position + spawn_pos
print("CLOUD POS : ",spawn_pos)

View File

@@ -31,10 +31,11 @@ func sun_angle_from_time():
var angle : float = deg_to_rad((current_time/24.0) * 360.0 + 90.0)
var energy = sun_energy_over_time.sample(current_time)
print("current time: ", current_time)
print("Sun angle : ",rad_to_deg(angle))
return {"angle" : angle, "energy" : energy}
func _on_property_list_changed() -> void:
change_sun()
func _on_timer_timeout() -> void:
change_sun()