class_name GraphicSettingPreset
extends Resource

const PATH_MSAA2D: String = "rendering/anti_aliasing/quality/msaa_2d"
const PATH_MSAA3D: String = "rendering/anti_aliasing/quality/msaa_3d"
const PATH_SSAO_QUALITY: String = "rendering/environment/ssao/quality"
const PATH_SSIL_QUALITY: String = "rendering/environment/ssil/quality"
const PATH_SSR_QUALITY: String = "rendering/environment/screen_space_reflection/roughness_quality"
const PATH_FOG_SIZE: String = "rendering/environment/volumetric_fog/volume_size"
const PATH_FOG_DEPTH: String = "rendering/environment/volumetric_fog/volume_depth"
const PATH_FOG_FILTER: String = "rendering/environment/volumetric_fog/use_filter"

@export_group("Shadows")
@export_group("Lightning")
@export_group("Textures")
@export_group("Anti-Aliasing")
@export var msaa_2d := Viewport.MSAA.MSAA_DISABLED
@export var msaa_3d := Viewport.MSAA.MSAA_DISABLED
@export_group("Textures")
@export_group("Environment")
@export var ssao := RenderingServer.EnvironmentSSAOQuality.ENV_SSAO_QUALITY_MEDIUM
@export var ssil := RenderingServer.EnvironmentSSILQuality.ENV_SSIL_QUALITY_MEDIUM
@export var ssr := RenderingServer.EnvironmentSSRRoughnessQuality.ENV_SSR_ROUGHNESS_QUALITY_LOW
@export_subgroup("Volumetric Fog")
@export_range(16, 512) var volumetric_fog_size: int = 64
@export_range(16, 512) var volumetric_fog_depth: int = 64
@export_enum("No (Faster)", "Yes (Higher Quality)") var volumetric_use_filter: int = 1


func apply_settings() -> void:
	# --Anti-Aliasing
	ProjectSettings.set_setting(PATH_MSAA2D, msaa_2d)
	ProjectSettings.set_setting(PATH_MSAA3D, msaa_3d)
	# --Environment--
	# SSAO/SSIL/SSR
	ProjectSettings.set_setting(PATH_SSAO_QUALITY, ssao)
	ProjectSettings.set_setting(PATH_SSIL_QUALITY, ssil)
	ProjectSettings.set_setting(PATH_SSR_QUALITY, ssr)
	# Volumetric Fog
	ProjectSettings.set_setting(PATH_FOG_SIZE, volumetric_fog_size)
	ProjectSettings.set_setting(PATH_FOG_DEPTH, volumetric_fog_depth)
	ProjectSettings.set_setting(PATH_FOG_FILTER, volumetric_use_filter)
