revert
This commit is contained in:
@@ -61,6 +61,11 @@ const NOON := 0.5
|
||||
@export var fog_color_curve: Gradient
|
||||
@export var fog_density_curve: Curve
|
||||
|
||||
@export_group("Sky Gradient Curves")
|
||||
@export var sky_top_color_curve: Gradient
|
||||
@export var sky_horizon_color_curve: Gradient
|
||||
@export var sky_bottom_color_curve: Gradient
|
||||
|
||||
@export_group("Stars")
|
||||
@export var stars_visibility_curve: Curve
|
||||
|
||||
@@ -117,10 +122,10 @@ func _initialize_default_curves() -> void:
|
||||
if moon_intensity_curve == null:
|
||||
moon_intensity_curve = Curve.new()
|
||||
moon_intensity_curve.add_point(Vector2(0.0, 0.4))
|
||||
moon_intensity_curve.add_point(Vector2(0.2, 0.3))
|
||||
moon_intensity_curve.add_point(Vector2(0.25, 0.0))
|
||||
moon_intensity_curve.add_point(Vector2(0.75, 0.0))
|
||||
moon_intensity_curve.add_point(Vector2(0.85, 0.3))
|
||||
moon_intensity_curve.add_point(Vector2(0.15, 0.3))
|
||||
moon_intensity_curve.add_point(Vector2(0.22, 0.0))
|
||||
moon_intensity_curve.add_point(Vector2(0.85, 0.0))
|
||||
moon_intensity_curve.add_point(Vector2(0.92, 0.3))
|
||||
moon_intensity_curve.add_point(Vector2(1.0, 0.4))
|
||||
|
||||
if ambient_color_curve == null:
|
||||
@@ -133,11 +138,13 @@ func _initialize_default_curves() -> void:
|
||||
|
||||
if ambient_intensity_curve == null:
|
||||
ambient_intensity_curve = Curve.new()
|
||||
ambient_intensity_curve.add_point(Vector2(0.0, 0.2))
|
||||
ambient_intensity_curve.add_point(Vector2(0.25, 0.5))
|
||||
ambient_intensity_curve.add_point(Vector2(0.5, 0.7))
|
||||
ambient_intensity_curve.add_point(Vector2(0.75, 0.5))
|
||||
ambient_intensity_curve.add_point(Vector2(1.0, 0.2))
|
||||
ambient_intensity_curve.add_point(Vector2(0.0, 0.05))
|
||||
ambient_intensity_curve.add_point(Vector2(0.2, 0.1))
|
||||
ambient_intensity_curve.add_point(Vector2(0.3, 0.5))
|
||||
ambient_intensity_curve.add_point(Vector2(0.5, 0.6))
|
||||
ambient_intensity_curve.add_point(Vector2(0.7, 0.5))
|
||||
ambient_intensity_curve.add_point(Vector2(0.85, 0.1))
|
||||
ambient_intensity_curve.add_point(Vector2(1.0, 0.05))
|
||||
|
||||
if fog_color_curve == null:
|
||||
fog_color_curve = Gradient.new()
|
||||
@@ -155,6 +162,37 @@ func _initialize_default_curves() -> void:
|
||||
fog_density_curve.add_point(Vector2(0.75, 0.015))
|
||||
fog_density_curve.add_point(Vector2(1.0, 0.02))
|
||||
|
||||
if sky_top_color_curve == null:
|
||||
sky_top_color_curve = Gradient.new()
|
||||
sky_top_color_curve.set_color(0, Color(0.01, 0.01, 0.04)) # Midnight
|
||||
sky_top_color_curve.add_point(0.2, Color(0.03, 0.05, 0.1)) # Pre-dawn
|
||||
sky_top_color_curve.add_point(0.3, Color(0.18, 0.35, 0.8)) # Morning
|
||||
sky_top_color_curve.add_point(0.5, Color(0.15, 0.35, 0.82)) # Noon
|
||||
sky_top_color_curve.add_point(0.75, Color(0.12, 0.15, 0.4)) # Sunset
|
||||
sky_top_color_curve.add_point(0.85, Color(0.02, 0.02, 0.06)) # Dusk end
|
||||
sky_top_color_curve.set_color(1, Color(0.01, 0.01, 0.04)) # Midnight
|
||||
|
||||
if sky_horizon_color_curve == null:
|
||||
sky_horizon_color_curve = Gradient.new()
|
||||
sky_horizon_color_curve.set_color(0, Color(0.03, 0.04, 0.08)) # Midnight
|
||||
sky_horizon_color_curve.add_point(0.2, Color(0.3, 0.22, 0.28)) # Pre-dawn
|
||||
sky_horizon_color_curve.add_point(0.25, Color(0.85, 0.55, 0.45))# Dawn
|
||||
sky_horizon_color_curve.add_point(0.35, Color(0.45, 0.6, 0.85))# Morning
|
||||
sky_horizon_color_curve.add_point(0.5, Color(0.5, 0.65, 0.88)) # Noon
|
||||
sky_horizon_color_curve.add_point(0.75, Color(0.95, 0.45, 0.25))# Sunset
|
||||
sky_horizon_color_curve.add_point(0.85, Color(0.06, 0.06, 0.1))# Dusk end
|
||||
sky_horizon_color_curve.set_color(1, Color(0.03, 0.04, 0.08)) # Midnight
|
||||
|
||||
if sky_bottom_color_curve == null:
|
||||
sky_bottom_color_curve = Gradient.new()
|
||||
sky_bottom_color_curve.set_color(0, Color(0.02, 0.02, 0.05)) # Midnight
|
||||
sky_bottom_color_curve.add_point(0.2, Color(0.12, 0.1, 0.15)) # Pre-dawn
|
||||
sky_bottom_color_curve.add_point(0.3, Color(0.35, 0.45, 0.55)) # Morning
|
||||
sky_bottom_color_curve.add_point(0.5, Color(0.35, 0.45, 0.55)) # Noon
|
||||
sky_bottom_color_curve.add_point(0.75, Color(0.3, 0.2, 0.2)) # Sunset
|
||||
sky_bottom_color_curve.add_point(0.85, Color(0.03, 0.03, 0.06))# Dusk end
|
||||
sky_bottom_color_curve.set_color(1, Color(0.02, 0.02, 0.05)) # Midnight
|
||||
|
||||
if stars_visibility_curve == null:
|
||||
stars_visibility_curve = Curve.new()
|
||||
stars_visibility_curve.add_point(Vector2(0.0, 1.0))
|
||||
@@ -286,6 +324,24 @@ func get_stars_visibility() -> float:
|
||||
return 0.0
|
||||
|
||||
|
||||
func get_sky_top_color() -> Color:
|
||||
if sky_top_color_curve:
|
||||
return sky_top_color_curve.sample(time_of_day)
|
||||
return Color(0.2, 0.4, 0.8)
|
||||
|
||||
|
||||
func get_sky_horizon_color() -> Color:
|
||||
if sky_horizon_color_curve:
|
||||
return sky_horizon_color_curve.sample(time_of_day)
|
||||
return Color(0.6, 0.7, 0.9)
|
||||
|
||||
|
||||
func get_sky_bottom_color() -> Color:
|
||||
if sky_bottom_color_curve:
|
||||
return sky_bottom_color_curve.sample(time_of_day)
|
||||
return Color(0.4, 0.5, 0.6)
|
||||
|
||||
|
||||
func is_daytime() -> bool:
|
||||
return time_of_day >= SUNRISE_END and time_of_day < SUNSET_START
|
||||
|
||||
|
||||
Reference in New Issue
Block a user