diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-07-22 22:03:06 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-07-22 22:03:06 +0300 |
commit | 7d8b651268df74157f89858eda9ddce9fd452138 (patch) | |
tree | 54321b498337bdd32248aea2f6a708019d6838cd /source/blender/draw/engines/eevee_next/eevee_film.cc | |
parent | 676a2f690c3e3fffe2e515208d4d308e0a96e8e6 (diff) |
EEVEE-Next: Add exposure awareness to denoising
This uses the exposure to get a better approximation of the perceptual
brighness of a sample before accumulating it.
Note that we do not modify exposure of the image. Only the samples weights
are computed differently.
Diffstat (limited to 'source/blender/draw/engines/eevee_next/eevee_film.cc')
-rw-r--r-- | source/blender/draw/engines/eevee_next/eevee_film.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/draw/engines/eevee_next/eevee_film.cc b/source/blender/draw/engines/eevee_next/eevee_film.cc index 486413a0834..42c61ac90a8 100644 --- a/source/blender/draw/engines/eevee_next/eevee_film.cc +++ b/source/blender/draw/engines/eevee_next/eevee_film.cc @@ -164,6 +164,8 @@ inline bool operator!=(const FilmData &a, const FilmData &b) void Film::init(const int2 &extent, const rcti *output_rect) { Sampling &sampling = inst_.sampling; + Scene &scene = *inst_.scene; + SceneEEVEE &scene_eevee = scene.eevee; init_aovs(); @@ -230,9 +232,8 @@ void Film::init(const int2 &extent, const rcti *output_rect) data.offset = int2(output_rect->xmin, output_rect->ymin); data.extent_inv = 1.0f / float2(data.extent); /* Disable filtering if sample count is 1. */ - data.filter_size = (sampling.sample_count() == 1) ? - 0.0f : - clamp_f(inst_.scene->r.gauss, 0.0f, 100.0f); + data.filter_size = (sampling.sample_count() == 1) ? 0.0f : + clamp_f(scene.r.gauss, 0.0f, 100.0f); /* TODO(fclem): parameter hidden in experimental. * We need to figure out LOD bias first in order to preserve texture crispiness. */ data.scaling_factor = 1; @@ -254,7 +255,7 @@ void Film::init(const int2 &extent, const rcti *output_rect) EEVEE_RENDER_PASS_MIST | EEVEE_RENDER_PASS_SHADOW | EEVEE_RENDER_PASS_AO; - data_.exposure = 1.0f /* TODO */; + data_.exposure_scale = pow2f(scene.view_settings.exposure); data_.has_data = (enabled_passes_ & data_passes) != 0; data_.any_render_pass_1 = (enabled_passes_ & color_passes_1) != 0; data_.any_render_pass_2 = (enabled_passes_ & color_passes_2) != 0; @@ -346,7 +347,7 @@ void Film::init(const int2 &extent, const rcti *output_rect) } } - force_disable_reprojection_ = (inst_.scene->eevee.flag & SCE_EEVEE_TAA_REPROJECTION) == 0; + force_disable_reprojection_ = (scene_eevee.flag & SCE_EEVEE_TAA_REPROJECTION) == 0; } void Film::sync() |