Improve tree gathering and rain occlusion
This commit is contained in:
parent
a7c71213cc
commit
3608be41ab
8 changed files with 165 additions and 2 deletions
|
|
@ -12,6 +12,9 @@ const PlayerStorageInteractionType = preload(
|
|||
const MeshSurfaceAnchorSamplerType = preload(
|
||||
"res://world/generation/mesh_surface_anchor_sampler.gd"
|
||||
)
|
||||
const PrecipitationOcclusionType = preload(
|
||||
"res://world/environment/precipitation_occlusion.gd"
|
||||
)
|
||||
const WATER_BODY_SCENE: PackedScene = preload("res://world/water_body.tscn")
|
||||
const SALT_WATER_MATERIAL: Material = preload(
|
||||
"res://world/materials/stylized_water.tres"
|
||||
|
|
@ -292,9 +295,21 @@ func _on_generation_completed(summary: Dictionary) -> void:
|
|||
_place_spawn_amenities(spawn_position)
|
||||
_configure_fresh_water(records)
|
||||
_configure_diggable_area()
|
||||
# Imported prop instances may finish applying their scene state while the
|
||||
# generated world is assembled. Mark the final decoration tree once every
|
||||
# prop and material variant is in place so rain canopy occlusion persists.
|
||||
_mark_precipitation_occluders()
|
||||
world_generated.emit(_current_seed, summary)
|
||||
|
||||
|
||||
func _mark_precipitation_occluders() -> void:
|
||||
for prop: Node in _decorations.get_children():
|
||||
var prop_group := prop.get_meta(&"terrain_prop_group", &"") as StringName
|
||||
if prop_group not in [&"grass_tree", &"sand_tree"]:
|
||||
continue
|
||||
PrecipitationOcclusionType.mark_tree_meshes(prop)
|
||||
|
||||
|
||||
func _assign_biomes(
|
||||
records: Array[Dictionary],
|
||||
summary: Dictionary,
|
||||
|
|
|
|||
|
|
@ -17,4 +17,3 @@ minimum_visual_scale = 0.65
|
|||
maximum_visual_scale = 1.2
|
||||
collision_radius = 0.5
|
||||
collision_height = 4.0
|
||||
gatherable_surface_material_names = PackedStringArray("wood")
|
||||
|
|
|
|||
|
|
@ -17,4 +17,3 @@ minimum_visual_scale = 0.75
|
|||
maximum_visual_scale = 1.2
|
||||
collision_radius = 0.65
|
||||
collision_height = 9.5
|
||||
gatherable_surface_material_names = PackedStringArray("wood")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue