restore full world effects outside portmaster

This commit is contained in:
Alexander Sellite 2026-09-01 19:00:13 -04:00
parent 4fda6e97f6
commit 41b4f86ddf
15 changed files with 398 additions and 122 deletions

View file

@ -474,6 +474,19 @@ func _validate_generated_region(
assert(ocean != null and fresh_root != null)
assert(ocean.water_type == WaterType.Type.SALT_WATER)
assert(is_equal_approx(ocean.position.y, GeneratedWorldRegion.WATER_HEIGHT))
var ocean_motion := ocean.get_node("VisualWater") as WaterSurfaceMotion
assert(ocean_motion != null and ocean_motion.is_processing())
var normal_water_amplitude: float = ocean_motion.get_effective_amplitude()
assert(normal_water_amplitude > 0.0)
region.set_water_motion_strength_multiplier(2.0)
assert(is_equal_approx(
ocean_motion.get_effective_amplitude(),
normal_water_amplitude * 2.0,
))
region.set_water_motion_strength_multiplier(1.0)
assert(is_equal_approx(
ocean_motion.get_effective_amplitude(), normal_water_amplitude
))
var ocean_recovery := ocean.get_node("RecoveryRegion") as PlayerWaterTrigger
assert(
ocean_recovery.entry_height_reference
@ -635,6 +648,20 @@ func _validate_generated_region(
"GatherableAnchors/ReachableTreeTrunks"
) as GatherableAnchorSet3D
assert(decorations != null and decorations.get_child_count() > 0)
var normal_foliage_wind := _first_foliage_wind_material(decorations)
assert(normal_foliage_wind != null)
var normal_foliage_strength: float = float(
normal_foliage_wind.get_shader_parameter("local_wind_strength")
)
assert(normal_foliage_strength > 0.0)
region.set_foliage_wind_strength_multiplier(2.0)
var rainy_foliage_wind := _first_foliage_wind_material(decorations)
assert(rainy_foliage_wind != null)
assert(is_equal_approx(
float(rainy_foliage_wind.get_shader_parameter("local_wind_strength")),
normal_foliage_strength * 2.0,
))
region.set_foliage_wind_strength_multiplier(1.0)
assert(anchors != null)
assert(anchors.get_spawn_positions().size() > 0)
_validate_tree_gatherable_anchors(region, decorations, anchors)
@ -1567,6 +1594,22 @@ func _find_mesh_instance(root_node: Node) -> MeshInstance3D:
return null
func _first_foliage_wind_material(root_node: Node) -> ShaderMaterial:
var mesh_instance := root_node as MeshInstance3D
if mesh_instance != null and mesh_instance.mesh != null:
for surface_index: int in mesh_instance.mesh.get_surface_count():
var material := mesh_instance.get_surface_override_material(
surface_index
) as ShaderMaterial
if material != null and material.shader == FOLIAGE_WIND_SHADER:
return material
for child: Node in root_node.get_children():
var found := _first_foliage_wind_material(child)
if found != null:
return found
return null
func _has_precipitation_occlusion_layer(root_node: Node) -> bool:
var mesh_instance := root_node as MeshInstance3D
if (