EEVEE-Next: Move shadow resolution scale to the sampling panel
This commit is contained in:
@@ -775,6 +775,9 @@ class RENDER_PT_eevee_next_sampling_shadows(RenderButtonsPanel, Panel):
|
||||
col.prop(props, "shadow_ray_count", text="Rays")
|
||||
col.prop(props, "shadow_step_count", text="Steps")
|
||||
|
||||
col = layout.column()
|
||||
col.prop(props, "shadow_resolution_scale", text="Resolution")
|
||||
|
||||
col = layout.column(align=False, heading="Volume Shadows")
|
||||
row = col.row(align=True)
|
||||
sub = row.row(align=True)
|
||||
|
||||
@@ -4332,8 +4332,6 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain)
|
||||
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
|
||||
scene->eevee.flag |= SCE_EEVEE_SHADOW_ENABLED;
|
||||
scene->eevee.shadow_pool_size = 512;
|
||||
scene->r.simplify_shadows = 1.0f;
|
||||
scene->r.simplify_shadows_render = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3315,6 +3315,16 @@ void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain)
|
||||
FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 402, 26)) {
|
||||
if (!DNA_struct_member_exists(fd->filesdna, "SceneEEVEE", "float", "shadow_resolution_scale"))
|
||||
{
|
||||
SceneEEVEE default_scene_eevee = *DNA_struct_default_get(SceneEEVEE);
|
||||
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
|
||||
scene->eevee.shadow_resolution_scale = default_scene_eevee.shadow_resolution_scale;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Always bump subversion in BKE_blender_version.h when adding versioning
|
||||
* code here, and wrap it inside a MAIN_VERSION_FILE_ATLEAST check.
|
||||
|
||||
@@ -778,8 +778,8 @@ void ShadowModule::init()
|
||||
jittered_transparency_ = !inst_.is_viewport() ||
|
||||
scene.eevee.flag & SCE_EEVEE_SHADOW_JITTERED_VIEWPORT;
|
||||
|
||||
data_.ray_count = clamp_i(inst_.scene->eevee.shadow_ray_count, 1, SHADOW_MAX_RAY);
|
||||
data_.step_count = clamp_i(inst_.scene->eevee.shadow_step_count, 1, SHADOW_MAX_STEP);
|
||||
data_.ray_count = clamp_i(scene.eevee.shadow_ray_count, 1, SHADOW_MAX_RAY);
|
||||
data_.step_count = clamp_i(scene.eevee.shadow_step_count, 1, SHADOW_MAX_STEP);
|
||||
|
||||
/* Pool size is in MBytes. */
|
||||
const size_t pool_byte_size = enabled_ ? scene.eevee.shadow_pool_size * square_i(1024) : 1;
|
||||
@@ -787,12 +787,7 @@ void ShadowModule::init()
|
||||
shadow_page_len_ = int(divide_ceil_ul(pool_byte_size, page_byte_size));
|
||||
shadow_page_len_ = min_ii(shadow_page_len_, SHADOW_MAX_PAGE);
|
||||
|
||||
float simplify_shadows = 1.0f;
|
||||
if (scene.r.mode & R_SIMPLIFY) {
|
||||
simplify_shadows = inst_.is_viewport() ? scene.r.simplify_shadows :
|
||||
scene.r.simplify_shadows_render;
|
||||
}
|
||||
lod_bias_ = -log2(simplify_shadows);
|
||||
lod_bias_ = -log2f(scene.eevee.shadow_resolution_scale);
|
||||
|
||||
const int2 atlas_extent = shadow_page_size_ * int2(SHADOW_PAGE_PER_ROW);
|
||||
const int atlas_layers = divide_ceil_u(shadow_page_len_, SHADOW_PAGE_PER_LAYER);
|
||||
|
||||
@@ -236,6 +236,7 @@
|
||||
.shadow_cascade_size = 1024, \
|
||||
.shadow_ray_count = 1, \
|
||||
.shadow_step_count = 6, \
|
||||
.shadow_resolution_scale = 1.0f, \
|
||||
\
|
||||
.ray_tracing_method = RAYTRACE_EEVEE_METHOD_SCREEN, \
|
||||
\
|
||||
|
||||
@@ -791,8 +791,6 @@ typedef struct RenderData {
|
||||
float simplify_particles;
|
||||
float simplify_particles_render;
|
||||
float simplify_volumes;
|
||||
float simplify_shadows;
|
||||
float simplify_shadows_render;
|
||||
|
||||
/** Freestyle line thickness options. */
|
||||
int line_thickness_mode;
|
||||
@@ -1873,7 +1871,7 @@ typedef struct SceneEEVEE {
|
||||
int shadow_pool_size;
|
||||
int shadow_ray_count;
|
||||
int shadow_step_count;
|
||||
char _pad[4];
|
||||
float shadow_resolution_scale;
|
||||
|
||||
float clamp_surface_direct;
|
||||
float clamp_surface_indirect;
|
||||
|
||||
@@ -2149,6 +2149,22 @@ static void rna_Scene_use_simplify_normals_update(Main *bmain, Scene *scene, Poi
|
||||
}
|
||||
}
|
||||
|
||||
static void rna_Scene_eevee_shadow_resolution_update(Main *bmain,
|
||||
Scene *scene,
|
||||
PointerRNA * /*ptr*/)
|
||||
{
|
||||
FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
|
||||
if (ob->type == OB_LAMP) {
|
||||
DEG_id_tag_update(&ob->id, ID_RECALC_SHADING);
|
||||
}
|
||||
}
|
||||
FOREACH_SCENE_OBJECT_END;
|
||||
|
||||
WM_main_add_notifier(NC_GEOM | ND_DATA, nullptr);
|
||||
WM_main_add_notifier(NC_OBJECT | ND_DRAW, nullptr);
|
||||
DEG_id_tag_update(&scene->id, ID_RECALC_SYNC_TO_EVAL);
|
||||
}
|
||||
|
||||
static void rna_Scene_use_persistent_data_update(Main * /*bmain*/,
|
||||
Scene * /*scene*/,
|
||||
PointerRNA *ptr)
|
||||
@@ -7334,21 +7350,6 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
|
||||
"meshes in the viewport");
|
||||
RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_normals_update");
|
||||
|
||||
/* EEVEE - Simplify Options */
|
||||
prop = RNA_def_property(srna, "simplify_shadows_render", PROP_FLOAT, PROP_FACTOR);
|
||||
RNA_def_property_float_default(prop, 1.0);
|
||||
RNA_def_property_range(prop, 0.0, 1.0f);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Simplify Shadows", "Resolution percentage of shadows in viewport");
|
||||
RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
|
||||
|
||||
prop = RNA_def_property(srna, "simplify_shadows", PROP_FLOAT, PROP_FACTOR);
|
||||
RNA_def_property_float_default(prop, 1.0);
|
||||
RNA_def_property_range(prop, 0.0, 1.0f);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Simplify Shadows", "Resolution percentage of shadows in viewport");
|
||||
RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
|
||||
|
||||
/* Grease Pencil - Simplify Options */
|
||||
prop = RNA_def_property(srna, "simplify_gpencil", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_ENABLE);
|
||||
@@ -8471,6 +8472,13 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Use Ray-Tracing", "Enable the ray-tracing module");
|
||||
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "shadow_resolution_scale", PROP_FLOAT, PROP_FACTOR);
|
||||
RNA_def_property_range(prop, 0.0f, 1.0f);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Shadows Resolution Scale", "Resolution percentage of shadow maps");
|
||||
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
|
||||
RNA_def_property_update(prop, 0, "rna_Scene_eevee_shadow_resolution_update");
|
||||
}
|
||||
|
||||
static void rna_def_scene_gpencil(BlenderRNA *brna)
|
||||
|
||||
Reference in New Issue
Block a user