Add Soft Very Low shadow quality mode for 3D

This can be used to improve 3D shadow rendering quality at little
performance cost. Unlike the existing Hard setting which is limited
to variable shadow blur only, it works with both fixed blur and
variable blur.
This commit is contained in:
Hugo Locurcio 2021-10-19 16:52:57 +02:00
parent 85a8939fa2
commit e87ec8ec17
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
6 changed files with 41 additions and 16 deletions

View file

@ -1942,6 +1942,7 @@ void RenderingServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("directional_shadow_atlas_set_size", "size", "is_16bits"), &RenderingServer::directional_shadow_atlas_set_size);
BIND_ENUM_CONSTANT(SHADOW_QUALITY_HARD);
BIND_ENUM_CONSTANT(SHADOW_QUALITY_SOFT_VERY_LOW);
BIND_ENUM_CONSTANT(SHADOW_QUALITY_SOFT_LOW);
BIND_ENUM_CONSTANT(SHADOW_QUALITY_SOFT_MEDIUM);
BIND_ENUM_CONSTANT(SHADOW_QUALITY_SOFT_HIGH);
@ -2793,14 +2794,14 @@ RenderingServer::RenderingServer() {
GLOBAL_DEF("rendering/shadows/directional_shadow/size", 4096);
GLOBAL_DEF("rendering/shadows/directional_shadow/size.mobile", 2048);
ProjectSettings::get_singleton()->set_custom_property_info("rendering/shadows/directional_shadow/size", PropertyInfo(Variant::INT, "rendering/shadows/directional_shadow/size", PROPERTY_HINT_RANGE, "256,16384"));
GLOBAL_DEF("rendering/shadows/directional_shadow/soft_shadow_quality", 2);
GLOBAL_DEF("rendering/shadows/directional_shadow/soft_shadow_quality", 3);
GLOBAL_DEF("rendering/shadows/directional_shadow/soft_shadow_quality.mobile", 0);
ProjectSettings::get_singleton()->set_custom_property_info("rendering/shadows/directional_shadow/soft_shadow_quality", PropertyInfo(Variant::INT, "rendering/shadows/directional_shadow/soft_shadow_quality", PROPERTY_HINT_ENUM, "Hard (Fastest),Soft Low (Fast),Soft Medium (Average),Soft High (Slow),Soft Ultra (Slowest)"));
ProjectSettings::get_singleton()->set_custom_property_info("rendering/shadows/directional_shadow/soft_shadow_quality", PropertyInfo(Variant::INT, "rendering/shadows/directional_shadow/soft_shadow_quality", PROPERTY_HINT_ENUM, "Hard (Fastest),Soft Very Low (Faster),Soft Low (Fast),Soft Medium (Average),Soft High (Slow),Soft Ultra (Slowest)"));
GLOBAL_DEF("rendering/shadows/directional_shadow/16_bits", true);
GLOBAL_DEF("rendering/shadows/shadows/soft_shadow_quality", 2);
GLOBAL_DEF("rendering/shadows/shadows/soft_shadow_quality", 3);
GLOBAL_DEF("rendering/shadows/shadows/soft_shadow_quality.mobile", 0);
ProjectSettings::get_singleton()->set_custom_property_info("rendering/shadows/shadows/soft_shadow_quality", PropertyInfo(Variant::INT, "rendering/shadows/shadows/soft_shadow_quality", PROPERTY_HINT_ENUM, "Hard (Fastest),Soft Low (Fast),Soft Medium (Average),Soft High (Slow),Soft Ultra (Slowest)"));
ProjectSettings::get_singleton()->set_custom_property_info("rendering/shadows/shadows/soft_shadow_quality", PropertyInfo(Variant::INT, "rendering/shadows/shadows/soft_shadow_quality", PROPERTY_HINT_ENUM, "Hard (Fastest),Soft Very Low (Faster),Soft Low (Fast),Soft Medium (Average),Soft High (Slow),Soft Ultra (Slowest)"));
GLOBAL_DEF("rendering/2d/shadow_atlas/size", 2048);