From e2603a6e821936e9204cba224961beac77b059f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Fri, 1 Sep 2017 15:59:58 +0200 Subject: Eevee: Shadows: Add UI buttons for size and method Only one method is available right now. VSM and PCF are comming. --- source/blender/makesrna/intern/rna_scene.c | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'source/blender/makesrna/intern/rna_scene.c') diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index f61e0212f63..3e744923d45 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2658,6 +2658,8 @@ RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(ssr_max_roughness) RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(ssr_thickness) RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(ssr_border_fade) RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(ssr_firefly_fac) +RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(shadow_method) +RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(shadow_size) /* object engine */ RNA_LAYER_MODE_OBJECT_GET_SET_BOOL(show_wire) @@ -6205,6 +6207,26 @@ static void rna_def_scene_layer_engine_settings_eevee(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; + /* Keep in sync with eevee_private.h */ + static EnumPropertyItem eevee_shadow_method_items[] = { + {1, "ESM", 0, "ESM", "Exponential Shadow Mapping"}, + /* TODO */ + // {2, "VSM", 0, "VSM", "Variance Shadow Mapping"}, + {0, NULL, 0, NULL, NULL} + }; + + static EnumPropertyItem eevee_shadow_size_items[] = { + {64, "64", 0, "64px", ""}, + {128, "128", 0, "128px", ""}, + {256, "256", 0, "256px", ""}, + {512, "512", 0, "512px", ""}, + {1024, "1024", 0, "1024px", ""}, + {2048, "2048", 0, "2048px", ""}, + {4096, "4096", 0, "4096px", ""}, + {8192, "8192", 0, "8192px", ""}, + {0, NULL, 0, NULL, NULL} + }; + srna = RNA_def_struct(brna, "SceneLayerEngineSettingsEevee", "SceneLayerSettings"); RNA_def_struct_ui_text(srna, "Eevee Scene Layer Settings", "Eevee Engine settings"); @@ -6532,6 +6554,21 @@ static void rna_def_scene_layer_engine_settings_eevee(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); + /* Shadows */ + prop = RNA_def_property(srna, "shadow_method", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_Eevee_shadow_method_get", "rna_LayerEngineSettings_Eevee_shadow_method_set", NULL); + RNA_def_property_enum_items(prop, eevee_shadow_method_items); + RNA_def_property_ui_text(prop, "Method", "Technique use to compute the shadows"); + RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); + RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); + + prop = RNA_def_property(srna, "shadow_size", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_Eevee_shadow_size_get", "rna_LayerEngineSettings_Eevee_shadow_size_set", NULL); + RNA_def_property_enum_items(prop, eevee_shadow_size_items); + RNA_def_property_ui_text(prop, "Size", "Size of every shadow maps"); + RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); + RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); + RNA_define_verify_sdna(1); /* not in sdna */ } -- cgit v1.2.3