165 lines
5.7 KiB
GDScript
165 lines
5.7 KiB
GDScript
@tool
|
|
class_name SkyPreset
|
|
extends Resource
|
|
|
|
enum PresetType {
|
|
CLEAR_DAY,
|
|
SUNSET,
|
|
NIGHT,
|
|
OVERCAST,
|
|
STORM,
|
|
DAWN,
|
|
CUSTOM
|
|
}
|
|
|
|
@export var preset_name: String = "Custom"
|
|
@export var preset_type: PresetType = PresetType.CUSTOM
|
|
@export var config: SkyConfig
|
|
@export var skybox_texture: Texture2D
|
|
@export var cloud_layer_configs: Array[CloudLayerConfig]
|
|
@export var post_process_profile: PostProcessProfile
|
|
|
|
|
|
static func create_clear_day() -> SkyPreset:
|
|
var preset := SkyPreset.new()
|
|
preset.preset_name = "Clear Day"
|
|
preset.preset_type = PresetType.CLEAR_DAY
|
|
preset.config = SkyConfig.new()
|
|
preset.config.sun_color = Color(1.0, 0.95, 0.85)
|
|
preset.config.sun_intensity = 1.2
|
|
preset.config.moon_intensity = 0.0
|
|
preset.config.ambient_color = Color(0.5, 0.6, 0.8)
|
|
preset.config.ambient_intensity = 0.6
|
|
preset.config.fog_color = Color(0.7, 0.8, 0.95)
|
|
preset.config.fog_density = 0.005
|
|
preset.config.sky_top_color = Color(0.2, 0.4, 0.85)
|
|
preset.config.sky_horizon_color = Color(0.6, 0.75, 0.95)
|
|
preset.config.sky_bottom_color = Color(0.5, 0.6, 0.7)
|
|
preset.config.stars_visibility = 0.0
|
|
preset.config.cloud_coverage = 0.2
|
|
preset.config.cloud_opacity = 0.7
|
|
preset.config.sun_glow_intensity = 0.3
|
|
return preset
|
|
|
|
|
|
static func create_sunset() -> SkyPreset:
|
|
var preset := SkyPreset.new()
|
|
preset.preset_name = "Sunset"
|
|
preset.preset_type = PresetType.SUNSET
|
|
preset.config = SkyConfig.new()
|
|
preset.config.sun_color = Color(1.0, 0.5, 0.2)
|
|
preset.config.sun_intensity = 0.8
|
|
preset.config.moon_intensity = 0.0
|
|
preset.config.ambient_color = Color(0.8, 0.5, 0.4)
|
|
preset.config.ambient_intensity = 0.4
|
|
preset.config.fog_color = Color(0.9, 0.6, 0.4)
|
|
preset.config.fog_density = 0.015
|
|
preset.config.sky_top_color = Color(0.3, 0.2, 0.5)
|
|
preset.config.sky_horizon_color = Color(1.0, 0.5, 0.3)
|
|
preset.config.sky_bottom_color = Color(0.9, 0.4, 0.2)
|
|
preset.config.stars_visibility = 0.1
|
|
preset.config.cloud_coverage = 0.3
|
|
preset.config.cloud_opacity = 0.9
|
|
preset.config.cloud_color = Color(1.0, 0.7, 0.5)
|
|
preset.config.cloud_shadow_color = Color(0.4, 0.2, 0.3)
|
|
preset.config.sun_glow_intensity = 0.8
|
|
preset.config.sun_glow_size = 0.4
|
|
return preset
|
|
|
|
|
|
static func create_night() -> SkyPreset:
|
|
var preset := SkyPreset.new()
|
|
preset.preset_name = "Night"
|
|
preset.preset_type = PresetType.NIGHT
|
|
preset.config = SkyConfig.new()
|
|
preset.config.sun_intensity = 0.0
|
|
preset.config.moon_color = Color(0.7, 0.8, 1.0)
|
|
preset.config.moon_intensity = 0.4
|
|
preset.config.ambient_color = Color(0.1, 0.15, 0.25)
|
|
preset.config.ambient_intensity = 0.2
|
|
preset.config.fog_color = Color(0.1, 0.12, 0.2)
|
|
preset.config.fog_density = 0.02
|
|
preset.config.sky_top_color = Color(0.02, 0.03, 0.08)
|
|
preset.config.sky_horizon_color = Color(0.1, 0.12, 0.2)
|
|
preset.config.sky_bottom_color = Color(0.05, 0.06, 0.1)
|
|
preset.config.stars_visibility = 1.0
|
|
preset.config.cloud_coverage = 0.15
|
|
preset.config.cloud_opacity = 0.5
|
|
preset.config.cloud_color = Color(0.2, 0.22, 0.3)
|
|
preset.config.cloud_shadow_color = Color(0.05, 0.05, 0.1)
|
|
preset.config.sun_glow_intensity = 0.0
|
|
return preset
|
|
|
|
|
|
static func create_overcast() -> SkyPreset:
|
|
var preset := SkyPreset.new()
|
|
preset.preset_name = "Overcast"
|
|
preset.preset_type = PresetType.OVERCAST
|
|
preset.config = SkyConfig.new()
|
|
preset.config.sun_color = Color(0.9, 0.9, 0.85)
|
|
preset.config.sun_intensity = 0.4
|
|
preset.config.moon_intensity = 0.0
|
|
preset.config.ambient_color = Color(0.5, 0.5, 0.55)
|
|
preset.config.ambient_intensity = 0.7
|
|
preset.config.fog_color = Color(0.6, 0.62, 0.65)
|
|
preset.config.fog_density = 0.03
|
|
preset.config.sky_top_color = Color(0.45, 0.48, 0.55)
|
|
preset.config.sky_horizon_color = Color(0.6, 0.62, 0.65)
|
|
preset.config.sky_bottom_color = Color(0.5, 0.52, 0.55)
|
|
preset.config.stars_visibility = 0.0
|
|
preset.config.cloud_coverage = 0.9
|
|
preset.config.cloud_opacity = 1.0
|
|
preset.config.cloud_color = Color(0.7, 0.72, 0.75)
|
|
preset.config.cloud_shadow_color = Color(0.4, 0.42, 0.45)
|
|
preset.config.sun_glow_intensity = 0.1
|
|
return preset
|
|
|
|
|
|
static func create_storm() -> SkyPreset:
|
|
var preset := SkyPreset.new()
|
|
preset.preset_name = "Storm"
|
|
preset.preset_type = PresetType.STORM
|
|
preset.config = SkyConfig.new()
|
|
preset.config.sun_color = Color(0.7, 0.7, 0.75)
|
|
preset.config.sun_intensity = 0.2
|
|
preset.config.moon_intensity = 0.0
|
|
preset.config.ambient_color = Color(0.35, 0.38, 0.45)
|
|
preset.config.ambient_intensity = 0.5
|
|
preset.config.fog_color = Color(0.4, 0.42, 0.5)
|
|
preset.config.fog_density = 0.05
|
|
preset.config.sky_top_color = Color(0.25, 0.28, 0.35)
|
|
preset.config.sky_horizon_color = Color(0.4, 0.42, 0.48)
|
|
preset.config.sky_bottom_color = Color(0.35, 0.38, 0.42)
|
|
preset.config.stars_visibility = 0.0
|
|
preset.config.cloud_coverage = 1.0
|
|
preset.config.cloud_opacity = 1.0
|
|
preset.config.cloud_color = Color(0.4, 0.42, 0.5)
|
|
preset.config.cloud_shadow_color = Color(0.2, 0.22, 0.28)
|
|
preset.config.sun_glow_intensity = 0.0
|
|
return preset
|
|
|
|
|
|
static func create_dawn() -> SkyPreset:
|
|
var preset := SkyPreset.new()
|
|
preset.preset_name = "Dawn"
|
|
preset.preset_type = PresetType.DAWN
|
|
preset.config = SkyConfig.new()
|
|
preset.config.sun_color = Color(1.0, 0.7, 0.5)
|
|
preset.config.sun_intensity = 0.5
|
|
preset.config.moon_intensity = 0.1
|
|
preset.config.ambient_color = Color(0.4, 0.35, 0.45)
|
|
preset.config.ambient_intensity = 0.35
|
|
preset.config.fog_color = Color(0.6, 0.5, 0.55)
|
|
preset.config.fog_density = 0.025
|
|
preset.config.sky_top_color = Color(0.15, 0.2, 0.45)
|
|
preset.config.sky_horizon_color = Color(0.9, 0.6, 0.5)
|
|
preset.config.sky_bottom_color = Color(0.7, 0.45, 0.4)
|
|
preset.config.stars_visibility = 0.3
|
|
preset.config.cloud_coverage = 0.25
|
|
preset.config.cloud_opacity = 0.8
|
|
preset.config.cloud_color = Color(0.95, 0.7, 0.6)
|
|
preset.config.cloud_shadow_color = Color(0.3, 0.25, 0.35)
|
|
preset.config.sun_glow_intensity = 0.6
|
|
preset.config.sun_glow_size = 0.35
|
|
return preset
|