Physically based defaults for Eevee Bloom and Shutter

Some of Eevee's Bloom defaults are not very good for physically based rendering. This patches addresses this issue.

This picture shows one of the problems with current default. Bloom looks very foggy:
{F6280495}
Even worse, light emitters much dimmer than the Sun can make everything equally hazy if Clamp is set to 1.0 and intensity to 0.8 (current default). Artists often forget to adjust Clamp value and do not know what value to use for realistic intensity. Also, currently both Clamp and Intensity do not have good UI ranges. This is why often Eevee renders end up very hazy and bloom often does not look right.

Bloom effect plays important role to help to distinguish between bright and relatively dim light sources. With current defaults this is broken because Clamp set to 1.0. Also, it cannot be disabled if set to 0 like expected. This patch fixes this and sets it to 0 by default. If users need to clamp, they can do so easily with UI range up to 1000. This range is good enough for most cases and provides enough precision to control lower values, and the highest value helps to limit bloom from the Sun if necessary and will leave untouched most other light emitters. If needed, much higher values for Clamp can be entered manually up to 100000. 10000 is still affects the Sun, but up to 100000 highest limit allows to clamp anything that is much brighter than the Sun if user needs to limit bloom in such cases (for example, bright explosion in the sky or anything else very bright).

I propose new default for bloom Intensity - 0.05 and UI range to suggests realistic values. Bloom Intensity > 0.1 is not realistic for clean lens but the user can enter manually much larger values if needed.

For comparison, here is a my own photo with and without bloom caused by the Sun (on second photo the Sun was occluded with an object).
{F6280500}
{F6280492}
In real life bloom is much more subtle and does not look hazy. If Clamp is disabled, then out of 0.1, 0.05 and 0.025 values I have tried, 0.05 looks most similar to the photo. Here is test render with and without bloom with the Sun in similar position like on the photo:
{F6280496}
{F6280494}
Using color probe 27x27 I compared lightness below the horizon under the Sun. In rendered by Eevee images lightness difference was 17. In case of the photos lightness difference in similar place was 11. I then compared leftmost spot (also below the horizon) and lightness difference was approximately 2 between two photos and 1 between rendered images. In other words, with these settings bloom effect is not too strong and is not too weak. Visually it may seem like decreasing bloom intensity may increase photorealism, but then bloom effect would be too localized even for the Sun.

Besides this single test, I tested in many other scenes as well, with and without the Sun, with different HDRIs, and as far as I can tell 0.05 intensity turned out to be good default - it produces bloom strong enough to be noticeable and not too hazy.

In Cycles shutter default value is 0.50, so for consistency set to 0.5 by default in Eevee too. Besides, 0.5 is typical standard for real cameras, and values higher than 0.5 usually are needed only if very strong motion blur is desired.

Here is summary of all changes:

Bloom Intensity: 0.8 > 0.05
Bloom Intensity UI range: 0-10 > 0-0.1
Bloom Clamp: 1.0 > 0.0 (disabled by default)
Bloom Clamp manual range: 0-1000 > 0-100000
Bloom Clamp UI range: 0-10 > 0-1000
Shutter: 1.0 > 0.5

This patch is related to the discussion in this thread, there are more examples of what bloom will look like with 0.05 intensity by me and others:
https://devtalk.blender.org/t/eevee-needs-to-have-physically-based-defaults/4700

Reviewers: fclem

Reviewed By: fclem

Subscribers: pablovazquez, billreynish, rboxman

Tags: #eevee

Differential Revision: https://developer.blender.org/D4212
This commit is contained in:
Clément Foucault 2019-01-17 19:54:49 +01:00
parent 6dccc7cdab
commit 16fac2149b
6 changed files with 20 additions and 18 deletions

@ -1 +1 @@
Subproject commit 4fd7be071b037562c23cf4711abd54dffb667fdf
Subproject commit 5f7fba0565a7c9ae93eae31a08fc9bbbd16d333a

@ -1 +1 @@
Subproject commit 272b1a4ef07717beb3d0bfcb7380c2164fd008a3
Subproject commit fecc0db5600405a0c14c70120ae279222861ef80

View File

@ -929,12 +929,12 @@ void BKE_scene_init(Scene *sce)
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_intensity = 0.05f;
sce->eevee.bloom_radius = 6.5f;
sce->eevee.bloom_clamp = 1.0f;
sce->eevee.bloom_clamp = 0.0f;
sce->eevee.motion_blur_samples = 8;
sce->eevee.motion_blur_shutter = 1.0f;
sce->eevee.motion_blur_shutter = 0.5f;
sce->eevee.shadow_method = SHADOW_ESM;
sce->eevee.shadow_cube_size = 512;

View File

@ -1420,12 +1420,12 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
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_intensity = 0.05f;
scene->eevee.bloom_radius = 6.5f;
scene->eevee.bloom_clamp = 1.0f;
scene->eevee.bloom_clamp = 0.0f;
scene->eevee.motion_blur_samples = 8;
scene->eevee.motion_blur_shutter = 1.0f;
scene->eevee.motion_blur_shutter = 0.5f;
scene->eevee.shadow_method = SHADOW_ESM;
scene->eevee.shadow_cube_size = 512;

View File

@ -164,9 +164,11 @@ vec4 step_blit(void)
/* Combine and apply the brightness response curve. */
m *= max(rq, br - curveThreshold.w) / max(1e-5, br);
/* Clamp pixel intensity */
br = max(1e-5, brightness(m));
m *= 1.0 - max(0.0, br - clampIntensity) / br;
/* Clamp pixel intensity if clamping enabled */
if (clampIntensity > 0.0) {
br = max(1e-5, brightness(m));
m *= 1.0 - max(0.0, br - clampIntensity) / br;
}
return vec4(m, 1.0);
}

View File

@ -6176,17 +6176,17 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
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);
RNA_def_property_float_default(prop, 0.0f);
RNA_def_property_ui_text(prop, "Clamp", "Maximum intensity a bloom pixel can have (0 to disabled)");
RNA_def_property_range(prop, 0.0f, 100000.0f);
RNA_def_property_ui_range(prop, 0.0f, 1000.0f, 1, 3);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
prop = RNA_def_property(srna, "bloom_intensity", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_default(prop, 0.8f);
prop = RNA_def_property(srna, "bloom_intensity", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_default(prop, 0.05f);
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_ui_range(prop, 0.0f, 0.1f, 1, 3);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
/* Motion blur */