Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2018-05-16 20:34:24 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-05-17 00:13:28 +0300
commit15c2801aac333341f0993f53a714a66f9f2384b2 (patch)
tree9ae8f85094dc3128d65225b6e6419b6280379710 /source
parentd8dca3c3b05d83b3771b62def041b342fc7d6e93 (diff)
Move EEVEE properties into scene
We handle doversion for the scene properties, but not for the view layer overrides. Overrides will be implemented in a different way via dynamic overrides. For now this data is completely lost.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/scene.c54
-rw-r--r--source/blender/blenloader/intern/versioning_280.c182
-rw-r--r--source/blender/draw/engines/eevee/eevee_bloom.c22
-rw-r--r--source/blender/draw/engines/eevee/eevee_depth_of_field.c10
-rw-r--r--source/blender/draw/engines/eevee/eevee_engine.c65
-rw-r--r--source/blender/draw/engines/eevee/eevee_lightprobes.c11
-rw-r--r--source/blender/draw/engines/eevee/eevee_lights.c13
-rw-r--r--source/blender/draw/engines/eevee/eevee_motion_blur.c14
-rw-r--r--source/blender/draw/engines/eevee/eevee_occlusion.c31
-rw-r--r--source/blender/draw/engines/eevee/eevee_private.h7
-rw-r--r--source/blender/draw/engines/eevee/eevee_render.c4
-rw-r--r--source/blender/draw/engines/eevee/eevee_screen_raytrace.c22
-rw-r--r--source/blender/draw/engines/eevee/eevee_subsurface.c18
-rw-r--r--source/blender/draw/engines/eevee/eevee_temporal_sampling.c11
-rw-r--r--source/blender/draw/engines/eevee/eevee_volumes.c28
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c16
-rw-r--r--source/blender/makesdna/DNA_scene_types.h76
-rw-r--r--source/blender/makesrna/RNA_access.h1
-rw-r--r--source/blender/makesrna/intern/rna_layer.c542
-rw-r--r--source/blender/makesrna/intern/rna_scene.c341
20 files changed, 748 insertions, 720 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 2538a0c237b..f387ad0d4ef 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -826,6 +826,60 @@ void BKE_scene_init(Scene *sce)
/* SceneDisplay */
copy_v3_v3(sce->display.light_direction, (float[3]){-M_SQRT1_3, -M_SQRT1_3, M_SQRT1_3});
sce->display.shadow_shift = 0.1;
+
+ /* SceneEEVEE */
+ sce->eevee.gi_diffuse_bounces = 3;
+ sce->eevee.gi_cubemap_resolution = 512;
+ sce->eevee.gi_visibility_resolution = 32;
+
+ sce->eevee.taa_samples = 16;
+ sce->eevee.taa_render_samples = 64;
+
+ sce->eevee.sss_samples = 7;
+ sce->eevee.sss_jitter_threshold = 0.3f;
+
+ sce->eevee.ssr_quality = 0.25f;
+ sce->eevee.ssr_max_roughness = 0.5f;
+ sce->eevee.ssr_thickness = 0.2f;
+ sce->eevee.ssr_border_fade = 0.075f;
+ sce->eevee.ssr_firefly_fac = 10.0f;
+
+ sce->eevee.volumetric_start = 0.1f;
+ sce->eevee.volumetric_end = 100.0f;
+ sce->eevee.volumetric_tile_size = 8;
+ sce->eevee.volumetric_samples = 64;
+ sce->eevee.volumetric_sample_distribution = 0.8f;
+ sce->eevee.volumetric_light_clamp = 0.0f;
+ sce->eevee.volumetric_shadow_samples = 16;
+
+ sce->eevee.gtao_distance = 0.2f;
+ sce->eevee.gtao_factor = 1.0f;
+ sce->eevee.gtao_quality = 0.25f;
+
+ sce->eevee.bokeh_max_size = 100.0f;
+ sce->eevee.bokeh_threshold = 1.0f;
+
+ copy_v3_fl(sce->eevee.bloom_color, 1.0f);
+ sce->eevee.bloom_threshold = 0.8f;
+ sce->eevee.bloom_knee = 0.5f;
+ sce->eevee.bloom_intensity = 0.8f;
+ sce->eevee.bloom_radius = 6.5f;
+ sce->eevee.bloom_clamp = 1.0f;
+
+ sce->eevee.motion_blur_samples = 8;
+ sce->eevee.motion_blur_shutter = 1.0f;
+
+ sce->eevee.shadow_method = SHADOW_ESM;
+ sce->eevee.shadow_cube_size = 512;
+ sce->eevee.shadow_cascade_size = 1024;
+
+ sce->eevee.flag =
+ SCE_EEVEE_VOLUMETRIC_LIGHTS |
+ SCE_EEVEE_VOLUMETRIC_COLORED |
+ SCE_EEVEE_GTAO_BENT_NORMALS |
+ SCE_EEVEE_GTAO_BOUNCE |
+ SCE_EEVEE_TAA_REPROJECTION |
+ SCE_EEVEE_SSR_HALF_RESOLUTION;
}
Scene *BKE_scene_add(Main *bmain, const char *name)
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 4668241d9dd..9c0ad15831b 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1104,5 +1104,187 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
scene->toolsettings->transform_pivot_point = V3D_AROUND_CENTER_MEAN;
}
}
+
+ if (!DNA_struct_find(fd->filesdna, "SceneEEVEE")) {
+ for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
+ /* First set the default for all the properties. */
+
+ scene->eevee.gi_diffuse_bounces = 3;
+ scene->eevee.gi_cubemap_resolution = 512;
+ scene->eevee.gi_visibility_resolution = 32;
+
+ scene->eevee.taa_samples = 16;
+ scene->eevee.taa_render_samples = 64;
+
+ scene->eevee.sss_samples = 7;
+ scene->eevee.sss_jitter_threshold = 0.3f;
+
+ scene->eevee.ssr_quality = 0.25f;
+ scene->eevee.ssr_max_roughness = 0.5f;
+ scene->eevee.ssr_thickness = 0.2f;
+ scene->eevee.ssr_border_fade = 0.075f;
+ scene->eevee.ssr_firefly_fac = 10.0f;
+
+ scene->eevee.volumetric_start = 0.1f;
+ scene->eevee.volumetric_end = 100.0f;
+ scene->eevee.volumetric_tile_size = 8;
+ scene->eevee.volumetric_samples = 64;
+ scene->eevee.volumetric_sample_distribution = 0.8f;
+ scene->eevee.volumetric_light_clamp = 0.0f;
+ scene->eevee.volumetric_shadow_samples = 16;
+
+ scene->eevee.gtao_distance = 0.2f;
+ scene->eevee.gtao_factor = 1.0f;
+ scene->eevee.gtao_quality = 0.25f;
+
+ scene->eevee.bokeh_max_size = 100.0f;
+ scene->eevee.bokeh_threshold = 1.0f;
+
+ copy_v3_fl(scene->eevee.bloom_color, 1.0f);
+ scene->eevee.bloom_threshold = 0.8f;
+ scene->eevee.bloom_knee = 0.5f;
+ scene->eevee.bloom_intensity = 0.8f;
+ scene->eevee.bloom_radius = 6.5f;
+ scene->eevee.bloom_clamp = 1.0f;
+
+ scene->eevee.motion_blur_samples = 8;
+ scene->eevee.motion_blur_shutter = 1.0f;
+
+ scene->eevee.shadow_method = SHADOW_ESM;
+ scene->eevee.shadow_cube_size = 512;
+ scene->eevee.shadow_cascade_size = 1024;
+
+ scene->eevee.flag =
+ SCE_EEVEE_VOLUMETRIC_LIGHTS |
+ SCE_EEVEE_VOLUMETRIC_COLORED |
+ SCE_EEVEE_GTAO_BENT_NORMALS |
+ SCE_EEVEE_GTAO_BOUNCE |
+ SCE_EEVEE_TAA_REPROJECTION |
+ SCE_EEVEE_SSR_HALF_RESOLUTION;
+
+
+ /* If the file is pre-2.80 move on. */
+ if (scene->layer_properties == NULL) {
+ continue;
+ }
+
+ /* Now we handle eventual properties that may be set in the file. */
+#define EEVEE_GET_BOOL(_props, _name, _flag) \
+ { \
+ IDProperty *_idprop = IDP_GetPropertyFromGroup(_props, #_name); \
+ if (_idprop != NULL) { \
+ const int _value = IDP_Int(_idprop); \
+ if (_value) { \
+ scene->eevee.flag |= _flag; \
+ } \
+ else { \
+ scene->eevee.flag &= ~_flag; \
+ } \
+ } \
+ }
+
+#define EEVEE_GET_INT(_props, _name) \
+ { \
+ IDProperty *_idprop = IDP_GetPropertyFromGroup(_props, #_name); \
+ if (_idprop != NULL) { \
+ scene->eevee._name = IDP_Int(_idprop); \
+ } \
+ }
+
+#define EEVEE_GET_FLOAT(_props, _name) \
+ { \
+ IDProperty *_idprop = IDP_GetPropertyFromGroup(_props, #_name); \
+ if (_idprop != NULL) { \
+ scene->eevee._name = IDP_Float(_idprop); \
+ } \
+ }
+
+#define EEVEE_GET_FLOAT_ARRAY(_props, _name, _length) \
+ { \
+ IDProperty *_idprop = IDP_GetPropertyFromGroup(_props, #_name); \
+ if (_idprop != NULL) { \
+ const float *_values = IDP_Array(_idprop); \
+ for (int _i = 0; _i < _length; _i++) { \
+ scene->eevee._name [_i] = _values[_i]; \
+ } \
+ } \
+ }
+
+ IDProperty *props = IDP_GetPropertyFromGroup(scene->layer_properties, RE_engine_id_BLENDER_EEVEE);
+ EEVEE_GET_BOOL(props, volumetric_enable, SCE_EEVEE_VOLUMETRIC_ENABLED);
+ EEVEE_GET_BOOL(props, volumetric_lights, SCE_EEVEE_VOLUMETRIC_LIGHTS);
+ EEVEE_GET_BOOL(props, volumetric_shadows, SCE_EEVEE_VOLUMETRIC_SHADOWS);
+ EEVEE_GET_BOOL(props, volumetric_colored_transmittance, SCE_EEVEE_VOLUMETRIC_COLORED);
+ EEVEE_GET_BOOL(props, gtao_enable, SCE_EEVEE_GTAO_ENABLED);
+ EEVEE_GET_BOOL(props, gtao_use_bent_normals, SCE_EEVEE_GTAO_BENT_NORMALS);
+ EEVEE_GET_BOOL(props, gtao_bounce, SCE_EEVEE_GTAO_BOUNCE);
+ EEVEE_GET_BOOL(props, dof_enable, SCE_EEVEE_DOF_ENABLED);
+ EEVEE_GET_BOOL(props, bloom_enable, SCE_EEVEE_BLOOM_ENABLED);
+ EEVEE_GET_BOOL(props, motion_blur_enable, SCE_EEVEE_MOTION_BLUR_ENABLED);
+ EEVEE_GET_BOOL(props, shadow_high_bitdepth, SCE_EEVEE_SHADOW_HIGH_BITDEPTH);
+ EEVEE_GET_BOOL(props, taa_reprojection, SCE_EEVEE_TAA_REPROJECTION);
+ EEVEE_GET_BOOL(props, sss_enable, SCE_EEVEE_SSS_ENABLED);
+ EEVEE_GET_BOOL(props, sss_separate_albedo, SCE_EEVEE_SSS_SEPARATE_ALBEDO);
+ EEVEE_GET_BOOL(props, ssr_enable, SCE_EEVEE_SSR_ENABLED);
+ EEVEE_GET_BOOL(props, ssr_refraction, SCE_EEVEE_SSR_REFRACTION);
+ EEVEE_GET_BOOL(props, ssr_halfres, SCE_EEVEE_SSR_HALF_RESOLUTION);
+
+ EEVEE_GET_INT(props, gi_diffuse_bounces);
+ EEVEE_GET_INT(props, gi_diffuse_bounces);
+ EEVEE_GET_INT(props, gi_cubemap_resolution);
+ EEVEE_GET_INT(props, gi_visibility_resolution);
+
+ EEVEE_GET_INT(props, taa_samples);
+ EEVEE_GET_INT(props, taa_render_samples);
+
+ EEVEE_GET_INT(props, sss_samples);
+ EEVEE_GET_FLOAT(props, sss_jitter_threshold);
+
+ EEVEE_GET_FLOAT(props, ssr_quality);
+ EEVEE_GET_FLOAT(props, ssr_max_roughness);
+ EEVEE_GET_FLOAT(props, ssr_thickness);
+ EEVEE_GET_FLOAT(props, ssr_border_fade);
+ EEVEE_GET_FLOAT(props, ssr_firefly_fac);
+
+ EEVEE_GET_FLOAT(props, volumetric_start);
+ EEVEE_GET_FLOAT(props, volumetric_end);
+ EEVEE_GET_INT(props, volumetric_tile_size);
+ EEVEE_GET_INT(props, volumetric_samples);
+ EEVEE_GET_FLOAT(props, volumetric_sample_distribution);
+ EEVEE_GET_FLOAT(props, volumetric_light_clamp);
+ EEVEE_GET_INT(props, volumetric_shadow_samples);
+
+ EEVEE_GET_FLOAT(props, gtao_distance);
+ EEVEE_GET_FLOAT(props, gtao_factor);
+ EEVEE_GET_FLOAT(props, gtao_quality);
+
+ EEVEE_GET_FLOAT(props, bokeh_max_size);
+ EEVEE_GET_FLOAT(props, bokeh_threshold);
+
+ EEVEE_GET_FLOAT_ARRAY(props, bloom_color, 3);
+ EEVEE_GET_FLOAT(props, bloom_threshold);
+ EEVEE_GET_FLOAT(props, bloom_knee);
+ EEVEE_GET_FLOAT(props, bloom_intensity);
+ EEVEE_GET_FLOAT(props, bloom_radius);
+ EEVEE_GET_FLOAT(props, bloom_clamp);
+
+ EEVEE_GET_INT(props, motion_blur_samples);
+ EEVEE_GET_FLOAT(props, motion_blur_shutter);
+
+ EEVEE_GET_INT(props, shadow_method);
+ EEVEE_GET_INT(props, shadow_cube_size);
+ EEVEE_GET_INT(props, shadow_cascade_size);
+
+ /* Cleanup. */
+ IDP_FreeProperty(scene->layer_properties);
+ MEM_freeN(scene->layer_properties);
+ scene->layer_properties = NULL;
+
+#undef EEVEE_GET_FLOAT_ARRAY
+#undef EEVEE_GET_FLOAT
+#undef EEVEE_GET_INT
+#undef EEVEE_GET_BOOL
+ }
+ }
}
}
diff --git a/source/blender/draw/engines/eevee/eevee_bloom.c b/source/blender/draw/engines/eevee/eevee_bloom.c
index 2b0cdf846b4..f644b59c0b7 100644
--- a/source/blender/draw/engines/eevee/eevee_bloom.c
+++ b/source/blender/draw/engines/eevee/eevee_bloom.c
@@ -31,10 +31,13 @@
#include "BKE_global.h" /* for G.debug_value */
-#include "eevee_private.h"
#include "GPU_extensions.h"
#include "GPU_texture.h"
+#include "DEG_depsgraph_query.h"
+
+#include "eevee_private.h"
+
static struct {
/* Bloom */
struct GPUShader *bloom_blit_sh[2];
@@ -87,10 +90,9 @@ int EEVEE_bloom_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
EEVEE_EffectsInfo *effects = stl->effects;
const DRWContextState *draw_ctx = DRW_context_state_get();
- ViewLayer *view_layer = draw_ctx->view_layer;
- IDProperty *props = BKE_view_layer_engine_evaluated_get(view_layer, RE_engine_id_BLENDER_EEVEE);
+ const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
- if (BKE_collection_engine_property_value_get_bool(props, "bloom_enable")) {
+ if (scene_eval->flag & SCE_EEVEE_BLOOM_ENABLED) {
const float *viewport_size = DRW_viewport_size_get();
/* Shaders */
@@ -120,12 +122,12 @@ int EEVEE_bloom_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
});
/* Parameters */
- float threshold = BKE_collection_engine_property_value_get_float(props, "bloom_threshold");
- float knee = BKE_collection_engine_property_value_get_float(props, "bloom_knee");
- float intensity = BKE_collection_engine_property_value_get_float(props, "bloom_intensity");
- const float *color = BKE_collection_engine_property_value_get_float_array(props, "bloom_color");
- float radius = BKE_collection_engine_property_value_get_float(props, "bloom_radius");
- effects->bloom_clamp = BKE_collection_engine_property_value_get_float(props, "bloom_clamp");
+ const float threshold = scene_eval->eevee.bloom_threshold;
+ const float knee = scene_eval->eevee.bloom_knee;
+ const float intensity = scene_eval->eevee.bloom_intensity;
+ const float *color = scene_eval->eevee.bloom_color;
+ const float radius = scene_eval->eevee.bloom_radius;
+ effects->bloom_clamp = scene_eval->eevee.bloom_clamp;
/* determine the iteration count */
const float minDim = (float)MIN2(blitsize[0], blitsize[1]);
diff --git a/source/blender/draw/engines/eevee/eevee_depth_of_field.c b/source/blender/draw/engines/eevee/eevee_depth_of_field.c
index 1ba9b5f9de4..c275a5005ff 100644
--- a/source/blender/draw/engines/eevee/eevee_depth_of_field.c
+++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.c
@@ -82,11 +82,9 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *v
EEVEE_EffectsInfo *effects = stl->effects;
const DRWContextState *draw_ctx = DRW_context_state_get();
- ViewLayer *view_layer = draw_ctx->view_layer;
- IDProperty *props = BKE_view_layer_engine_evaluated_get(view_layer, RE_engine_id_BLENDER_EEVEE);
+ const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
- if (BKE_collection_engine_property_value_get_bool(props, "dof_enable")) {
- Scene *scene = draw_ctx->scene;
+ if (scene_eval->flag & SCE_EEVEE_DOF_ENABLED) {
RegionView3D *rv3d = draw_ctx->rv3d;
if (!e_data.dof_downsample_sh) {
@@ -141,7 +139,7 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *v
* unit.scale_length is how many meters per blender unit we have. We want to convert to blender units though
* because the shader reads coordinates in world space, which is in blender units.
* Note however that focus_distance is already in blender units and shall not be scaled here (see T48157). */
- float scale = (scene->unit.system) ? scene->unit.scale_length : 1.0f;
+ float scale = (scene_eval->unit.system) ? scene_eval->unit.scale_length : 1.0f;
float scale_camera = 0.001f / scale;
/* we want radius here for the aperture number */
float aperture = 0.5f * scale_camera * focal_len / fstop;
@@ -157,7 +155,7 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *v
effects->dof_params[2] = viewport_size[0] / sensor_scaled;
effects->dof_bokeh[0] = rotation;
effects->dof_bokeh[1] = ratio;
- effects->dof_bokeh[2] = BKE_collection_engine_property_value_get_float(props, "bokeh_max_size");
+ effects->dof_bokeh[2] = scene_eval->eevee.bokeh_max_size;
/* Precompute values to save instructions in fragment shader. */
effects->dof_bokeh_sides[0] = blades;
diff --git a/source/blender/draw/engines/eevee/eevee_engine.c b/source/blender/draw/engines/eevee/eevee_engine.c
index 21f14371653..4ef6644698f 100644
--- a/source/blender/draw/engines/eevee/eevee_engine.c
+++ b/source/blender/draw/engines/eevee/eevee_engine.c
@@ -428,7 +428,6 @@ static void eevee_layer_collection_settings_create(RenderEngine *UNUSED(engine),
BLI_assert(props &&
props->type == IDP_GROUP &&
props->subtype == IDP_GROUP_SUB_ENGINE_RENDER);
- // BKE_collection_engine_property_add_int(props, "high_quality_sphere_lamps", false);
UNUSED_VARS_NDEBUG(props);
}
@@ -437,69 +436,7 @@ static void eevee_view_layer_settings_create(RenderEngine *UNUSED(engine), IDPro
BLI_assert(props &&
props->type == IDP_GROUP &&
props->subtype == IDP_GROUP_SUB_ENGINE_RENDER);
-
- BKE_collection_engine_property_add_int(props, "gi_diffuse_bounces", 3);
- BKE_collection_engine_property_add_int(props, "gi_cubemap_resolution", 512);
- BKE_collection_engine_property_add_int(props, "gi_visibility_resolution", 32);
-
- BKE_collection_engine_property_add_int(props, "taa_samples", 16);
- BKE_collection_engine_property_add_int(props, "taa_render_samples", 64);
- BKE_collection_engine_property_add_bool(props, "taa_reprojection", true);
-
- BKE_collection_engine_property_add_bool(props, "sss_enable", false);
- BKE_collection_engine_property_add_int(props, "sss_samples", 7);
- BKE_collection_engine_property_add_float(props, "sss_jitter_threshold", 0.3f);
- BKE_collection_engine_property_add_bool(props, "sss_separate_albedo", false);
-
- BKE_collection_engine_property_add_bool(props, "ssr_enable", false);
- BKE_collection_engine_property_add_bool(props, "ssr_refraction", false);
- BKE_collection_engine_property_add_bool(props, "ssr_halfres", true);
- BKE_collection_engine_property_add_float(props, "ssr_quality", 0.25f);
- BKE_collection_engine_property_add_float(props, "ssr_max_roughness", 0.5f);
- BKE_collection_engine_property_add_float(props, "ssr_thickness", 0.2f);
- BKE_collection_engine_property_add_float(props, "ssr_border_fade", 0.075f);
- BKE_collection_engine_property_add_float(props, "ssr_firefly_fac", 10.0f);
-
- BKE_collection_engine_property_add_bool(props, "volumetric_enable", false);
- BKE_collection_engine_property_add_float(props, "volumetric_start", 0.1f);
- BKE_collection_engine_property_add_float(props, "volumetric_end", 100.0f);
- BKE_collection_engine_property_add_int(props, "volumetric_tile_size", 8);
- BKE_collection_engine_property_add_int(props, "volumetric_samples", 64);
- BKE_collection_engine_property_add_float(props, "volumetric_sample_distribution", 0.8f);
- BKE_collection_engine_property_add_bool(props, "volumetric_lights", true);
- BKE_collection_engine_property_add_float(props, "volumetric_light_clamp", 0.0f);
- BKE_collection_engine_property_add_bool(props, "volumetric_shadows", false);
- BKE_collection_engine_property_add_int(props, "volumetric_shadow_samples", 16);
- BKE_collection_engine_property_add_bool(props, "volumetric_colored_transmittance", true);
-
- BKE_collection_engine_property_add_bool(props, "gtao_enable", false);
- BKE_collection_engine_property_add_bool(props, "gtao_use_bent_normals", true);
- BKE_collection_engine_property_add_bool(props, "gtao_bounce", true);
- BKE_collection_engine_property_add_float(props, "gtao_distance", 0.2f);
- BKE_collection_engine_property_add_float(props, "gtao_factor", 1.0f);
- BKE_collection_engine_property_add_float(props, "gtao_quality", 0.25f);
-
- BKE_collection_engine_property_add_bool(props, "dof_enable", false);
- BKE_collection_engine_property_add_float(props, "bokeh_max_size", 100.0f);
- BKE_collection_engine_property_add_float(props, "bokeh_threshold", 1.0f);
-
- float default_bloom_color[3] = {1.0f, 1.0f, 1.0f};
- BKE_collection_engine_property_add_bool(props, "bloom_enable", false);
- BKE_collection_engine_property_add_float_array(props, "bloom_color", default_bloom_color, 3);
- BKE_collection_engine_property_add_float(props, "bloom_threshold", 0.8f);
- BKE_collection_engine_property_add_float(props, "bloom_knee", 0.5f);
- BKE_collection_engine_property_add_float(props, "bloom_intensity", 0.8f);
- BKE_collection_engine_property_add_float(props, "bloom_radius", 6.5f);
- BKE_collection_engine_property_add_float(props, "bloom_clamp", 1.0f);
-
- BKE_collection_engine_property_add_bool(props, "motion_blur_enable", false);
- BKE_collection_engine_property_add_int(props, "motion_blur_samples", 8);
- BKE_collection_engine_property_add_float(props, "motion_blur_shutter", 1.0f);
-
- BKE_collection_engine_property_add_int(props, "shadow_method", SHADOW_ESM);
- BKE_collection_engine_property_add_int(props, "shadow_cube_size", 512);
- BKE_collection_engine_property_add_int(props, "shadow_cascade_size", 1024);
- BKE_collection_engine_property_add_bool(props, "shadow_high_bitdepth", false);
+ UNUSED_VARS_NDEBUG(props);
}
static const DrawEngineDataSize eevee_data_size = DRW_VIEWPORT_DATA_SIZE(EEVEE_Data);
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c
index 5a1fb4f4149..95d6acdf56b 100644
--- a/source/blender/draw/engines/eevee/eevee_lightprobes.c
+++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c
@@ -43,6 +43,8 @@
#include "GPU_texture.h"
#include "GPU_glew.h"
+#include "DEG_depsgraph_query.h"
+
#include "eevee_engine.h"
#include "eevee_private.h"
@@ -301,8 +303,7 @@ void EEVEE_lightprobes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *UNUSED(veda
EEVEE_CommonUniformBuffer *common_data = &sldata->common_data;
bool update_all = false;
const DRWContextState *draw_ctx = DRW_context_state_get();
- ViewLayer *view_layer = draw_ctx->view_layer;
- IDProperty *props = BKE_view_layer_engine_evaluated_get(view_layer, RE_engine_id_BLENDER_EEVEE);
+ const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
/* Shaders */
if (!e_data.probe_filter_glossy_sh) {
@@ -324,13 +325,13 @@ void EEVEE_lightprobes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *UNUSED(veda
common_data->ssr_toggle = true;
common_data->sss_toggle = true;
- int prop_bounce_num = BKE_collection_engine_property_value_get_int(props, "gi_diffuse_bounces");
+ int prop_bounce_num = scene_eval->eevee.gi_diffuse_bounces;
if (sldata->probes->num_bounce != prop_bounce_num) {
sldata->probes->num_bounce = prop_bounce_num;
update_all = true;
}
- int prop_cubemap_res = BKE_collection_engine_property_value_get_int(props, "gi_cubemap_resolution");
+ int prop_cubemap_res = scene_eval->eevee.gi_cubemap_resolution;
if (sldata->probes->cubemap_res != prop_cubemap_res) {
sldata->probes->cubemap_res = prop_cubemap_res;
update_all = true;
@@ -342,7 +343,7 @@ void EEVEE_lightprobes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *UNUSED(veda
DRW_TEXTURE_FREE_SAFE(sldata->probe_pool);
}
- int visibility_res = BKE_collection_engine_property_value_get_int(props, "gi_visibility_resolution");
+ const int visibility_res = scene_eval->eevee.gi_visibility_resolution;
if (common_data->prb_irradiance_vis_size != visibility_res) {
common_data->prb_irradiance_vis_size = visibility_res;
update_all = true;
diff --git a/source/blender/draw/engines/eevee/eevee_lights.c b/source/blender/draw/engines/eevee/eevee_lights.c
index 7d2c636e215..d6ee27ce721 100644
--- a/source/blender/draw/engines/eevee/eevee_lights.c
+++ b/source/blender/draw/engines/eevee/eevee_lights.c
@@ -30,6 +30,8 @@
#include "BKE_object.h"
+#include "DEG_depsgraph_query.h"
+
#include "eevee_engine.h"
#include "eevee_private.h"
@@ -100,8 +102,7 @@ void EEVEE_lights_init(EEVEE_ViewLayerData *sldata)
sizeof(EEVEE_ShadowCascade) * MAX_SHADOW_CASCADE;
const DRWContextState *draw_ctx = DRW_context_state_get();
- ViewLayer *view_layer = draw_ctx->view_layer;
- IDProperty *props = BKE_view_layer_engine_evaluated_get(view_layer, RE_engine_id_BLENDER_EEVEE);
+ const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
if (!e_data.shadow_sh) {
e_data.shadow_sh = DRW_shader_create(
@@ -128,10 +129,10 @@ void EEVEE_lights_init(EEVEE_ViewLayerData *sldata)
/* Flip buffers */
SWAP(EEVEE_ShadowCasterBuffer *, sldata->lamps->shcaster_frontbuffer, sldata->lamps->shcaster_backbuffer);
- int sh_method = BKE_collection_engine_property_value_get_int(props, "shadow_method");
- int sh_cube_size = BKE_collection_engine_property_value_get_int(props, "shadow_cube_size");
- int sh_cascade_size = BKE_collection_engine_property_value_get_int(props, "shadow_cascade_size");
- int sh_high_bitdepth = BKE_collection_engine_property_value_get_int(props, "shadow_high_bitdepth");
+ const int sh_method = scene_eval->eevee.shadow_method;
+ int sh_cube_size = scene_eval->eevee.shadow_cube_size;
+ int sh_cascade_size = scene_eval->eevee.shadow_cascade_size;
+ const bool sh_high_bitdepth = (scene_eval->eevee.flag & SCE_EEVEE_SHADOW_HIGH_BITDEPTH) != 0;
EEVEE_LampsInfo *linfo = sldata->lamps;
if ((linfo->shadow_cube_size != sh_cube_size) ||
diff --git a/source/blender/draw/engines/eevee/eevee_motion_blur.c b/source/blender/draw/engines/eevee/eevee_motion_blur.c
index 0c8f929ec0e..114a2450716 100644
--- a/source/blender/draw/engines/eevee/eevee_motion_blur.c
+++ b/source/blender/draw/engines/eevee/eevee_motion_blur.c
@@ -108,20 +108,19 @@ int EEVEE_motion_blur_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *veda
EEVEE_EffectsInfo *effects = stl->effects;
const DRWContextState *draw_ctx = DRW_context_state_get();
- ViewLayer *view_layer = draw_ctx->view_layer;
+ const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
Scene *scene = draw_ctx->scene;
+
View3D *v3d = draw_ctx->v3d;
RegionView3D *rv3d = draw_ctx->rv3d;
ARegion *ar = draw_ctx->ar;
- IDProperty *props = BKE_view_layer_engine_evaluated_get(view_layer,
- RE_engine_id_BLENDER_EEVEE);
- if (BKE_collection_engine_property_value_get_bool(props, "motion_blur_enable")) {
+ if (scene_eval->eevee.flag & SCE_EEVEE_MOTION_BLUR_ENABLED) {
/* Update Motion Blur Matrices */
if (camera) {
float persmat[4][4];
- float ctime = BKE_scene_frame_get(scene);
- float delta = BKE_collection_engine_property_value_get_float(props, "motion_blur_shutter");
+ float ctime = BKE_scene_frame_get(scene_eval);
+ float delta = scene_eval->eevee.motion_blur_shutter;
Object *camera_object = DEG_get_evaluated_object(draw_ctx->depsgraph, camera);
/* Current matrix */
@@ -155,8 +154,7 @@ int EEVEE_motion_blur_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *veda
#endif
invert_m4(effects->current_ndc_to_world);
- effects->motion_blur_samples = BKE_collection_engine_property_value_get_int(props,
- "motion_blur_samples");
+ effects->motion_blur_samples = scene_eval->eevee.motion_blur_samples;
if (!e_data.motion_blur_sh) {
eevee_create_shader_motion_blur();
diff --git a/source/blender/draw/engines/eevee/eevee_occlusion.c b/source/blender/draw/engines/eevee/eevee_occlusion.c
index 7ad56327251..305daef87d1 100644
--- a/source/blender/draw/engines/eevee/eevee_occlusion.c
+++ b/source/blender/draw/engines/eevee/eevee_occlusion.c
@@ -31,6 +31,8 @@
#include "DNA_anim_types.h"
+#include "DEG_depsgraph_query.h"
+
#include "BKE_global.h" /* for G.debug_value */
#include "eevee_private.h"
@@ -73,11 +75,9 @@ int EEVEE_occlusion_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
EEVEE_EffectsInfo *effects = stl->effects;
const DRWContextState *draw_ctx = DRW_context_state_get();
- ViewLayer *view_layer = draw_ctx->view_layer;
- IDProperty *props = BKE_view_layer_engine_evaluated_get(view_layer,
- RE_engine_id_BLENDER_EEVEE);
+ const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
- if (BKE_collection_engine_property_value_get_bool(props, "gtao_enable")) {
+ if (scene_eval->flag & SCE_EEVEE_GTAO_ENABLED) {
const float *viewport_size = DRW_viewport_size_get();
const int fs_size[2] = {(int)viewport_size[0], (int)viewport_size[1]};
@@ -86,19 +86,19 @@ int EEVEE_occlusion_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
eevee_create_shader_occlusion();
}
- common_data->ao_dist = BKE_collection_engine_property_value_get_float(props, "gtao_distance");
- common_data->ao_factor = BKE_collection_engine_property_value_get_float(props, "gtao_factor");
- common_data->ao_quality = 1.0f - BKE_collection_engine_property_value_get_float(props, "gtao_quality");
+ common_data->ao_dist = scene_eval->eevee.gtao_distance;
+ common_data->ao_factor = scene_eval->eevee.gtao_factor;
+ common_data->ao_quality = 1.0f - scene_eval->eevee.gtao_quality;
- common_data->ao_settings = 1.0; /* USE_AO */
- if (BKE_collection_engine_property_value_get_bool(props, "gtao_use_bent_normals")) {
- common_data->ao_settings += 2.0; /* USE_BENT_NORMAL */
+ common_data->ao_settings = 1.0f; /* USE_AO */
+ if (scene_eval->flag & SCE_EEVEE_GTAO_BENT_NORMALS) {
+ common_data->ao_settings += 2.0f; /* USE_BENT_NORMAL */
}
- if (BKE_collection_engine_property_value_get_bool(props, "gtao_denoise")) {
- common_data->ao_settings += 4.0; /* USE_DENOISE */
+ if (scene_eval->flag & SCE_EEVEE_GTAO_BOUNCE) {
+ common_data->ao_settings += 4.0f; /* USE_DENOISE */
}
- common_data->ao_bounce_fac = (float)BKE_collection_engine_property_value_get_bool(props, "gtao_bounce");
+ common_data->ao_bounce_fac = (scene_eval->flag & SCE_EEVEE_GTAO_BOUNCE) ? 1.0f : 0.0f;
effects->gtao_horizons = DRW_texture_pool_query_2D(fs_size[0], fs_size[1], GPU_RGBA8,
&draw_engine_eevee_type);
@@ -139,10 +139,9 @@ void EEVEE_occlusion_output_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata
EEVEE_EffectsInfo *effects = stl->effects;
const DRWContextState *draw_ctx = DRW_context_state_get();
- ViewLayer *view_layer = draw_ctx->view_layer;
- IDProperty *props = BKE_view_layer_engine_evaluated_get(view_layer, RE_engine_id_BLENDER_EEVEE);
+ const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
- if (BKE_collection_engine_property_value_get_bool(props, "gtao_enable")) {
+ if (scene_eval->flag & SCE_EEVEE_GTAO_ENABLED) {
DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
float clear[4] = {0.0f, 0.0f, 0.0f, 0.0f};
diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h
index 42b3d8caf98..3ab1d55aeac 100644
--- a/source/blender/draw/engines/eevee/eevee_private.h
+++ b/source/blender/draw/engines/eevee/eevee_private.h
@@ -125,13 +125,6 @@ enum {
VAR_MAT_SSSALBED = (1 << 16),
};
-/* Shadow Technique */
-enum {
- SHADOW_ESM = 1,
- SHADOW_VSM = 2,
- SHADOW_METHOD_MAX = 3,
-};
-
typedef struct EEVEE_BoundSphere {
float center[3], radius;
} EEVEE_BoundSphere;
diff --git a/source/blender/draw/engines/eevee/eevee_render.c b/source/blender/draw/engines/eevee/eevee_render.c
index 697379e34d1..2d3cb440c7c 100644
--- a/source/blender/draw/engines/eevee/eevee_render.c
+++ b/source/blender/draw/engines/eevee/eevee_render.c
@@ -400,6 +400,7 @@ static void eevee_render_draw_background(EEVEE_Data *vedata)
void EEVEE_render_draw(EEVEE_Data *vedata, RenderEngine *engine, RenderLayer *rl, const rcti *rect)
{
const DRWContextState *draw_ctx = DRW_context_state_get();
+ const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
ViewLayer *view_layer = draw_ctx->view_layer;
const char *viewname = RE_GetActiveRenderView(engine->re);
EEVEE_PassList *psl = vedata->psl;
@@ -435,8 +436,7 @@ void EEVEE_render_draw(EEVEE_Data *vedata, RenderEngine *engine, RenderLayer *rl
EEVEE_occlusion_output_init(sldata, vedata);
}
- IDProperty *props = BKE_view_layer_engine_evaluated_get(view_layer, RE_engine_id_BLENDER_EEVEE);
- uint tot_sample = BKE_collection_engine_property_value_get_int(props, "taa_render_samples");
+ uint tot_sample = scene_eval->eevee.taa_render_samples;
uint render_samples = 0;
if (RE_engine_test_break(engine)) {
diff --git a/source/blender/draw/engines/eevee/eevee_screen_raytrace.c b/source/blender/draw/engines/eevee/eevee_screen_raytrace.c
index 87395f94fbb..74760b9c828 100644
--- a/source/blender/draw/engines/eevee/eevee_screen_raytrace.c
+++ b/source/blender/draw/engines/eevee/eevee_screen_raytrace.c
@@ -30,6 +30,8 @@
#include "BLI_dynstr.h"
#include "BLI_string_utils.h"
+#include "DEG_depsgraph_query.h"
+
#include "eevee_private.h"
#include "GPU_texture.h"
@@ -111,16 +113,14 @@ int EEVEE_screen_raytrace_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
const float *viewport_size = DRW_viewport_size_get();
const DRWContextState *draw_ctx = DRW_context_state_get();
- ViewLayer *view_layer = draw_ctx->view_layer;
- IDProperty *props = BKE_view_layer_engine_evaluated_get(view_layer,
- RE_engine_id_BLENDER_EEVEE);
+ const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
/* Compute pixel size, (shared with contact shadows) */
copy_v2_v2(common_data->ssr_pixelsize, viewport_size);
invert_v2(common_data->ssr_pixelsize);
- if (BKE_collection_engine_property_value_get_bool(props, "ssr_enable")) {
- const bool use_refraction = BKE_collection_engine_property_value_get_bool(props, "ssr_refraction");
+ if (scene_eval->eevee.flag & SCE_EEVEE_SSR_ENABLED) {
+ const bool use_refraction = (scene_eval->eevee.flag & SCE_EEVEE_SSR_REFRACTION) != 0;
if (use_refraction) {
/* TODO: Opti: Could be shared. */
@@ -132,12 +132,12 @@ int EEVEE_screen_raytrace_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
});
}
- effects->reflection_trace_full = !BKE_collection_engine_property_value_get_bool(props, "ssr_halfres");
- common_data->ssr_thickness = BKE_collection_engine_property_value_get_float(props, "ssr_thickness");
- common_data->ssr_border_fac = BKE_collection_engine_property_value_get_float(props, "ssr_border_fade");
- common_data->ssr_firefly_fac = BKE_collection_engine_property_value_get_float(props, "ssr_firefly_fac");
- common_data->ssr_max_roughness = BKE_collection_engine_property_value_get_float(props, "ssr_max_roughness");
- common_data->ssr_quality = 1.0f - 0.95f * BKE_collection_engine_property_value_get_float(props, "ssr_quality");
+ effects->reflection_trace_full = (scene_eval->eevee.flag & SCE_EEVEE_SSR_HALF_RESOLUTION) == 0;
+ common_data->ssr_thickness = scene_eval->eevee.ssr_thickness;
+ common_data->ssr_border_fac = scene_eval->eevee.ssr_border_fade;
+ common_data->ssr_firefly_fac = scene_eval->eevee.ssr_firefly_fac;
+ common_data->ssr_max_roughness = scene_eval->eevee.ssr_max_roughness;
+ common_data->ssr_quality = 1.0f - 0.95f * scene_eval->eevee.ssr_quality;
common_data->ssr_brdf_bias = 0.1f + common_data->ssr_quality * 0.6f; /* Range [0.1, 0.7]. */
if (common_data->ssr_firefly_fac < 1e-8f) {
diff --git a/source/blender/draw/engines/eevee/eevee_subsurface.c b/source/blender/draw/engines/eevee/eevee_subsurface.c
index d1e760aa123..1a46e0b5c33 100644
--- a/source/blender/draw/engines/eevee/eevee_subsurface.c
+++ b/source/blender/draw/engines/eevee/eevee_subsurface.c
@@ -29,6 +29,8 @@
#include "BLI_string_utils.h"
+#include "DEG_depsgraph_query.h"
+
#include "eevee_private.h"
#include "GPU_texture.h"
@@ -69,13 +71,12 @@ int EEVEE_subsurface_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
const int fs_size[2] = {(int)viewport_size[0], (int)viewport_size[1]};
const DRWContextState *draw_ctx = DRW_context_state_get();
- ViewLayer *view_layer = draw_ctx->view_layer;
- IDProperty *props = BKE_view_layer_engine_evaluated_get(view_layer, RE_engine_id_BLENDER_EEVEE);
+ const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
- if (BKE_collection_engine_property_value_get_bool(props, "sss_enable")) {
- effects->sss_sample_count = 1 + BKE_collection_engine_property_value_get_int(props, "sss_samples") * 2;
- effects->sss_separate_albedo = BKE_collection_engine_property_value_get_bool(props, "sss_separate_albedo");
- common_data->sss_jitter_threshold = BKE_collection_engine_property_value_get_float(props, "sss_jitter_threshold");
+ if (scene_eval->eevee.flag & SCE_EEVEE_SSS_ENABLED) {
+ effects->sss_sample_count = 1 + scene_eval->eevee.sss_samples * 2;
+ effects->sss_separate_albedo = (scene_eval->eevee.flag & SCE_EEVEE_SSS_SEPARATE_ALBEDO) != 0;
+ common_data->sss_jitter_threshold = scene_eval->eevee.sss_jitter_threshold;
/* Force separate albedo for final render */
if (DRW_state_is_image_render()) {
@@ -147,10 +148,9 @@ void EEVEE_subsurface_output_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Dat
EEVEE_EffectsInfo *effects = stl->effects;
const DRWContextState *draw_ctx = DRW_context_state_get();
- ViewLayer *view_layer = draw_ctx->view_layer;
- IDProperty *props = BKE_view_layer_engine_evaluated_get(view_layer, RE_engine_id_BLENDER_EEVEE);
+ const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
- if (BKE_collection_engine_property_value_get_bool(props, "sss_enable")) {
+ if (scene_eval->flag & SCE_EEVEE_SSS_ENABLED) {
DRW_texture_ensure_fullscreen_2D(&txl->sss_dir_accum, GPU_RGBA16F, 0);
DRW_texture_ensure_fullscreen_2D(&txl->sss_col_accum, GPU_RGBA16F, 0);
diff --git a/source/blender/draw/engines/eevee/eevee_temporal_sampling.c b/source/blender/draw/engines/eevee/eevee_temporal_sampling.c
index 889a7f6cdcd..7cd76669fe4 100644
--- a/source/blender/draw/engines/eevee/eevee_temporal_sampling.c
+++ b/source/blender/draw/engines/eevee/eevee_temporal_sampling.c
@@ -32,6 +32,8 @@
#include "BLI_rand.h"
#include "BLI_string_utils.h"
+#include "DEG_depsgraph_query.h"
+
#include "eevee_private.h"
#include "GPU_texture.h"
@@ -192,10 +194,9 @@ int EEVEE_temporal_sampling_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data
effects->taa_render_sample = 1;
const DRWContextState *draw_ctx = DRW_context_state_get();
- ViewLayer *view_layer = draw_ctx->view_layer;
- IDProperty *props = BKE_view_layer_engine_evaluated_get(view_layer, RE_engine_id_BLENDER_EEVEE);
+ const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
- if ((BKE_collection_engine_property_value_get_int(props, "taa_samples") != 1 &&
+ if (((scene_eval->eevee.taa_samples != 1) &&
/* FIXME the motion blur camera evaluation is tagging view_updated
* thus making the TAA always reset and never stopping rendering. */
(effects->enabled_effects & EFFECT_MOTION_BLUR) == 0) ||
@@ -204,7 +205,7 @@ int EEVEE_temporal_sampling_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data
float persmat[4][4], viewmat[4][4];
if (!DRW_state_is_image_render() &&
- BKE_collection_engine_property_value_get_bool(props, "taa_reprojection"))
+ (scene_eval->eevee.flag & SCE_EEVEE_TAA_REPROJECTION))
{
repro_flag = EFFECT_TAA_REPROJECT | EFFECT_VELOCITY_BUFFER | EFFECT_DEPTH_DOUBLE_BUFFER | EFFECT_DOUBLE_BUFFER | EFFECT_POST_BUFFER;
effects->taa_reproject_sample = ((effects->taa_reproject_sample + 1) % 16);
@@ -221,7 +222,7 @@ int EEVEE_temporal_sampling_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data
view_is_valid = view_is_valid && (ED_screen_animation_no_scrub(wm) == NULL);
}
- effects->taa_total_sample = BKE_collection_engine_property_value_get_int(props, "taa_samples");
+ effects->taa_total_sample = scene_eval->eevee.taa_samples;
MAX2(effects->taa_total_sample, 0);
DRW_viewport_matrix_get(persmat, DRW_MAT_PERS);
diff --git a/source/blender/draw/engines/eevee/eevee_volumes.c b/source/blender/draw/engines/eevee/eevee_volumes.c
index 30927d8df6f..2d074eea522 100644
--- a/source/blender/draw/engines/eevee/eevee_volumes.c
+++ b/source/blender/draw/engines/eevee/eevee_volumes.c
@@ -41,6 +41,8 @@
#include "ED_screen.h"
+#include "DEG_depsgraph_query.h"
+
#include "eevee_private.h"
#include "GPU_draw.h"
#include "GPU_texture.h"
@@ -155,28 +157,27 @@ int EEVEE_volumes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
EEVEE_CommonUniformBuffer *common_data = &sldata->common_data;
const DRWContextState *draw_ctx = DRW_context_state_get();
- ViewLayer *view_layer = draw_ctx->view_layer;
- IDProperty *props = BKE_view_layer_engine_evaluated_get(view_layer, RE_engine_id_BLENDER_EEVEE);
+ const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
const float *viewport_size = DRW_viewport_size_get();
BLI_listbase_clear(&e_data.smoke_domains);
- if (BKE_collection_engine_property_value_get_bool(props, "volumetric_enable")) {
+ if (scene_eval->eevee.flag & SCE_EEVEE_VOLUMETRIC_ENABLED) {
/* Shaders */
if (!e_data.volumetric_scatter_sh) {
eevee_create_shader_volumes();
}
- int tile_size = BKE_collection_engine_property_value_get_int(props, "volumetric_tile_size");
+ const int tile_size = scene_eval->eevee.volumetric_tile_size;
/* Find Froxel Texture resolution. */
int tex_size[3];
tex_size[0] = (int)ceilf(fmaxf(1.0f, viewport_size[0] / (float)tile_size));
tex_size[1] = (int)ceilf(fmaxf(1.0f, viewport_size[1] / (float)tile_size));
- tex_size[2] = max_ii(BKE_collection_engine_property_value_get_int(props, "volumetric_samples"), 1);
+ tex_size[2] = max_ii(scene_eval->eevee.volumetric_samples, 1);
common_data->vol_coord_scale[0] = viewport_size[0] / (float)(tile_size * tex_size[0]);
common_data->vol_coord_scale[1] = viewport_size[1] / (float)(tile_size * tex_size[1]);
@@ -286,19 +287,16 @@ int EEVEE_volumes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
GPU_ATTACHMENT_TEXTURE(txl->volume_transmittance_history)
});
- float integration_start = BKE_collection_engine_property_value_get_float(props, "volumetric_start");
- float integration_end = BKE_collection_engine_property_value_get_float(props, "volumetric_end");
- common_data->vol_light_clamp = BKE_collection_engine_property_value_get_float(props, "volumetric_light_clamp");
-
- common_data->vol_shadow_steps = (float)BKE_collection_engine_property_value_get_int(props, "volumetric_shadow_samples");
- if (BKE_collection_engine_property_value_get_bool(props, "volumetric_shadows")) {
- }
- else {
+ float integration_start = scene_eval->eevee.volumetric_start;
+ float integration_end = scene_eval->eevee.volumetric_end;
+ common_data->vol_light_clamp = scene_eval->eevee.volumetric_light_clamp;
+ common_data->vol_shadow_steps = (float)scene_eval->eevee.volumetric_shadow_samples;
+ if ((scene_eval->eevee.flag & SCE_EEVEE_VOLUMETRIC_SHADOWS) == 0) {
common_data->vol_shadow_steps = 0;
}
if (DRW_viewport_is_persp_get()) {
- float sample_distribution = BKE_collection_engine_property_value_get_float(props, "volumetric_sample_distribution");
+ float sample_distribution = scene_eval->eevee.volumetric_sample_distribution;
sample_distribution = 4.0f * (1.00001f - sample_distribution);
const float clip_start = common_data->view_vecs[0][2];
@@ -326,7 +324,7 @@ int EEVEE_volumes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
common_data->vol_light_clamp = FLT_MAX;
}
- common_data->vol_use_lights = BKE_collection_engine_property_value_get_bool(props, "volumetric_lights");
+ common_data->vol_use_lights = (scene_eval->eevee.flag & SCE_EEVEE_VOLUMETRIC_LIGHTS) != 0;
return EFFECT_VOLUMETRIC | EFFECT_POST_BUFFER;
}
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 81a1f483611..fa147ff1226 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -1017,7 +1017,7 @@ static void view3d_main_region_listener(
static void view3d_main_region_message_subscribe(
const struct bContext *C,
- struct WorkSpace *workspace, struct Scene *scene,
+ struct WorkSpace *workspace, struct Scene *UNUSED(scene),
struct bScreen *UNUSED(screen), struct ScrArea *UNUSED(sa), struct ARegion *ar,
struct wmMsgBus *mbus)
{
@@ -1075,19 +1075,7 @@ static void view3d_main_region_message_subscribe(
WM_msg_subscribe_rna_anon_prop(mbus, RenderSettings, use_border, &msg_sub_value_region_tag_redraw);
}
- /* Each engine could be responsible for its own engine data types.
- * For now this is simplest. */
- if (STREQ(scene->r.engine, RE_engine_id_BLENDER_EEVEE)) {
- extern StructRNA RNA_ViewLayerEngineSettingsEevee;
- WM_msg_subscribe_rna_anon_type(mbus, ViewLayerEngineSettingsEevee, &msg_sub_value_region_tag_redraw);
- }
-#ifdef WITH_CLAY_ENGINE
- else if (STREQ(scene->r.engine, RE_engine_id_BLENDER_CLAY)) {
- extern StructRNA RNA_ViewLayerEngineSettingsClay;
- WM_msg_subscribe_rna_anon_type(mbus, ViewLayerEngineSettingsClay, &msg_sub_value_region_tag_redraw);
- }
-#endif
-
+ WM_msg_subscribe_rna_anon_type(mbus, SceneEEVEE, &msg_sub_value_region_tag_redraw);
WM_msg_subscribe_rna_anon_type(mbus, SceneDisplay, &msg_sub_value_region_tag_redraw);
WM_msg_subscribe_rna_anon_type(mbus, ObjectDisplay, &msg_sub_value_region_tag_redraw);
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 03cab034ec1..362839e8853 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -1363,6 +1363,53 @@ typedef struct SceneDisplay {
float shadow_shift;
} SceneDisplay;
+typedef struct SceneEEVEE {
+ int flag;
+ int gi_diffuse_bounces;
+ int gi_cubemap_resolution;
+ int gi_visibility_resolution;
+
+ int taa_samples;
+ int taa_render_samples;
+ int sss_samples;
+ float sss_jitter_threshold;
+
+ float ssr_quality;
+ float ssr_max_roughness;
+ float ssr_thickness;
+ float ssr_border_fade;
+ float ssr_firefly_fac;
+
+ float volumetric_start;
+ float volumetric_end;
+ int volumetric_tile_size;
+ int volumetric_samples;
+ float volumetric_sample_distribution;
+ float volumetric_light_clamp;
+ int volumetric_shadow_samples;
+
+ float gtao_distance;
+ float gtao_factor;
+ float gtao_quality;
+
+ float bokeh_max_size;
+ float bokeh_threshold;
+
+ float bloom_color[3];
+ float bloom_threshold;
+ float bloom_knee;
+ float bloom_intensity;
+ float bloom_radius;
+ float bloom_clamp;
+
+ int motion_blur_samples;
+ float motion_blur_shutter;
+
+ int shadow_method;
+ int shadow_cube_size;
+ int shadow_cascade_size;
+} SceneEEVEE;
+
/* *************************************************************** */
/* Scene ID-Block */
@@ -1456,6 +1503,7 @@ typedef struct Scene {
IDProperty *layer_properties; /* settings to be override by workspaces */
struct SceneDisplay display;
+ struct SceneEEVEE eevee;
} Scene;
/* **************** RENDERDATA ********************* */
@@ -2038,6 +2086,34 @@ typedef enum eGPencil_Placement_Flags {
#define USER_UNIT_OPT_SPLIT 1
#define USER_UNIT_ROT_RADIANS 2
+/* SceneEEVEE->flag */
+enum {
+ SCE_EEVEE_VOLUMETRIC_ENABLED = (1 << 0),
+ SCE_EEVEE_VOLUMETRIC_LIGHTS = (1 << 1),
+ SCE_EEVEE_VOLUMETRIC_SHADOWS = (1 << 2),
+ SCE_EEVEE_VOLUMETRIC_COLORED = (1 << 3),
+ SCE_EEVEE_GTAO_ENABLED = (1 << 4),
+ SCE_EEVEE_GTAO_BENT_NORMALS = (1 << 5),
+ SCE_EEVEE_GTAO_BOUNCE = (1 << 6),
+ SCE_EEVEE_DOF_ENABLED = (1 << 7),
+ SCE_EEVEE_BLOOM_ENABLED = (1 << 8),
+ SCE_EEVEE_MOTION_BLUR_ENABLED = (1 << 9),
+ SCE_EEVEE_SHADOW_HIGH_BITDEPTH = (1 << 10),
+ SCE_EEVEE_TAA_REPROJECTION = (1 << 11),
+ SCE_EEVEE_SSS_ENABLED = (1 << 12),
+ SCE_EEVEE_SSS_SEPARATE_ALBEDO = (1 << 13),
+ SCE_EEVEE_SSR_ENABLED = (1 << 14),
+ SCE_EEVEE_SSR_REFRACTION = (1 << 15),
+ SCE_EEVEE_SSR_HALF_RESOLUTION = (1 << 16),
+};
+
+/* SceneEEVEE->shadow_method */
+enum {
+ SHADOW_ESM = 1,
+ SHADOW_VSM = 2,
+ SHADOW_METHOD_MAX = 3,
+};
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index dcfd139a008..0461389ce21 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -503,6 +503,7 @@ extern StructRNA RNA_RigidBodyObject;
extern StructRNA RNA_RigidBodyJointConstraint;
extern StructRNA RNA_SPHFluidSettings;
extern StructRNA RNA_Scene;
+extern StructRNA RNA_SceneEEVEE;
extern StructRNA RNA_SceneRenderLayer;
extern StructRNA RNA_SceneSequence;
extern StructRNA RNA_SceneObjects;
diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c
index cbd93141213..3d6cabe0fa5 100644
--- a/source/blender/makesrna/intern/rna_layer.c
+++ b/source/blender/makesrna/intern/rna_layer.c
@@ -290,18 +290,6 @@ static void rna_LayerEngineSettings_##_ENGINE_##_##_NAME_##_set(PointerRNA *ptr,
#define RNA_LAYER_ENGINE_CLAY_GET_SET_BOOL(_NAME_) \
RNA_LAYER_ENGINE_GET_SET(bool, Clay, _NAME_)
-#define RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(_NAME_) \
- RNA_LAYER_ENGINE_GET_SET(float, Eevee, _NAME_)
-
-#define RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT_ARRAY(_NAME_, _LEN_) \
- RNA_LAYER_ENGINE_GET_SET_ARRAY(float, Eevee, _NAME_, _LEN_)
-
-#define RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(_NAME_) \
- RNA_LAYER_ENGINE_GET_SET(int, Eevee, _NAME_)
-
-#define RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(_NAME_) \
- RNA_LAYER_ENGINE_GET_SET(bool, Eevee, _NAME_)
-
/* clay engine */
#ifdef WITH_CLAY_ENGINE
/* ViewLayer settings. */
@@ -320,61 +308,6 @@ RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(ssao_attenuation)
RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(hair_brightness_randomness)
#endif /* WITH_CLAY_ENGINE */
-/* eevee engine */
-/* ViewLayer settings. */
-RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(gtao_enable)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(gtao_use_bent_normals)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(gtao_bounce)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(gtao_factor)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(gtao_quality)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(gtao_distance)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(dof_enable)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(bokeh_max_size)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(bokeh_threshold)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(bloom_enable)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(bloom_threshold)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT_ARRAY(bloom_color, 3)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(bloom_knee)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(bloom_radius)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(bloom_clamp)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(bloom_intensity)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(motion_blur_enable)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(motion_blur_samples)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(motion_blur_shutter)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(volumetric_enable)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(volumetric_start)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(volumetric_end)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(volumetric_tile_size)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(volumetric_samples)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(volumetric_sample_distribution)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(volumetric_lights)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(volumetric_light_clamp)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(volumetric_shadows)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(volumetric_shadow_samples)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(volumetric_colored_transmittance)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(sss_enable)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(sss_samples)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(sss_jitter_threshold)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(sss_separate_albedo)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(ssr_refraction)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(ssr_enable)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(ssr_halfres)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(ssr_quality)
-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_cube_size)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(shadow_cascade_size)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(shadow_high_bitdepth)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(taa_samples)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(taa_render_samples)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(taa_reprojection)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(gi_diffuse_bounces)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(gi_cubemap_resolution)
-RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(gi_visibility_resolution)
-
#undef RNA_LAYER_ENGINE_GET_SET
static void rna_ViewLayerEngineSettings_update(bContext *C, PointerRNA *UNUSED(ptr))
@@ -448,9 +381,6 @@ static StructRNA *rna_ViewLayerSettings_refine(PointerRNA *ptr)
return &RNA_ViewLayerEngineSettingsClay;
}
#endif
- if (STREQ(props->name, RE_engine_id_BLENDER_EEVEE)) {
- return &RNA_ViewLayerEngineSettingsEevee;
- }
break;
default:
BLI_assert(!"Mode not fully implemented");
@@ -508,10 +438,6 @@ static StructRNA *rna_LayerCollectionSettings_refine(PointerRNA *ptr)
return &RNA_LayerCollectionEngineSettingsClay;
}
#endif
- if (STREQ(props->name, RE_engine_id_BLENDER_EEVEE)) {
- /* printf("Mode not fully implemented\n"); */
- return &RNA_LayerCollectionSettings;
- }
break;
default:
BLI_assert(!"Mode not fully implemented");
@@ -995,473 +921,6 @@ static void rna_def_view_layer_engine_settings_clay(BlenderRNA *brna)
}
#endif /* WITH_CLAY_ENGINE */
-static void rna_def_view_layer_engine_settings_eevee(BlenderRNA *brna)
-{
- StructRNA *srna;
- PropertyRNA *prop;
-
- /* Keep in sync with eevee_private.h */
- static const EnumPropertyItem eevee_shadow_method_items[] = {
- {1, "ESM", 0, "ESM", "Exponential Shadow Mapping"},
- {2, "VSM", 0, "VSM", "Variance Shadow Mapping"},
- {0, NULL, 0, NULL, NULL}
- };
-
- static const 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", ""},
- {0, NULL, 0, NULL, NULL}
- };
-
- static const EnumPropertyItem eevee_gi_visibility_size_items[] = {
- {8, "8", 0, "8px", ""},
- {16, "16", 0, "16px", ""},
- {32, "32", 0, "32px", ""},
- {64, "64", 0, "64px", ""},
- {0, NULL, 0, NULL, NULL}
- };
-
- static const EnumPropertyItem eevee_volumetric_tile_size_items[] = {
- {2, "2", 0, "2px", ""},
- {4, "4", 0, "4px", ""},
- {8, "8", 0, "8px", ""},
- {16, "16", 0, "16px", ""},
- {0, NULL, 0, NULL, NULL}
- };
-
- srna = RNA_def_struct(brna, "ViewLayerEngineSettingsEevee", "ViewLayerSettings");
- RNA_def_struct_ui_text(srna, "Eevee Scene Layer Settings", "Eevee Engine settings");
-
- RNA_define_verify_sdna(0); /* not in sdna */
-
- /* see RNA_LAYER_ENGINE_GET_SET macro */
-
- /* Indirect Lighting */
- prop = RNA_def_property(srna, "gi_diffuse_bounces", PROP_INT, PROP_NONE);
- RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_gi_diffuse_bounces_get",
- "rna_LayerEngineSettings_Eevee_gi_diffuse_bounces_set", NULL);
- RNA_def_property_ui_text(prop, "Diffuse Bounces", "Number of time the light is reinjected inside light grids, "
- "0 disable indirect diffuse light");
- RNA_def_property_range(prop, 0, INT_MAX);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "gi_cubemap_resolution", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_Eevee_gi_cubemap_resolution_get",
- "rna_LayerEngineSettings_Eevee_gi_cubemap_resolution_set", NULL);
- RNA_def_property_enum_items(prop, eevee_shadow_size_items);
- RNA_def_property_ui_text(prop, "Cubemap Size", "Size of every cubemaps");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "gi_visibility_resolution", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_Eevee_gi_visibility_resolution_get",
- "rna_LayerEngineSettings_Eevee_gi_visibility_resolution_set", NULL);
- RNA_def_property_enum_items(prop, eevee_gi_visibility_size_items);
- RNA_def_property_ui_text(prop, "Irradiance Visibility Size",
- "Size of the shadow map applied to each irradiance sample");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- /* Temporal Anti-Aliasing (super sampling) */
- prop = RNA_def_property(srna, "taa_samples", PROP_INT, PROP_NONE);
- RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_taa_samples_get",
- "rna_LayerEngineSettings_Eevee_taa_samples_set", NULL);
- RNA_def_property_ui_text(prop, "Viewport Samples", "Number of samples, unlimited if 0");
- RNA_def_property_range(prop, 0, INT_MAX);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "taa_render_samples", PROP_INT, PROP_NONE);
- RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_taa_render_samples_get",
- "rna_LayerEngineSettings_Eevee_taa_render_samples_set", NULL);
- RNA_def_property_ui_text(prop, "Render Samples", "Number of samples per pixels for rendering");
- RNA_def_property_range(prop, 1, INT_MAX);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "taa_reprojection", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_taa_reprojection_get",
- "rna_LayerEngineSettings_Eevee_taa_reprojection_set");
- RNA_def_property_ui_text(prop, "Viewport Denoising", "Denoise image using temporal reprojection "
- "(can leave some ghosting)");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- /* Screen Space Subsurface Scattering */
- prop = RNA_def_property(srna, "sss_enable", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_sss_enable_get",
- "rna_LayerEngineSettings_Eevee_sss_enable_set");
- RNA_def_property_ui_text(prop, "Subsurface Scattering", "Enable screen space subsurface scattering");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "sss_samples", PROP_INT, PROP_NONE);
- RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_sss_samples_get",
- "rna_LayerEngineSettings_Eevee_sss_samples_set", NULL);
- RNA_def_property_ui_text(prop, "Samples", "Number of samples to compute the scattering effect");
- RNA_def_property_range(prop, 1, 32);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "sss_jitter_threshold", PROP_FLOAT, PROP_FACTOR);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_sss_jitter_threshold_get",
- "rna_LayerEngineSettings_Eevee_sss_jitter_threshold_set", NULL);
- RNA_def_property_ui_text(prop, "Jitter Threshold", "Rotate samples that are below this threshold");
- RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "sss_separate_albedo", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_sss_separate_albedo_get",
- "rna_LayerEngineSettings_Eevee_sss_separate_albedo_set");
- RNA_def_property_ui_text(prop, "Separate Albedo", "Avoid albedo being blured by the subsurface scattering "
- "but uses more video memory");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- /* Screen Space Reflection */
- prop = RNA_def_property(srna, "ssr_enable", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_enable_get",
- "rna_LayerEngineSettings_Eevee_ssr_enable_set");
- RNA_def_property_ui_text(prop, "Screen Space Reflections", "Enable screen space reflection");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "ssr_refraction", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_refraction_get",
- "rna_LayerEngineSettings_Eevee_ssr_refraction_set");
- RNA_def_property_ui_text(prop, "Screen Space Refractions", "Enable screen space Refractions");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "ssr_halfres", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_halfres_get",
- "rna_LayerEngineSettings_Eevee_ssr_halfres_set");
- RNA_def_property_ui_text(prop, "Half Res Trace", "Raytrace at a lower resolution");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "ssr_quality", PROP_FLOAT, PROP_FACTOR);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_quality_get",
- "rna_LayerEngineSettings_Eevee_ssr_quality_set", NULL);
- RNA_def_property_ui_text(prop, "Trace Quality", "Quality of the screen space raytracing");
- RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "ssr_max_roughness", PROP_FLOAT, PROP_FACTOR);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_max_roughness_get",
- "rna_LayerEngineSettings_Eevee_ssr_max_roughness_set", NULL);
- RNA_def_property_ui_text(prop, "Max Roughness", "Do not raytrace reflections for roughness above this value");
- RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "ssr_thickness", PROP_FLOAT, PROP_DISTANCE);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_thickness_get",
- "rna_LayerEngineSettings_Eevee_ssr_thickness_set", NULL);
- RNA_def_property_ui_text(prop, "Thickness", "Pixel thickness used to detect intersection");
- RNA_def_property_range(prop, 1e-6f, FLT_MAX);
- RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 5, 3);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "ssr_border_fade", PROP_FLOAT, PROP_FACTOR);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_border_fade_get",
- "rna_LayerEngineSettings_Eevee_ssr_border_fade_set", NULL);
- RNA_def_property_ui_text(prop, "Edge Fading", "Screen percentage used to fade the SSR");
- RNA_def_property_range(prop, 0.0f, 0.5f);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "ssr_firefly_fac", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_firefly_fac_get",
- "rna_LayerEngineSettings_Eevee_ssr_firefly_fac_set", NULL);
- RNA_def_property_ui_text(prop, "Clamp", "Clamp pixel intensity to remove noise (0 to disabled)");
- RNA_def_property_range(prop, 0.0f, FLT_MAX);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- /* Volumetrics */
- prop = RNA_def_property(srna, "volumetric_enable", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_enable_get",
- "rna_LayerEngineSettings_Eevee_volumetric_enable_set");
- RNA_def_property_ui_text(prop, "Volumetrics", "Enable scattering and absorbance of volumetric material");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "volumetric_start", PROP_FLOAT, PROP_DISTANCE);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_start_get",
- "rna_LayerEngineSettings_Eevee_volumetric_start_set", NULL);
- RNA_def_property_ui_text(prop, "Start", "Start distance of the volumetric effect");
- RNA_def_property_range(prop, 1e-6f, FLT_MAX);
- RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "volumetric_end", PROP_FLOAT, PROP_DISTANCE);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_end_get",
- "rna_LayerEngineSettings_Eevee_volumetric_end_set", NULL);
- RNA_def_property_ui_text(prop, "End", "End distance of the volumetric effect");
- RNA_def_property_range(prop, 1e-6f, FLT_MAX);
- RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "volumetric_tile_size", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_tile_size_get",
- "rna_LayerEngineSettings_Eevee_volumetric_tile_size_set", NULL);
- RNA_def_property_enum_items(prop, eevee_volumetric_tile_size_items);
- RNA_def_property_ui_text(prop, "Tile Size", "Control the quality of the volumetric effects "
- "(lower size increase vram usage and quality)");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "volumetric_samples", PROP_INT, PROP_NONE);
- RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_samples_get",
- "rna_LayerEngineSettings_Eevee_volumetric_samples_set", NULL);
- RNA_def_property_ui_text(prop, "Samples", "Number of samples to compute volumetric effects");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_range(prop, 1, 256);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "volumetric_sample_distribution", PROP_FLOAT, PROP_FACTOR);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_sample_distribution_get",
- "rna_LayerEngineSettings_Eevee_volumetric_sample_distribution_set", NULL);
- RNA_def_property_ui_text(prop, "Exponential Sampling", "Distribute more samples closer to the camera");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "volumetric_lights", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_lights_get",
- "rna_LayerEngineSettings_Eevee_volumetric_lights_set");
- RNA_def_property_ui_text(prop, "Volumetric Lighting", "Enable scene lamps interactions with volumetrics");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "volumetric_light_clamp", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_light_clamp_get",
- "rna_LayerEngineSettings_Eevee_volumetric_light_clamp_set", NULL);
- RNA_def_property_range(prop, 0.0f, FLT_MAX);
- RNA_def_property_ui_text(prop, "Clamp", "Maximum light contribution, reducing noise");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "volumetric_shadows", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_shadows_get",
- "rna_LayerEngineSettings_Eevee_volumetric_shadows_set");
- RNA_def_property_ui_text(prop, "Volumetric Shadows", "Generate shadows from volumetric material (Very expensive)");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "volumetric_shadow_samples", PROP_INT, PROP_NONE);
- RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_shadow_samples_get",
- "rna_LayerEngineSettings_Eevee_volumetric_shadow_samples_set", NULL);
- RNA_def_property_range(prop, 1, 128);
- RNA_def_property_ui_text(prop, "Volumetric Shadow Samples", "Number of samples to compute volumetric shadowing");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "volumetric_colored_transmittance", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_colored_transmittance_get",
- "rna_LayerEngineSettings_Eevee_volumetric_colored_transmittance_set");
- RNA_def_property_ui_text(prop, "Colored Transmittance", "Enable wavelength dependent volumetric transmittance");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- /* Ambient Occlusion */
- prop = RNA_def_property(srna, "gtao_enable", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_gtao_enable_get",
- "rna_LayerEngineSettings_Eevee_gtao_enable_set");
- RNA_def_property_ui_text(prop, "Ambient Occlusion", "Enable ambient occlusion to simulate medium scale indirect shadowing");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "gtao_use_bent_normals", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_gtao_use_bent_normals_get",
- "rna_LayerEngineSettings_Eevee_gtao_use_bent_normals_set");
- RNA_def_property_ui_text(prop, "Bent Normals", "Compute main non occluded direction to sample the environment");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "gtao_bounce", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_gtao_bounce_get",
- "rna_LayerEngineSettings_Eevee_gtao_bounce_set");
- RNA_def_property_ui_text(prop, "Bounces Approximation", "An approximation to simulate light bounces "
- "giving less occlusion on brighter objects");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "gtao_factor", PROP_FLOAT, PROP_FACTOR);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_gtao_factor_get", "rna_LayerEngineSettings_Eevee_gtao_factor_set", NULL);
- RNA_def_property_ui_text(prop, "Factor", "Factor for ambient occlusion blending");
- RNA_def_property_range(prop, 0.0f, FLT_MAX);
- RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 2);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, 0, "rna_LayerCollectionEngineSettings_update");
-
- prop = RNA_def_property(srna, "gtao_quality", PROP_FLOAT, PROP_FACTOR);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_gtao_quality_get", "rna_LayerEngineSettings_Eevee_gtao_quality_set", NULL);
- RNA_def_property_ui_text(prop, "Trace Quality", "Quality of the horizon search");
- RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, 0, "rna_LayerCollectionEngineSettings_update");
-
- prop = RNA_def_property(srna, "gtao_distance", PROP_FLOAT, PROP_DISTANCE);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_gtao_distance_get", "rna_LayerEngineSettings_Eevee_gtao_distance_set", NULL);
- RNA_def_property_ui_text(prop, "Distance", "Distance of object that contribute to the ambient occlusion effect");
- RNA_def_property_range(prop, 0.0f, 100000.0f);
- RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, 0, "rna_LayerCollectionEngineSettings_update");
-
- /* Depth of Field */
- prop = RNA_def_property(srna, "dof_enable", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_dof_enable_get",
- "rna_LayerEngineSettings_Eevee_dof_enable_set");
- RNA_def_property_ui_text(prop, "Depth of Field", "Enable depth of field using the values from the active camera");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "bokeh_max_size", PROP_FLOAT, PROP_FACTOR);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bokeh_max_size_get",
- "rna_LayerEngineSettings_Eevee_bokeh_max_size_set", NULL);
- RNA_def_property_ui_text(prop, "Max Size", "Max size of the bokeh shape for the depth of field (lower is faster)");
- RNA_def_property_range(prop, 0.0f, 2000.0f);
- RNA_def_property_ui_range(prop, 2.0f, 200.0f, 1, 3);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "bokeh_threshold", PROP_FLOAT, PROP_FACTOR);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bokeh_threshold_get",
- "rna_LayerEngineSettings_Eevee_bokeh_threshold_set", NULL);
- RNA_def_property_ui_text(prop, "Sprite Threshold", "Brightness threshold for using sprite base depth of field");
- RNA_def_property_range(prop, 0.0f, 100000.0f);
- RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- /* Bloom */
- prop = RNA_def_property(srna, "bloom_enable", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_enable_get",
- "rna_LayerEngineSettings_Eevee_bloom_enable_set");
- RNA_def_property_ui_text(prop, "Bloom", "High brighness pixels generate a glowing effect");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "bloom_threshold", PROP_FLOAT, PROP_FACTOR);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_threshold_get",
- "rna_LayerEngineSettings_Eevee_bloom_threshold_set", NULL);
- RNA_def_property_ui_text(prop, "Threshold", "Filters out pixels under this level of brightness");
- RNA_def_property_range(prop, 0.0f, 100000.0f);
- RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "bloom_color", PROP_FLOAT, PROP_COLOR);
- RNA_def_property_array(prop, 3);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_color_get",
- "rna_LayerEngineSettings_Eevee_bloom_color_set", NULL);
- RNA_def_property_ui_text(prop, "Color", "Color applied to the bloom effect");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "bloom_knee", PROP_FLOAT, PROP_FACTOR);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_knee_get",
- "rna_LayerEngineSettings_Eevee_bloom_knee_set", NULL);
- RNA_def_property_ui_text(prop, "Knee", "Makes transition between under/over-threshold gradual");
- RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "bloom_radius", PROP_FLOAT, PROP_FACTOR);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_radius_get",
- "rna_LayerEngineSettings_Eevee_bloom_radius_set", NULL);
- RNA_def_property_ui_text(prop, "Radius", "Bloom spread distance");
- RNA_def_property_range(prop, 0.0f, 100.0f);
- RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "bloom_clamp", PROP_FLOAT, PROP_FACTOR);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_clamp_get",
- "rna_LayerEngineSettings_Eevee_bloom_clamp_set", NULL);
- RNA_def_property_ui_text(prop, "Clamp", "Maximum intensity a bloom pixel can have");
- RNA_def_property_range(prop, 0.0f, 1000.0f);
- RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "bloom_intensity", PROP_FLOAT, PROP_UNSIGNED);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_intensity_get",
- "rna_LayerEngineSettings_Eevee_bloom_intensity_set", NULL);
- RNA_def_property_ui_text(prop, "Intensity", "Blend factor");
- RNA_def_property_range(prop, 0.0f, 10000.0f);
- RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- /* Motion blur */
- prop = RNA_def_property(srna, "motion_blur_enable", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_motion_blur_enable_get",
- "rna_LayerEngineSettings_Eevee_motion_blur_enable_set");
- RNA_def_property_ui_text(prop, "Motion Blur", "Enable motion blur effect (only in camera view)");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_motion_blur_samples_get",
- "rna_LayerEngineSettings_Eevee_motion_blur_samples_set", NULL);
- RNA_def_property_ui_text(prop, "Samples", "Number of samples to take with motion blur");
- RNA_def_property_range(prop, 1, 64);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_UNSIGNED);
- RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_motion_blur_shutter_get",
- "rna_LayerEngineSettings_Eevee_motion_blur_shutter_set", NULL);
- RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close");
- RNA_def_property_ui_range(prop, 0.01f, 2.0f, 1, 2);
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_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_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "shadow_cube_size", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_Eevee_shadow_cube_size_get", "rna_LayerEngineSettings_Eevee_shadow_cube_size_set", NULL);
- RNA_def_property_enum_items(prop, eevee_shadow_size_items);
- RNA_def_property_ui_text(prop, "Cube Shadows Resolution", "Size of point and area lamps shadow maps");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "shadow_cascade_size", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_Eevee_shadow_cascade_size_get", "rna_LayerEngineSettings_Eevee_shadow_cascade_size_set", NULL);
- RNA_def_property_enum_items(prop, eevee_shadow_size_items);
- RNA_def_property_ui_text(prop, "Directional Shadows Resolution", "Size of sun lamps shadow maps");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- prop = RNA_def_property(srna, "shadow_high_bitdepth", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_shadow_high_bitdepth_get", "rna_LayerEngineSettings_Eevee_shadow_high_bitdepth_set");
- RNA_def_property_ui_text(prop, "High Bitdepth", "Use 32bit shadows");
- RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
-
- RNA_define_verify_sdna(1); /* not in sdna */
-}
-
#ifdef WITH_CLAY_ENGINE
static void rna_def_layer_collection_engine_settings_clay(BlenderRNA *brna)
{
@@ -1614,7 +1073,6 @@ static void rna_def_view_layer_settings(BlenderRNA *brna)
#ifdef WITH_CLAY_ENGINE
rna_def_view_layer_engine_settings_clay(brna);
#endif
- rna_def_view_layer_engine_settings_eevee(brna);
RNA_define_verify_sdna(1);
}
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 4f26e7d43a6..c6738e82e89 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -948,6 +948,11 @@ static void rna_Scene_all_keyingsets_next(CollectionPropertyIterator *iter)
iter->valid = (internal->link != NULL);
}
+static char *rna_SceneEEVEE_path(PointerRNA *UNUSED(ptr))
+{
+ return BLI_strdup("eevee");
+}
+
static int rna_RenderSettings_stereoViews_skip(CollectionPropertyIterator *iter, void *UNUSED(data))
{
ListBaseIterator *internal = &iter->internal.listbase;
@@ -5695,7 +5700,337 @@ static void rna_def_scene_display(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 0.00f, 1.0f, 1, 2);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
+}
+
+static void rna_def_scene_eevee(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static const EnumPropertyItem eevee_shadow_method_items[] = {
+ {SHADOW_ESM, "ESM", 0, "ESM", "Exponential Shadow Mapping"},
+ {SHADOW_VSM, "VSM", 0, "VSM", "Variance Shadow Mapping"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
+ static const 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", ""},
+ {0, NULL, 0, NULL, NULL}
+ };
+
+ static const EnumPropertyItem eevee_gi_visibility_size_items[] = {
+ {8, "8", 0, "8px", ""},
+ {16, "16", 0, "16px", ""},
+ {32, "32", 0, "32px", ""},
+ {64, "64", 0, "64px", ""},
+ {0, NULL, 0, NULL, NULL}
+ };
+
+ static const EnumPropertyItem eevee_volumetric_tile_size_items[] = {
+ {2, "2", 0, "2px", ""},
+ {4, "4", 0, "4px", ""},
+ {8, "8", 0, "8px", ""},
+ {16, "16", 0, "16px", ""},
+ {0, NULL, 0, NULL, NULL}
+ };
+
+ static float default_bloom_color[3] = {1.0f, 1.0f, 1.0f};
+
+ srna = RNA_def_struct(brna, "SceneEEVEE", NULL);
+ RNA_def_struct_path_func(srna, "rna_SceneEEVEE_path");
+ RNA_def_struct_ui_text(srna, "Scene Display", "Scene display settings for 3d viewport");
+
+ /* Indirect Lighting */
+ prop = RNA_def_property(srna, "gi_diffuse_bounces", PROP_INT, PROP_NONE);
+ RNA_def_property_int_default(prop, 3);
+ RNA_def_property_ui_text(prop, "Diffuse Bounces", "Number of time the light is reinjected inside light grids, "
+ "0 disable indirect diffuse light");
+ RNA_def_property_range(prop, 0, INT_MAX);
+
+ prop = RNA_def_property(srna, "gi_cubemap_resolution", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, eevee_shadow_size_items);
+ RNA_def_property_enum_default(prop, 512);
+ RNA_def_property_ui_text(prop, "Cubemap Size", "Size of every cubemaps");
+
+ prop = RNA_def_property(srna, "gi_visibility_resolution", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, eevee_gi_visibility_size_items);
+ RNA_def_property_enum_default(prop, 32);
+ RNA_def_property_ui_text(prop, "Irradiance Visibility Size",
+ "Size of the shadow map applied to each irradiance sample");
+
+ /* Temporal Anti-Aliasing (super sampling) */
+ prop = RNA_def_property(srna, "taa_samples", PROP_INT, PROP_NONE);
+ RNA_def_property_int_default(prop, 16);
+ RNA_def_property_ui_text(prop, "Viewport Samples", "Number of samples, unlimited if 0");
+ RNA_def_property_range(prop, 0, INT_MAX);
+
+ prop = RNA_def_property(srna, "taa_render_samples", PROP_INT, PROP_NONE);
+ RNA_def_property_int_default(prop, 64);
+ RNA_def_property_ui_text(prop, "Render Samples", "Number of samples per pixels for rendering");
+ RNA_def_property_range(prop, 1, INT_MAX);
+
+ prop = RNA_def_property(srna, "taa_reprojection", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_TAA_REPROJECTION);
+ RNA_def_property_boolean_default(prop, 1);
+ RNA_def_property_ui_text(prop, "Viewport Denoising", "Denoise image using temporal reprojection "
+ "(can leave some ghosting)");
+
+ /* Screen Space Subsurface Scattering */
+ prop = RNA_def_property(srna, "sss_enable", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SSS_ENABLED);
+ RNA_def_property_boolean_default(prop, 0);
+ RNA_def_property_ui_text(prop, "Subsurface Scattering", "Enable screen space subsurface scattering");
+
+ prop = RNA_def_property(srna, "sss_samples", PROP_INT, PROP_NONE);
+ RNA_def_property_int_default(prop, 7);
+ RNA_def_property_ui_text(prop, "Samples", "Number of samples to compute the scattering effect");
+ RNA_def_property_range(prop, 1, 32);
+
+ prop = RNA_def_property(srna, "sss_jitter_threshold", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_default(prop, 0.3f);
+ RNA_def_property_ui_text(prop, "Jitter Threshold", "Rotate samples that are below this threshold");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+
+ prop = RNA_def_property(srna, "sss_separate_albedo", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SSS_SEPARATE_ALBEDO);
+ RNA_def_property_boolean_default(prop, 0);
+ RNA_def_property_ui_text(prop, "Separate Albedo", "Avoid albedo being blured by the subsurface scattering "
+ "but uses more video memory");
+
+ /* Screen Space Reflection */
+ prop = RNA_def_property(srna, "ssr_enable", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SSR_ENABLED);
+ RNA_def_property_boolean_default(prop, 0);
+ RNA_def_property_ui_text(prop, "Screen Space Reflections", "Enable screen space reflection");
+
+ prop = RNA_def_property(srna, "ssr_refraction", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SSR_REFRACTION);
+ RNA_def_property_boolean_default(prop, 0);
+ RNA_def_property_ui_text(prop, "Screen Space Refractions", "Enable screen space Refractions");
+
+ prop = RNA_def_property(srna, "ssr_halfres", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SSR_HALF_RESOLUTION);
+ RNA_def_property_boolean_default(prop, 1);
+ RNA_def_property_ui_text(prop, "Half Res Trace", "Raytrace at a lower resolution");
+
+ prop = RNA_def_property(srna, "ssr_quality", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_default(prop, 0.25f);
+ RNA_def_property_ui_text(prop, "Trace Quality", "Quality of the screen space raytracing");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+
+ prop = RNA_def_property(srna, "ssr_max_roughness", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_default(prop, 0.5f);
+ RNA_def_property_ui_text(prop, "Max Roughness", "Do not raytrace reflections for roughness above this value");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+
+ prop = RNA_def_property(srna, "ssr_thickness", PROP_FLOAT, PROP_DISTANCE);
+ RNA_def_property_float_default(prop, 0.2f);
+ RNA_def_property_ui_text(prop, "Thickness", "Pixel thickness used to detect intersection");
+ RNA_def_property_range(prop, 1e-6f, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 5, 3);
+
+ prop = RNA_def_property(srna, "ssr_border_fade", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_default(prop, 0.075f);
+ RNA_def_property_ui_text(prop, "Edge Fading", "Screen percentage used to fade the SSR");
+ RNA_def_property_range(prop, 0.0f, 0.5f);
+
+ prop = RNA_def_property(srna, "ssr_firefly_fac", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_default(prop, 10.0f);
+ RNA_def_property_ui_text(prop, "Clamp", "Clamp pixel intensity to remove noise (0 to disabled)");
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+
+ /* Volumetrics */
+ prop = RNA_def_property(srna, "volumetric_enable", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_VOLUMETRIC_ENABLED);
+ RNA_def_property_boolean_default(prop, 0);
+ RNA_def_property_ui_text(prop, "Volumetrics", "Enable scattering and absorbance of volumetric material");
+
+ prop = RNA_def_property(srna, "volumetric_start", PROP_FLOAT, PROP_DISTANCE);
+ RNA_def_property_float_default(prop, 0.1f);
+ RNA_def_property_ui_text(prop, "Start", "Start distance of the volumetric effect");
+ RNA_def_property_range(prop, 1e-6f, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
+
+ prop = RNA_def_property(srna, "volumetric_end", PROP_FLOAT, PROP_DISTANCE);
+ RNA_def_property_float_default(prop, 100.0f);
+ RNA_def_property_ui_text(prop, "End", "End distance of the volumetric effect");
+ RNA_def_property_range(prop, 1e-6f, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
+
+ prop = RNA_def_property(srna, "volumetric_tile_size", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_default(prop, 8);
+ RNA_def_property_enum_items(prop, eevee_volumetric_tile_size_items);
+ RNA_def_property_ui_text(prop, "Tile Size", "Control the quality of the volumetric effects "
+ "(lower size increase vram usage and quality)");
+
+ prop = RNA_def_property(srna, "volumetric_samples", PROP_INT, PROP_NONE);
+ RNA_def_property_int_default(prop, 64);
+ RNA_def_property_ui_text(prop, "Samples", "Number of samples to compute volumetric effects");
+ RNA_def_property_range(prop, 1, 256);
+
+ prop = RNA_def_property(srna, "volumetric_sample_distribution", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_default(prop, 0.8f);
+ RNA_def_property_ui_text(prop, "Exponential Sampling", "Distribute more samples closer to the camera");
+
+ prop = RNA_def_property(srna, "volumetric_lights", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_VOLUMETRIC_LIGHTS);
+ RNA_def_property_boolean_default(prop, 1);
+ RNA_def_property_ui_text(prop, "Volumetric Lighting", "Enable scene lamps interactions with volumetrics");
+
+ prop = RNA_def_property(srna, "volumetric_light_clamp", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_default(prop, 0.0f);
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_text(prop, "Clamp", "Maximum light contribution, reducing noise");
+
+ prop = RNA_def_property(srna, "volumetric_shadows", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_VOLUMETRIC_SHADOWS);
+ RNA_def_property_boolean_default(prop, 0);
+ RNA_def_property_ui_text(prop, "Volumetric Shadows", "Generate shadows from volumetric material (Very expensive)");
+
+ prop = RNA_def_property(srna, "volumetric_shadow_samples", PROP_INT, PROP_NONE);
+ RNA_def_property_int_default(prop, 16);
+ RNA_def_property_range(prop, 1, 128);
+ RNA_def_property_ui_text(prop, "Volumetric Shadow Samples", "Number of samples to compute volumetric shadowing");
+
+ prop = RNA_def_property(srna, "volumetric_colored_transmittance", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_VOLUMETRIC_COLORED);
+ RNA_def_property_boolean_default(prop, 1);
+ RNA_def_property_ui_text(prop, "Colored Transmittance", "Enable wavelength dependent volumetric transmittance");
+
+ /* Ambient Occlusion */
+ prop = RNA_def_property(srna, "gtao_enable", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_GTAO_ENABLED);
+ RNA_def_property_boolean_default(prop, 0);
+ RNA_def_property_ui_text(prop, "Ambient Occlusion", "Enable ambient occlusion to simulate medium scale indirect shadowing");
+
+ prop = RNA_def_property(srna, "gtao_use_bent_normals", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_GTAO_BENT_NORMALS);
+ RNA_def_property_boolean_default(prop, 1);
+ RNA_def_property_ui_text(prop, "Bent Normals", "Compute main non occluded direction to sample the environment");
+
+ prop = RNA_def_property(srna, "gtao_bounce", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_GTAO_BOUNCE);
+ RNA_def_property_boolean_default(prop, 1);
+ RNA_def_property_ui_text(prop, "Bounces Approximation", "An approximation to simulate light bounces "
+ "giving less occlusion on brighter objects");
+
+ prop = RNA_def_property(srna, "gtao_factor", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_default(prop, 1.0f);
+ RNA_def_property_ui_text(prop, "Factor", "Factor for ambient occlusion blending");
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 2);
+
+ prop = RNA_def_property(srna, "gtao_quality", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_default(prop, 0.25f);
+ RNA_def_property_ui_text(prop, "Trace Quality", "Quality of the horizon search");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+
+ prop = RNA_def_property(srna, "gtao_distance", PROP_FLOAT, PROP_DISTANCE);
+ RNA_def_property_float_default(prop, 0.2f);
+ RNA_def_property_ui_text(prop, "Distance", "Distance of object that contribute to the ambient occlusion effect");
+ RNA_def_property_range(prop, 0.0f, 100000.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
+
+ /* Depth of Field */
+ prop = RNA_def_property(srna, "dof_enable", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_DOF_ENABLED);
+ RNA_def_property_boolean_default(prop, 0);
+ RNA_def_property_ui_text(prop, "Depth of Field", "Enable depth of field using the values from the active camera");
+
+ prop = RNA_def_property(srna, "bokeh_max_size", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_default(prop, 100.0f);
+ RNA_def_property_ui_text(prop, "Max Size", "Max size of the bokeh shape for the depth of field (lower is faster)");
+ RNA_def_property_range(prop, 0.0f, 2000.0f);
+ RNA_def_property_ui_range(prop, 2.0f, 200.0f, 1, 3);
+
+ prop = RNA_def_property(srna, "bokeh_threshold", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_default(prop, 1.0f);
+ RNA_def_property_ui_text(prop, "Sprite Threshold", "Brightness threshold for using sprite base depth of field");
+ RNA_def_property_range(prop, 0.0f, 100000.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
+
+ /* Bloom */
+ prop = RNA_def_property(srna, "bloom_enable", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_BLOOM_ENABLED);
+ RNA_def_property_boolean_default(prop, 0);
+ RNA_def_property_ui_text(prop, "Bloom", "High brighness pixels generate a glowing effect");
+
+ prop = RNA_def_property(srna, "bloom_threshold", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_default(prop, 0.8f);
+ RNA_def_property_ui_text(prop, "Threshold", "Filters out pixels under this level of brightness");
+ RNA_def_property_range(prop, 0.0f, 100000.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
+
+ prop = RNA_def_property(srna, "bloom_color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_array_default(prop, default_bloom_color);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Color", "Color applied to the bloom effect");
+
+ prop = RNA_def_property(srna, "bloom_knee", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_default(prop, 0.5f);
+ RNA_def_property_ui_text(prop, "Knee", "Makes transition between under/over-threshold gradual");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ prop = RNA_def_property(srna, "bloom_radius", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_default(prop, 6.5f);
+ RNA_def_property_ui_text(prop, "Radius", "Bloom spread distance");
+ RNA_def_property_range(prop, 0.0f, 100.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
+
+ prop = RNA_def_property(srna, "bloom_clamp", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_default(prop, 1.0f);
+ RNA_def_property_ui_text(prop, "Clamp", "Maximum intensity a bloom pixel can have");
+ RNA_def_property_range(prop, 0.0f, 1000.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
+
+ prop = RNA_def_property(srna, "bloom_intensity", PROP_FLOAT, PROP_UNSIGNED);
+ RNA_def_property_float_default(prop, 0.8f);
+ RNA_def_property_ui_text(prop, "Intensity", "Blend factor");
+ RNA_def_property_range(prop, 0.0f, 10000.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
+
+ /* Motion blur */
+ prop = RNA_def_property(srna, "motion_blur_enable", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_MOTION_BLUR_ENABLED);
+ RNA_def_property_boolean_default(prop, 0);
+ RNA_def_property_ui_text(prop, "Motion Blur", "Enable motion blur effect (only in camera view)");
+
+ prop = RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_default(prop, 8);
+ RNA_def_property_ui_text(prop, "Samples", "Number of samples to take with motion blur");
+ RNA_def_property_range(prop, 1, 64);
+
+ prop = RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_UNSIGNED);
+ RNA_def_property_float_default(prop, 1.0f);
+ RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close");
+ RNA_def_property_ui_range(prop, 0.01f, 2.0f, 1, 2);
+
+ /* Shadows */
+ prop = RNA_def_property(srna, "shadow_method", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_default(prop, SHADOW_ESM);
+ RNA_def_property_enum_items(prop, eevee_shadow_method_items);
+ RNA_def_property_ui_text(prop, "Method", "Technique use to compute the shadows");
+
+ prop = RNA_def_property(srna, "shadow_cube_size", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_default(prop, 512);
+ RNA_def_property_enum_items(prop, eevee_shadow_size_items);
+ RNA_def_property_ui_text(prop, "Cube Shadows Resolution", "Size of point and area lamps shadow maps");
+
+ prop = RNA_def_property(srna, "shadow_cascade_size", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_default(prop, 1024);
+ RNA_def_property_enum_items(prop, eevee_shadow_size_items);
+ RNA_def_property_ui_text(prop, "Directional Shadows Resolution", "Size of sun lamps shadow maps");
+
+ prop = RNA_def_property(srna, "shadow_high_bitdepth", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SHADOW_HIGH_BITDEPTH);
+ RNA_def_property_boolean_default(prop, 0);
+ RNA_def_property_ui_text(prop, "High Bitdepth", "Use 32bit shadows");
}
void RNA_def_scene(BlenderRNA *brna)
@@ -6153,6 +6488,11 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "SceneDisplay");
RNA_def_property_ui_text(prop, "Scene Display", "Scene display settings for 3d viewport");
+ /* EEVEE */
+ prop = RNA_def_property(srna, "eevee", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "SceneEEVEE");
+ RNA_def_property_ui_text(prop, "EEVEE", "EEVEE settings for the scene");
+
/* Nestled Data */
/* *** Non-Animated *** */
RNA_define_animate_sdna(false);
@@ -6168,6 +6508,7 @@ void RNA_def_scene(BlenderRNA *brna)
rna_def_selected_uv_element(brna);
rna_def_display_safe_areas(brna);
rna_def_scene_display(brna);
+ rna_def_scene_eevee(brna);
RNA_define_animate_sdna(true);
/* *** Animated *** */
rna_def_scene_render_data(brna);