diff --git a/FuncGodot Entities/GD Script/modular_worldspawn/entities/worldspawn.gd b/FuncGodot Entities/GD Script/modular_worldspawn/entities/worldspawn.gd new file mode 100644 index 0000000..a9361e9 --- /dev/null +++ b/FuncGodot Entities/GD Script/modular_worldspawn/entities/worldspawn.gd @@ -0,0 +1,449 @@ +@tool +extends WorldEnvironment + +@export var mapname: String = "" +@export var music: String = "" + +func _func_godot_apply_properties(props: Dictionary) -> void: + mapname = props["mapname"] as String + music = props["music"] as String + + var env: Environment = Environment.new() + + #region Background + # Background + if props.has["bg_mode"]: + env.background_mode = Environment.BGMode + else: + env.background_mode = Environment.BG_COLOR + if props.has("bg_color"): + env.background_color = props["bg_color"] as Color + else: + env.background_color = Color.BLACK + if props.has("bg_energy_multiplier"): + env.background_energy_multiplier = props["bg_energy_multiplier"] as float + else: + env.background_energy_multiplier = 1.0 + if env.background_mode == Environment.BG_CANVAS: + if props.has("bg_canvas_max_layer"): + env.background_canvas_max_layer = props["bg_canvas_max_layer"] as int + else: + env.background_canvas_max_layer = 0 + if env.background_mode == Environment.BG_CAMERA_FEED: + if props.has("bg_camera_feed_id"): + env.background_camera_feed_id = props["bg_camera_feed_id"] as int + else: + env.background_camera_feed_id = 1 + #endregion + + #region Sky + if env.background_mode == Environment.BG_SKY: + var sky: Sky = Sky.new() + if props.has("sky_material"): + if ResourceLoader.exists(props["sky_material"] as String): + var sky_mat: Resource = load(props["sky"] as String) + if sky_mat is ShaderMaterial or sky_mat is PanoramaSkyMaterial or sky_mat is ProceduralSkyMaterial or sky_mat is PhysicalSkyMaterial: + sky.sky_material = sky_mat + if props.has("sky_radiance_size"): + sky.radiance_size = props["sky_radiance_size"] as Sky.RadianceSize + else: + sky.radiance_size = Sky.RADIANCE_SIZE_256 + if props.has("sky_process_mode"): + sky.process_mode = props["sky_process_mode"] as Sky.ProcessMode + else: + sky.process_mode = Sky.PROCESS_MODE_AUTOMATIC + if props.has("sky_fov"): + env.sky_custom_fov = props["sky_fov"] as float + else: + env.sky_custom_fov = 0.0 + if props.has("sky_rotation"): + env.sky_rotation = props["sky_rotation"] as Vector3 + else: + env.sky_rotation = Vector3.ZERO + #endregion + + #region Ambient Light + if props.has("ambient_light_source"): + env.ambient_light_source = props["ambient_light_source"] as Environment.AmbientSource + else: + env.ambient_light_source = Environment.AMBIENT_SOURCE_COLOR + if env.ambient_light_source != Environment.AMBIENT_SOURCE_DISABLED: + if props.has("ambient_light_color"): + env.ambient_light_color = props["ambient_light_color"] as Color + else: + env.ambient_light_color = Color.WHITE + if env.background_mode != Environment.AMBIENT_SOURCE_COLOR: + if props.has("ambient_light_sky_contribution"): + env.ambient_light_sky_contribution = props["ambient_light_sky_contribution"] as float + else: + env.ambient_light_sky_contribution = 1.0 + if props.has("ambient_light_energy"): + env.ambient_light_energy = props["ambient_light_energy"] as float + else: + env.ambient_light_energy = 1.0 + #endregion + + #region Reflected Light + if props.has("reflected_light_source"): + env.reflected_light_source = props["reflected_light_source"] as Environment.ReflectionSource + else: + env.reflected_light_source = Environment.REFLECTION_SOURCE_DISABLED + #endregion + + #region Tonemap + if props.has("tonemap_mode"): + env.tonemap_mode = props["tonemap_mode"] as Environment.ToneMapper + else: + env.tonemap_mode = Environment.TONE_MAPPER_LINEAR + if props.has("tonemap_exposure"): + env.tonemap_exposure = props["tonemap_exposure"] as float + else: + env.tonemap_exposure = 1.0 + if env.tonemap_mode != Environment.TONE_MAPPER_LINEAR: + if props.has("tonemap_white"): + env.tonemap_white = props["tonemap_white"] as float + else: + env.tonemap_white = 1.0 + #endregion + + #region Screen Space Reflections + if props.has("ssr_enabled"): + env.ssr_enabled = props["ssr_enabled"] as bool + else: + env.ssr_enabled = false + if env.ssr_enabled: + if props.has("ssr_max_steps"): + env.ssr_max_steps = props["ssr_max_steps"] as int + else: + env.ssr_max_steps = 64 + if props.has("ssr_fade_in"): + env.ssr_fade_in = props["ssr_fade_in"] as float + else: + env.ssr_fade_in = 0.15 + if props.has("ssr_fade_out"): + env.ssr_fade_out = props["ssr_fade_out"] as float + else: + env.ssr_fade_out = 2.0 + if props.has("ssr_depth_tolerance"): + env.ssr_depth_tolerance = props["ssr_depth_tolerance"] as float + else: + env.ssr_depth_tolerance = 0.2 + #endregion + + #region Screen Space Ambient Occlusion + if props.has("ssao_enabled"): + env.ssao_enabled = props["ssao_enabled"] as bool + else: + env.ssao_enabled = false + if env.ssao_enabled: + if props.has("ssao_radius"): + env.ssao_radius = props["ssao_radius"] as float + else: + env.ssao_radius = 1.0 + if props.has("ssao_intensity"): + env.ssao_intensity = props["ssao_intensity"] as float + else: + env.ssao_intensity = 2.0 + if props.has("ssao_power"): + env.ssao_power = props["ssao_power"] as float + else: + env.ssao_power = 1.5 + if props.has("ssao_detail"): + env.ssao_detail = props["ssao_detail"] as float + else: + env.ssao_detail = 0.5 + if props.has("ssao_horizon"): + env.ssao_horizon = props["ssao_horizon"] as float + else: + env.ssao_horizon = 0.06 + if props.has("ssao_sharpness"): + env.ssao_sharpness = props["ssao_sharpness"] as float + else: + env.ssao_sharpness = 0.98 + if props.has("ssao_light_affect"): + env.ssao_light_affect = props["ssao_light_affect"] as float + else: + env.ssao_light_affect = 0.0 + if props.has("ssao_ao_channel_affect"): + env.ssao_ao_channel_affect = props["ssao_ao_channel_affect"] as float + else: + env.ssao_ao_channel_affect = 0.0 + #endregion + + #region Screen Space Indirect Lighting + if props.has("ssil_enabled"): + env.ssil_enabled = props["ssil_enabled"] as bool + else: + env.ssil_enabled = false + if env.ssil_enabled: + if props.has("ssil_radius"): + env.ssil_radius = props["ssil_radius"] as float + else: + env.ssil_radius = 5.0 + if props.has("ssil_intensity"): + env.ssil_intensity = props["ssil_intensity"] as float + else: + env.ssil_intensity = 1.0 + if props.has("ssil_sharpness"): + env.ssil_sharpness = props["ssil_sharpness"] as float + else: + env.ssil_sharpness = 0.98 + if props.has("ssil_normal_rejection"): + env.ssil_normal_rejection = props["ssil_normal_rejection"] as float + else: + env.ssil_normal_rejection = 1.0 + #endregion + + #region Signed Distance Field Global Illumination + if props.has("sdfgi_enabled"): + env.sdfgi_enabled = props["sdfgi_enabled"] as bool + else: + env.sdfgi_enabled = false + if env.sdfgi_enabled: + if props.has("sdfgi_use_occlusion"): + env.sdfgi_use_occlusion = props["sdfgi_use_occlusion"] as bool + else: + env.sdfgi_use_occlusion = false + if props.has("sdfgi_read_sky_light"): + env.sdfgi_read_sky_light = props["sdfgi_read_sky_light"] as bool + else: + env.sdfgi_read_sky_light = true + if props.has("sdfgi_bounce_feedback"): + env.sdfgi_bounce_feedback = props["sdfgi_bounce_feedback"] as float + else: + env.sdfgi_bounce_feedback = 0.5 + if props.has("sdfgi_cascades"): + env.sdfgi_cascades = props["sdfgi_cascades"] as int + else: + env.sdfgi_cascades = 4 + if props.has("sdfgi_min_cell_size"): + env.sdfgi_min_cell_size = props["sdfgi_min_cell_size"] as float + else: + env.sdfgi_min_cell_size = 0.2 + if props.has("sdfgi_cascade0_distance"): + env.sdfgi_cascade0_distance = props["sdfgi_cascade0_distance"] as float + else: + env.sdfgi_cascade0_distance = 12.8 + if props.has("sdfgi_max_distance"): + env.sdfgi_max_distance = props["sdfgi_max_distance"] as float + else: + env.sdfgi_max_distance = 204.8 + if props.has("sdfgi_y_scale"): + env.sdfgi_y_scale = props["sdfgi_y_scale"] as Environment.SDFGIYScale + else: + env.sdfgi_y_scale = Environment.SDFGI_Y_SCALE_75_PERCENT + if props.has("sdfgi_energy"): + env.sdfgi_energy = props["sdfgi_energy"] as float + else: + env.sdfgi_energy = 1.0 + if props.has("sdfgi_normal_bias"): + env.sdfgi_normal_bias = props["sdfgi_normal_bias"] as float + else: + env.sdfgi_normal_bias = 1.1 + if props.has("sdfgi_probe_bias"): + env.sdfgi_probe_bias = props["sdfgi_probe_bias"] as float + else: + env.sdfgi_probe_bias = 1.1 + #endregion + + #region Glow + if props.has("glow_enabled"): + env.glow_enabled = props["glow_enabled"] as bool + else: + env.glow_enabled = false + if env.glow_enabled: + for i in range(1, 7): + var glow_level_key: String = "glow_level_" + str(i) + var glow_level_prop: String = "glow_level/" + str(i) + if props.has(glow_level_key): + env.set(glow_level_prop, props[glow_level_key] as float) + else: + match i: + 3, 5: + env.set(glow_level_prop, 1.0) + _: + env.set(glow_level_prop, 0.0) + if props.has("glow_normalized"): + env.glow_normalized = props["glow_normalized"] as bool + else: + env.glow_normalized = false + if props.has("glow_intensity"): + env.glow_intensity = props["glow_intensity"] as float + else: + env.glow_intensity = 0.8 + if props.has("glow_strength"): + env.glow_strength = props["glow_strength"] as float + else: + env.glow_strength = 1.0 + if props.has("glow_bloom"): + env.glow_bloom = props["glow_bloom"] as float + else: + env.glow_bloom = 0.0 + if props.has("glow_blend_mode"): + env.glow_blend_mode = props["glow_blend_mode"] as Environment.GlowBlendMode + else: + env.glow_blend_mode = Environment.GLOW_BLEND_MODE_SOFTLIGHT + if props.has("glow_hdr_threshold"): + env.glow_hdr_threshold = props["glow_hdr_threshold"] as float + else: + env.glow_hdr_threshold = 1.0 + if props.has("glow_hdr_scale"): + env.glow_hdr_scale = props["glow_hdr_scale"] as float + else: + env.glow_hdr_scale = 2.0 + if props.has("glow_hdr_luminance_cap"): + env.glow_hdr_luminance_cap = props["glow_hdr_luminance_cap"] as float + else: + env.glow_hdr_luminance_cap = 12.0 + env.glow_map = null + if props.has("glow_map_image_path"): + if ResourceLoader.exists(props["glow_map_image_path"] as String): + var map_img: Resource = load(props["glow_map_image_path"]) + if map_img is Texture: + env.glow_map = map_img + if env.glow_map != null: + if props.has("glow_map_strength"): + env.glow_map_strength = props["glow_map_strength"] as float + else: + env.glow_map_strength = 0.8 + #endregion + + #region Fog + if props.has("fog_enabled"): + env.fog_enabled = props["fog_enabled"] as bool + else: + env.fog_enabled = false + if env.fog_enabled: + if props.has("fog_mode"): + env.fog_mode = props["fog_mode"] as Environment.FogMode + else: + env.fog_mode = Environment.FOG_MODE_EXPONENTIAL + if props.has("fog_light_color"): + env.fog_light_color = props["fog_light_color"] as Color + else: + env.fog_light_color = Color("848d9b") + if props.has("fog_light_energy"): + env.fog_light_energy = props["fog_light_energy"] as float + else: + env.fog_light_energy = 1.0 + if props.has("fog_sun_scatter"): + env.fog_sun_scatter = props["fog_sun_scatter"] as float + else: + env.fog_sun_scatter = 0.0 + if props.has("fog_density"): + env.fog_density = props["fog_density"] as float + else: + if env.fog_mode == Environment.FOG_MODE_EXPONENTIAL: + env.fog_density = 0.01 + else: + env.fog_density = 1.0 + if props.has("fog_sky_affect"): + env.fog_sky_affect = props["fog_sky_affect"] as float + else: + env.fog_sky_affect = 1.0 + if props.has("fog_height"): + env.fog_height = props["fog_height"] as float + else: + env.fog_height = 0.0 + if props.has("fog_height_density"): + env.fog_height_density = props["fog_height_density"] as float + else: + env.fog_height_density = 0.0 + if env.fog_mode == Environment.FOG_MODE_DEPTH: + if props.has("fog_depth_curve"): + env.fog_depth_curve = props["fog_depth_curve"] as float + else: + env.fog_depth_curve = 1.0 + if props.has("fog_depth_begin"): + env.fog_depth_begin = props["fog_depth_begin"] as float + else: + env.fog_depth_begin = 10.0 + if props.has("fog_depth_end"): + env.fog_depth_end = props["fog_depth_end"] as float + else: + env.fog_depth_end = 100.0 + #endregion + + #region Volumetric Fog + if props.has("volumetric_fog_enabled"): + env.volumetric_fog_enabled = props["volumetric_fog_enabled"] as bool + else: + env.volumetric_fog_enabled = false + if env.volumetric_fog_enabled: + if props.has("volumetric_fog_density"): + env.volumetric_fog_density = props["volumetric_fog_density"] as float + else: + env.volumetric_fog_density = 0.05 + if props.has("volumetric_fog_albedo"): + env.volumetric_fog_albedo = props["volumetric_fog_albedo"] as Color + else: + env.volumetric_fog_albedo = Color.WHITE + if props.has("volumetric_fog_emission"): + env.volumetric_fog_emission = props["volumetric_fog_emission"] as Color + else: + env.volumetric_fog_emission = Color.BLACK + if props.has("volumetric_fog_emission_energy"): + env.volumetric_fog_emission_energy = props["volumetric_fog_emission_energy"] as float + else: + env.volumetric_fog_emission_energy = 1.0 + if props.has("volumetric_fog_gi_inject"): + env.volumetric_fog_gi_inject = props["volumetric_fog_gi_inject"] as float + else: + env.volumetric_fog_gi_inject = 1.0 + if props.has("volumetric_fog_anisotropy"): + env.volumetric_fog_anisotropy = props["volumetric_fog_anisotropy"] as float + else: + env.volumetric_fog_anisotropy = 0.2 + if props.has("volumetric_fog_length"): + env.volumetric_fog_length = props["volumetric_fog_length"] as float + else: + env.volumetric_fog_length = 64.0 + if props.has("volumetric_fog_detail_spread"): + env.volumetric_fog_detail_spread = props["volumetric_fog_detail_spread"] as float + else: + env.volumetric_fog_detail_spread = 2.0 + if props.has("volumetric_fog_ambient_inject"): + env.volumetric_fog_ambient_inject = props["volumetric_fog_ambient_inject"] as float + else: + env.volumetric_fog_ambient_inject = 0.0 + if props.has("volumetric_fog_sky_affect"): + env.volumetric_fog_sky_affect = props["volumetric_fog_sky_affect"] as float + else: + env.volumetric_fog_sky_affect = 1.0 + if props.has("volumetric_fog_temporal_reprojection_enabled"): + env.volumetric_fog_temporal_reprojection_enabled = props["volumetric_fog_temporal_reprojection_enabled"] as bool + else: + env.volumetric_fog_temporal_reprojection_enabled = true + if env.volumetric_fog_temporal_reprojection_enabled: + if props.has("volumetric_fog_temporal_reprojection_amount"): + env.volumetric_fog_temporal_reprojection_amount = props["volumetric_fog_temporal_reprojection_amount"] as float + else: + env.volumetric_fog_temporal_reprojection_amount = 0.9 + #endregion + + #region Adjustments + if props.has("adjustment_enabled"): + env.adjustment_enabled = props["adjustment_enabled"] as bool + else: + env.adjustment_enabled = false + if env.adjustment_enabled: + if props.has("adjustment_brightness"): + env.adjustment_brightness = props["adjustment_brightness"] as float + else: + env.adjustment_brightness = 1.0 + if props.has("adjustment_contrast"): + env.adjustment_contrast = props["adjustment_contrast"] as float + else: + env.adjustment_contast = 1.0 + if props.has("adjustment_saturation"): + env.adjustment_saturation = props["adjustment_saturation"] as float + else: + env.adjustment_saturation = 1.0 + if props.has("adjustment_color_correction_path"): + if ResourceLoader.exists(props["adjustment_color_correction_path"] as String): + var cc: Resource = load(props["adjustment_color_correction_path"] as String) + if cc is Texture2D or cc is Texture3D: + env.adjustment_color_correction = cc + #endregion + + environment = env diff --git a/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_adj.tres b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_adj.tres new file mode 100644 index 0000000..fdb14f6 --- /dev/null +++ b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_adj.tres @@ -0,0 +1,25 @@ +[gd_resource type="Resource" script_class="FuncGodotFGDBaseClass" load_steps=2 format=3 uid="uid://x7t67m1uo617"] + +[ext_resource type="Script" path="res://addons/func_godot/src/fgd/func_godot_fgd_base_class.gd" id="1_a4lu3"] + +[resource] +script = ExtResource("1_a4lu3") +classname = "Worldspawn_Adjustments" +description = "" +func_godot_internal = false +base_classes = Array[Resource]([]) +class_properties = { +"adjustment_brightness": 1.0, +"adjustment_color_correction_path": "", +"adjustment_contrast": 1.0, +"adjustment_enabled": false, +"adjustment_saturation": 1.0 +} +class_property_descriptions = {} +auto_apply_to_matching_node_properties = false +meta_properties = { +"color": Color(0.8, 0.8, 0.8, 1), +"size": AABB(-8, -8, -8, 8, 8, 8) +} +node_class = "" +name_property = "" diff --git a/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_amb.tres b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_amb.tres new file mode 100644 index 0000000..2b8e8aa --- /dev/null +++ b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_amb.tres @@ -0,0 +1,31 @@ +[gd_resource type="Resource" script_class="FuncGodotFGDBaseClass" load_steps=2 format=3 uid="uid://cxckph0lt4js5"] + +[ext_resource type="Script" path="res://addons/func_godot/src/fgd/func_godot_fgd_base_class.gd" id="1_3h5po"] + +[resource] +script = ExtResource("1_3h5po") +classname = "Worldspawn_AmbientLight" +description = "" +func_godot_internal = false +base_classes = Array[Resource]([]) +class_properties = { +"ambient_light_color": Color(1, 1, 1, 1), +"ambient_light_energy": 1.0, +"ambient_light_sky_contribution": 1.0, +"ambient_light_source": { +"background": 0, +"color": 2, +"disabled": 1, +"sky": 3 +} +} +class_property_descriptions = { +"ambient_light_source": ["", 2] +} +auto_apply_to_matching_node_properties = false +meta_properties = { +"color": Color(0.8, 0.8, 0.8, 1), +"size": AABB(-8, -8, -8, 8, 8, 8) +} +node_class = "" +name_property = "" diff --git a/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_bg.tres b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_bg.tres new file mode 100644 index 0000000..6cfe593 --- /dev/null +++ b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_bg.tres @@ -0,0 +1,34 @@ +[gd_resource type="Resource" script_class="FuncGodotFGDBaseClass" load_steps=2 format=3 uid="uid://c53s30pt2h3rj"] + +[ext_resource type="Script" path="res://addons/func_godot/src/fgd/func_godot_fgd_base_class.gd" id="1_u5atl"] + +[resource] +script = ExtResource("1_u5atl") +classname = "Worldspawn_BG" +description = "" +func_godot_internal = false +base_classes = Array[Resource]([]) +class_properties = { +"bg_camera_feed_id": 1, +"bg_canvas_max_layer": 0, +"bg_color": Color(0, 0, 0, 1), +"bg_energy_multiplier": 1.0, +"bg_mode": { +"camera_feed": 5, +"canvas": 3, +"clear_color": 0, +"color": 1, +"keep": 4, +"sky": 2 +} +} +class_property_descriptions = { +"bg_mode": ["", 1] +} +auto_apply_to_matching_node_properties = false +meta_properties = { +"color": Color(0.8, 0.8, 0.8, 1), +"size": AABB(-8, -8, -8, 8, 8, 8) +} +node_class = "" +name_property = "" diff --git a/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_fog.tres b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_fog.tres new file mode 100644 index 0000000..94f95b8 --- /dev/null +++ b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_fog.tres @@ -0,0 +1,37 @@ +[gd_resource type="Resource" script_class="FuncGodotFGDBaseClass" load_steps=2 format=3 uid="uid://cg8y28cc5be80"] + +[ext_resource type="Script" path="res://addons/func_godot/src/fgd/func_godot_fgd_base_class.gd" id="1_dlwy0"] + +[resource] +script = ExtResource("1_dlwy0") +classname = "Worldspawn_Fog" +description = "" +func_godot_internal = false +base_classes = Array[Resource]([]) +class_properties = { +"fog_density": 0.01, +"fog_depth_begin": 10.0, +"fog_depth_curve": 1.0, +"fog_depth_end": 100.0, +"fog_enabled": false, +"fog_height": 0.0, +"fog_height_density": 0.0, +"fog_light_color": Color(0.517647, 0.552941, 0.607843, 1), +"fog_light_energy": 1.0, +"fog_mode": { +"depth": 1, +"exponential": 0 +}, +"fog_sky_affect": 1.0, +"fog_sun_scatter": 0.0 +} +class_property_descriptions = { +"fog_mode": ["", 0] +} +auto_apply_to_matching_node_properties = false +meta_properties = { +"color": Color(0.8, 0.8, 0.8, 1), +"size": AABB(-8, -8, -8, 8, 8, 8) +} +node_class = "" +name_property = "" diff --git a/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_glow.tres b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_glow.tres new file mode 100644 index 0000000..597d574 --- /dev/null +++ b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_glow.tres @@ -0,0 +1,46 @@ +[gd_resource type="Resource" script_class="FuncGodotFGDBaseClass" load_steps=2 format=3 uid="uid://bkcb80nihb3ta"] + +[ext_resource type="Script" path="res://addons/func_godot/src/fgd/func_godot_fgd_base_class.gd" id="1_056wq"] + +[resource] +script = ExtResource("1_056wq") +classname = "Worldspawn_Glow" +description = "" +func_godot_internal = false +base_classes = Array[Resource]([]) +class_properties = { +"glow_blend_mode": { +"additive": 0, +"mix": 4, +"replace": 3, +"screen": 1, +"softlight": 2 +}, +"glow_bloom": 0.0, +"glow_enabled": false, +"glow_hdr_luminance_cap": 12.0, +"glow_hdr_scale": 2.0, +"glow_hdr_threshold": 1.0, +"glow_intensity": 0.8, +"glow_level_1": 0.0, +"glow_level_2": 0.0, +"glow_level_3": 1.0, +"glow_level_4": 0.0, +"glow_level_5": 1.0, +"glow_level_6": 0.0, +"glow_level_7": 0.0, +"glow_map_image_path": "", +"glow_map_strength": 0.8, +"glow_normalized": false, +"glow_strength": 1.0 +} +class_property_descriptions = { +"glow_blend_mode": ["", 2] +} +auto_apply_to_matching_node_properties = false +meta_properties = { +"color": Color(0.8, 0.8, 0.8, 1), +"size": AABB(-8, -8, -8, 8, 8, 8) +} +node_class = "" +name_property = "" diff --git a/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_ref_lit.tres b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_ref_lit.tres new file mode 100644 index 0000000..a1e900d --- /dev/null +++ b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_ref_lit.tres @@ -0,0 +1,27 @@ +[gd_resource type="Resource" script_class="FuncGodotFGDBaseClass" load_steps=2 format=3 uid="uid://bstf13ywqtowx"] + +[ext_resource type="Script" path="res://addons/func_godot/src/fgd/func_godot_fgd_base_class.gd" id="1_fc7om"] + +[resource] +script = ExtResource("1_fc7om") +classname = "Worldspawn_ReflectedLightSource" +description = "" +func_godot_internal = false +base_classes = Array[Resource]([]) +class_properties = { +"reflected_light_source": { +"background": 0, +"disabled": 1, +"sky": 2 +} +} +class_property_descriptions = { +"reflected_light_source": ["", 1] +} +auto_apply_to_matching_node_properties = false +meta_properties = { +"color": Color(0.8, 0.8, 0.8, 1), +"size": AABB(-8, -8, -8, 8, 8, 8) +} +node_class = "" +name_property = "" diff --git a/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_sdfgi.tres b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_sdfgi.tres new file mode 100644 index 0000000..6eebf53 --- /dev/null +++ b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_sdfgi.tres @@ -0,0 +1,38 @@ +[gd_resource type="Resource" script_class="FuncGodotFGDBaseClass" load_steps=2 format=3 uid="uid://dxo6wswuhjbgp"] + +[ext_resource type="Script" path="res://addons/func_godot/src/fgd/func_godot_fgd_base_class.gd" id="1_srmf6"] + +[resource] +script = ExtResource("1_srmf6") +classname = "Worldspawn_SDFGI" +description = "" +func_godot_internal = false +base_classes = Array[Resource]([]) +class_properties = { +"sdfgi_bounce_feedback": 0.5, +"sdfgi_cascade0_distance": 12.8, +"sdfgi_cascades": 4, +"sdfgi_enabled": false, +"sdfgi_energy": 1.0, +"sdfgi_max_distance": 204.8, +"sdfgi_min_cell_size": 0.2, +"sdfgi_normal_bias": 1.1, +"sdfgi_probe_bias": 1.1, +"sdfgi_read_sky_light": true, +"sdfgi_use_occlusion": false, +"sdfgi_y_scale": { +"100 Percent": 2, +"50 Percent": 0, +"75 Percent": 1 +} +} +class_property_descriptions = { +"sdfgi_y_scale": ["", 1] +} +auto_apply_to_matching_node_properties = false +meta_properties = { +"color": Color(0.8, 0.8, 0.8, 1), +"size": AABB(-8, -8, -8, 8, 8, 8) +} +node_class = "" +name_property = "" diff --git a/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_sky.tres b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_sky.tres new file mode 100644 index 0000000..c5f625b --- /dev/null +++ b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_sky.tres @@ -0,0 +1,41 @@ +[gd_resource type="Resource" script_class="FuncGodotFGDBaseClass" load_steps=2 format=3 uid="uid://b3h3ebmyf1tgi"] + +[ext_resource type="Script" path="res://addons/func_godot/src/fgd/func_godot_fgd_base_class.gd" id="1_vjd74"] + +[resource] +script = ExtResource("1_vjd74") +classname = "Worldspawn_Sky" +description = "" +func_godot_internal = false +base_classes = Array[Resource]([]) +class_properties = { +"sky_fov": 0.0, +"sky_material": "", +"sky_process_mode": { +"automatic": 0, +"incremental": 2, +"quality": 1, +"realtime": 3 +}, +"sky_radiance_size": { +"1024": 5, +"128": 2, +"2048": 6, +"256": 3, +"32": 0, +"512": 4, +"64": 1 +}, +"sky_rotation": Vector3(0, 0, 0) +} +class_property_descriptions = { +"sky_process_mode": ["", 0], +"sky_radiance_size": ["", 3] +} +auto_apply_to_matching_node_properties = false +meta_properties = { +"color": Color(0.8, 0.8, 0.8, 1), +"size": AABB(-8, -8, -8, 8, 8, 8) +} +node_class = "" +name_property = "" diff --git a/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_ssao.tres b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_ssao.tres new file mode 100644 index 0000000..2532013 --- /dev/null +++ b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_ssao.tres @@ -0,0 +1,29 @@ +[gd_resource type="Resource" script_class="FuncGodotFGDBaseClass" load_steps=2 format=3 uid="uid://b6cs7giu705jj"] + +[ext_resource type="Script" path="res://addons/func_godot/src/fgd/func_godot_fgd_base_class.gd" id="1_nkdgd"] + +[resource] +script = ExtResource("1_nkdgd") +classname = "Worldspawn_SSAO" +description = "" +func_godot_internal = false +base_classes = Array[Resource]([]) +class_properties = { +"ssao_ao_channel_affect": 0.0, +"ssao_detail": 0.5, +"ssao_enabled": false, +"ssao_horizon": 0.06, +"ssao_intensity": 2.0, +"ssao_light_affect": 0.0, +"ssao_power": 1.5, +"ssao_radius": 1.0, +"ssao_sharpness": 0.98 +} +class_property_descriptions = {} +auto_apply_to_matching_node_properties = false +meta_properties = { +"color": Color(0.8, 0.8, 0.8, 1), +"size": AABB(-8, -8, -8, 8, 8, 8) +} +node_class = "" +name_property = "" diff --git a/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_ssil.tres b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_ssil.tres new file mode 100644 index 0000000..55698d2 --- /dev/null +++ b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_ssil.tres @@ -0,0 +1,25 @@ +[gd_resource type="Resource" script_class="FuncGodotFGDBaseClass" load_steps=2 format=3 uid="uid://u5owgegpulg4"] + +[ext_resource type="Script" path="res://addons/func_godot/src/fgd/func_godot_fgd_base_class.gd" id="1_y8spm"] + +[resource] +script = ExtResource("1_y8spm") +classname = "Worldspawn_SSIL" +description = "" +func_godot_internal = false +base_classes = Array[Resource]([]) +class_properties = { +"ssil_enabled": false, +"ssil_intensity": 1.0, +"ssil_normal_rejection": 1.0, +"ssil_radius": 5.0, +"ssil_sharpness": 0.98 +} +class_property_descriptions = {} +auto_apply_to_matching_node_properties = false +meta_properties = { +"color": Color(0.8, 0.8, 0.8, 1), +"size": AABB(-8, -8, -8, 8, 8, 8) +} +node_class = "" +name_property = "" diff --git a/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_ssr.tres b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_ssr.tres new file mode 100644 index 0000000..72b77fc --- /dev/null +++ b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_ssr.tres @@ -0,0 +1,25 @@ +[gd_resource type="Resource" script_class="FuncGodotFGDBaseClass" load_steps=2 format=3 uid="uid://d2bk0vf1dxvdw"] + +[ext_resource type="Script" path="res://addons/func_godot/src/fgd/func_godot_fgd_base_class.gd" id="1_7yrc3"] + +[resource] +script = ExtResource("1_7yrc3") +classname = "Worldspawn_SSR" +description = "" +func_godot_internal = false +base_classes = Array[Resource]([]) +class_properties = { +"ssr_depth_tolerance": 0.2, +"ssr_enabled": false, +"ssr_fade_in": 0.15, +"ssr_fade_out": 2.0, +"ssr_max_steps": 64 +} +class_property_descriptions = {} +auto_apply_to_matching_node_properties = false +meta_properties = { +"color": Color(0.8, 0.8, 0.8, 1), +"size": AABB(-8, -8, -8, 8, 8, 8) +} +node_class = "" +name_property = "" diff --git a/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_tone.tres b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_tone.tres new file mode 100644 index 0000000..16b30d6 --- /dev/null +++ b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_tone.tres @@ -0,0 +1,30 @@ +[gd_resource type="Resource" script_class="FuncGodotFGDBaseClass" load_steps=2 format=3 uid="uid://bppk0apwmcy4"] + +[ext_resource type="Script" path="res://addons/func_godot/src/fgd/func_godot_fgd_base_class.gd" id="1_t546n"] + +[resource] +script = ExtResource("1_t546n") +classname = "Worldspawn_Tonemap" +description = "" +func_godot_internal = false +base_classes = Array[Resource]([]) +class_properties = { +"tonemap_exposure": 1.0, +"tonemap_mode": { +"aces": 3, +"filmic": 2, +"linear": 0, +"reinhardt": 1 +}, +"tonemap_white": 1.0 +} +class_property_descriptions = { +"tonemap_mode": ["", 0] +} +auto_apply_to_matching_node_properties = false +meta_properties = { +"color": Color(0.8, 0.8, 0.8, 1), +"size": AABB(-8, -8, -8, 8, 8, 8) +} +node_class = "" +name_property = "" diff --git a/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_vfog.tres b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_vfog.tres new file mode 100644 index 0000000..63d57c4 --- /dev/null +++ b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/base/worldspawn/worldspawn_vfog.tres @@ -0,0 +1,33 @@ +[gd_resource type="Resource" script_class="FuncGodotFGDBaseClass" load_steps=2 format=3 uid="uid://b7sirueasntcp"] + +[ext_resource type="Script" path="res://addons/func_godot/src/fgd/func_godot_fgd_base_class.gd" id="1_rpuly"] + +[resource] +script = ExtResource("1_rpuly") +classname = "Worldspawn_VolumetricFog" +description = "" +func_godot_internal = false +base_classes = Array[Resource]([]) +class_properties = { +"volumetric_fog_albedo": Color(1, 1, 1, 1), +"volumetric_fog_ambient_inject": 0.0, +"volumetric_fog_anisotropy": 0.2, +"volumetric_fog_density": 0.05, +"volumetric_fog_detail_spread": 2.0, +"volumetric_fog_emission": Color(0, 0, 0, 1), +"volumetric_fog_emission_energy": 1.0, +"volumetric_fog_enabled": false, +"volumetric_fog_gi_inject": 1.0, +"volumetric_fog_length": 64.0, +"volumetric_fog_sky_affect": 1.0, +"volumetric_fog_temporal_reprojection_amount": 0.9, +"volumetric_fog_temporal_reprojection_enabled": true +} +class_property_descriptions = {} +auto_apply_to_matching_node_properties = false +meta_properties = { +"color": Color(0.8, 0.8, 0.8, 1), +"size": AABB(-8, -8, -8, 8, 8, 8) +} +node_class = "" +name_property = "" diff --git a/FuncGodot Entities/GD Script/modular_worldspawn/fgd/solid/worldspawn.tres b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/solid/worldspawn.tres new file mode 100644 index 0000000..2d3cc68 --- /dev/null +++ b/FuncGodot Entities/GD Script/modular_worldspawn/fgd/solid/worldspawn.tres @@ -0,0 +1,43 @@ +[gd_resource type="Resource" script_class="FuncGodotFGDSolidClass" load_steps=6 format=3 uid="uid://da7k67tthqksi"] + +[ext_resource type="Script" path="res://addons/func_godot/src/fgd/func_godot_fgd_solid_class.gd" id="1_85jhq"] +[ext_resource type="Resource" uid="uid://c53s30pt2h3rj" path="res://fgd/base/worldspawn/worldspawn_bg.tres" id="1_xy3m2"] +[ext_resource type="Resource" uid="uid://cxckph0lt4js5" path="res://fgd/base/worldspawn/worldspawn_amb.tres" id="2_jw8k1"] +[ext_resource type="Script" path="res://entities/worldspawn.gd" id="2_lyihe"] +[ext_resource type="Resource" uid="uid://cg8y28cc5be80" path="res://fgd/base/worldspawn/worldspawn_fog.tres" id="3_jttic"] + +[resource] +script = ExtResource("1_85jhq") +spawn_type = 0 +origin_type = 4 +build_visuals = false +use_in_baked_light = false +shadow_casting_setting = 0 +build_occlusion = false +render_layers = 1 +collision_shape_type = 0 +collision_layer = 0 +collision_mask = 0 +collision_priority = 1.0 +collision_shape_margin = 0.04 +add_textures_metadata = false +add_vertex_metadata = false +add_face_position_metadata = false +add_face_normal_metadata = false +add_collision_shape_face_range_metadata = false +script_class = ExtResource("2_lyihe") +classname = "worldspawn" +description = "Map settings node. Generates a WorldEnvironment. Properties can be extended through the use of different worldspawn base classes." +func_godot_internal = false +base_classes = Array[Resource]([ExtResource("1_xy3m2"), ExtResource("2_jw8k1"), ExtResource("3_jttic")]) +class_properties = { +"mapname": "", +"music": "" +} +class_property_descriptions = {} +auto_apply_to_matching_node_properties = false +meta_properties = { +"color": Color(0.8, 0.8, 0.8, 1) +} +node_class = "WorldEnvironment" +name_property = "" diff --git a/FuncGodot Entities/GD Script/modular_worldspawn/readme.md b/FuncGodot Entities/GD Script/modular_worldspawn/readme.md new file mode 100644 index 0000000..0a83d8c --- /dev/null +++ b/FuncGodot Entities/GD Script/modular_worldspawn/readme.md @@ -0,0 +1,7 @@ +For my func_godot games I like to make my worldspawn a WorldEnvironment. + +Was working on a new project and decided to set up a GDScript worldspawn entity, but I got a bit carried away and added support for every single Environment resource feature. I do not need every single one for my game, and it gets a bit overstuffed with every single one, but instead of deleting my work I decided to make it modular. This makes the properties much easier to manage as well. + +Sharing it here because someone else might find it useful for their own projects. Simply add any desired base classes to both the worldspawn definition's base classes and your FGD File's entity definitions array. + +This worldspawn entity is licensed Creative Commons Zero. While unnecessary, if you want to give a shoutout in your game's credits, give it to Blue Key Games. \ No newline at end of file diff --git a/FuncGodot Entities/GD Script/mesh_face.gd b/FuncGodot Entities/GD Script/prop_multi_mesh/mesh_face.gd similarity index 100% rename from FuncGodot Entities/GD Script/mesh_face.gd rename to FuncGodot Entities/GD Script/prop_multi_mesh/mesh_face.gd diff --git a/FuncGodot Entities/GD Script/prop_multi_mesh.gd b/FuncGodot Entities/GD Script/prop_multi_mesh/prop_multi_mesh.gd similarity index 100% rename from FuncGodot Entities/GD Script/prop_multi_mesh.gd rename to FuncGodot Entities/GD Script/prop_multi_mesh/prop_multi_mesh.gd diff --git a/FuncGodot Entities/GD Script/prop_multi_mesh.tres b/FuncGodot Entities/GD Script/prop_multi_mesh/prop_multi_mesh.tres similarity index 100% rename from FuncGodot Entities/GD Script/prop_multi_mesh.tres rename to FuncGodot Entities/GD Script/prop_multi_mesh/prop_multi_mesh.tres