[Bf-blender-cvs] [b76ccc7f802] master: Eevee: Change default shadowmap near clipping distance

Clément Foucault noreply at git.blender.org
Tue May 28 20:07:09 CEST 2019


Commit: b76ccc7f802b7bbaa1d5b78e3e4a33784c38072c
Author: Clément Foucault
Date:   Tue May 28 20:04:46 2019 +0200
Branches: master
https://developer.blender.org/rBb76ccc7f802b7bbaa1d5b78e3e4a33784c38072c

Eevee: Change default shadowmap near clipping distance

And also fix some RNA props defaults and ranges.

Fix T64452 Shadows not appearing in eevee

===================================================================

M	source/blender/blenkernel/intern/light.c
M	source/blender/blenloader/intern/versioning_defaults.c
M	source/blender/makesrna/intern/rna_light.c

===================================================================

diff --git a/source/blender/blenkernel/intern/light.c b/source/blender/blenkernel/intern/light.c
index 1c3acb6a73a..271bf58fcc6 100644
--- a/source/blender/blenkernel/intern/light.c
+++ b/source/blender/blenkernel/intern/light.c
@@ -56,7 +56,7 @@ void BKE_light_init(Light *la)
   la->att2 = 1.0f;
   la->mode = LA_SHADOW;
   la->bufsize = 512;
-  la->clipsta = 0.5f;
+  la->clipsta = 0.05f;
   la->clipend = 40.0f;
   la->bleedexp = 2.5f;
   la->samp = 3;
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index d22620f9224..5b241d613e3 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -463,6 +463,12 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
     scene->eevee.gi_filter_quality = 3.0f;
   }
 
+  for (Light *light = bmain->lights.first; light; light = light->id.next) {
+    /* Fix lights defaults. */
+    light->clipsta = 0.05f;
+    light->att_dist = 40.0f;
+  }
+
   if (app_template == NULL) {
     /* Enable for UV sculpt (other brush types will be created as needed),
      * without this the grab brush will be active but not selectable from the list. */
diff --git a/source/blender/makesrna/intern/rna_light.c b/source/blender/makesrna/intern/rna_light.c
index a271b883e38..67a9e481041 100644
--- a/source/blender/makesrna/intern/rna_light.c
+++ b/source/blender/makesrna/intern/rna_light.c
@@ -164,7 +164,7 @@ static void rna_def_light(BlenderRNA *brna)
 
   prop = RNA_def_property(srna, "cutoff_distance", PROP_FLOAT, PROP_DISTANCE);
   RNA_def_property_float_sdna(prop, NULL, "att_dist");
-  RNA_def_property_float_default(prop, 1.0f);
+  RNA_def_property_float_default(prop, 40.0f);
   RNA_def_property_range(prop, 0.0f, FLT_MAX);
   RNA_def_property_ui_range(prop, 0.01f, 100.0f, 1.0, 2);
   RNA_def_property_ui_text(
@@ -288,8 +288,9 @@ static void rna_def_light_shadow(StructRNA *srna, bool sun)
 
   prop = RNA_def_property(srna, "shadow_buffer_clip_start", PROP_FLOAT, PROP_DISTANCE);
   RNA_def_property_float_sdna(prop, NULL, "clipsta");
-  RNA_def_property_float_default(prop, 0.5f);
-  RNA_def_property_range(prop, 0.0f, 9999.0f);
+  RNA_def_property_float_default(prop, 0.05f);
+  RNA_def_property_range(prop, 1e-6f, FLT_MAX);
+  RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
   RNA_def_property_ui_text(prop,
                            "Shadow Buffer Clip Start",
                            "Shadow map clip start, below which objects will not generate shadows");
@@ -298,7 +299,8 @@ static void rna_def_light_shadow(StructRNA *srna, bool sun)
   prop = RNA_def_property(srna, "shadow_buffer_clip_end", PROP_FLOAT, PROP_DISTANCE);
   RNA_def_property_float_sdna(prop, NULL, "clipend");
   RNA_def_property_float_default(prop, 40.0f);
-  RNA_def_property_range(prop, 0.0f, 9999.0f);
+  RNA_def_property_range(prop, 1e-6f, FLT_MAX);
+  RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
   RNA_def_property_ui_text(prop,
                            "Shadow Buffer Clip End",
                            "Shadow map clip end, beyond which objects will not generate shadows");



More information about the Bf-blender-cvs mailing list