Eevee: Change default shadowmap near clipping distance

And also fix some RNA props defaults and ranges.

Fix T64452 Shadows not appearing in eevee
This commit is contained in:
2019-05-28 20:04:46 +02:00
parent 40207d656b
commit b76ccc7f80
3 changed files with 13 additions and 5 deletions

View File

@@ -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;

View File

@@ -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. */

View File

@@ -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");