mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-06 16:00:08 +01:00
15 lines
623 B
GDScript
15 lines
623 B
GDScript
extends Node3D
|
|
|
|
|
|
func _ready() -> void:
|
|
if RenderingServer.get_current_rendering_method() == "gl_compatibility":
|
|
# Use PCF13 shadow filtering to improve quality (Medium maps to PCF5 instead).
|
|
RenderingServer.directional_soft_shadow_filter_set_quality(RenderingServer.SHADOW_QUALITY_SOFT_HIGH)
|
|
|
|
# Darken the light's energy to compensate for sRGB blending (without affecting sky rendering).
|
|
$Sun.sky_mode = DirectionalLight3D.SKY_MODE_SKY_ONLY
|
|
var new_light: DirectionalLight3D = $Sun.duplicate()
|
|
new_light.light_energy = 0.35
|
|
new_light.sky_mode = DirectionalLight3D.SKY_MODE_LIGHT_ONLY
|
|
add_child(new_light)
|