fix godray orientation + fix blur

This commit is contained in:
2026-04-14 08:53:38 +02:00
parent 65294c7011
commit 060bccd96a
18 changed files with 445 additions and 23 deletions

View File

@@ -497,8 +497,16 @@ func spawn_single_godray() -> void:
if camera and is_instance_valid(camera):
center = camera.global_position
ray.global_position = Vector3(center.x + random_x, environment_config.godray_spawn_height, center.z + random_z)
ray.rotation_degrees = environment_config.godray_rotation_degrees
ray.scale = environment_config.godray_scale
if ray.has_method("set_visual_rotation_degrees"):
ray.call("set_visual_rotation_degrees", environment_config.godray_rotation_degrees)
else:
ray.rotation_degrees = environment_config.godray_rotation_degrees
if ray.has_method("set_visual_scale"):
ray.call("set_visual_scale", environment_config.godray_scale)
else:
ray.scale = environment_config.godray_scale
if ray.has_method("orient_to_camera"):
ray.call("orient_to_camera")
var godray_tween: Tween = create_tween()
godray_tween.tween_interval(2.0)
@@ -611,8 +619,18 @@ func toggle_blur(value: bool) -> void:
if blur:
blur.visible = value
ApplyPostProcessBlurConfig()
func toggle_shadows(value: bool) -> void:
if environment_shadows:
environment_shadows.visible = value
func ApplyPostProcessBlurConfig() -> void:
if blur == null:
return
var blur_material := blur.material as ShaderMaterial
if blur_material:
blur_material.set_shader_parameter("blur_amount", environment_config.blur_amount)
#endregion