From f84414d6e14c42bf0f96b128c35d29bc2da59087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Fri, 19 Jun 2020 17:02:55 +0200 Subject: EEEVEE: Object Motion Blur: Initial Implementation This adds object motion blur vectors for EEVEE as well as better noise reduction for it. For TAA reprojection we just compute the motion vector on the fly based on camera motion and depth buffer. This makes possible to store another motion vector only for the blurring which is not useful for TAA history fetching. Motion Data is saved per object & per geometry if using deformation blur. We support deformation motion blur by saving previous VBO and modifying the actual GPUBatch for the geometry to include theses VBOs. We store Previous and Next frame motion in the same motion vector buffer (RG for prev and BA for next). This makes non linear motion blur (like rotating objects) less prone to outward/inward blur. We also improve the motion blur post process to expand outside the objects border. We use a tile base approach and the max size of the blur is set via a new render setting. We use a background reconstruction method that needs another setting (Background Separation). Sampling is done using a fixed 8 dithered samples per direction. The final render samples will clear the noise like other stochastic effects. One caveat is that hair particles are not yet supported. Support will come in another patch. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7297 --- source/blender/makesrna/intern/rna_scene.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'source/blender/makesrna/intern/rna_scene.c') diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index edbf4c90524..ed0e422cc20 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -7150,12 +7150,6 @@ static void rna_def_scene_eevee(BlenderRNA *brna) RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - prop = RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_UNSIGNED); - 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_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); - RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - prop = RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_FACTOR); RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close"); RNA_def_property_range(prop, 0.0f, FLT_MAX); @@ -7163,6 +7157,23 @@ static void rna_def_scene_eevee(BlenderRNA *brna) RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); + prop = RNA_def_property(srna, "motion_blur_depth_scale", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text(prop, + "Background Separation", + "Lower values will reduce background" + " bleeding onto foreground elements"); + RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_ui_range(prop, 0.01f, 1000.0f, 1, 2); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); + RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); + + prop = RNA_def_property(srna, "motion_blur_max", PROP_INT, PROP_PIXEL); + RNA_def_property_ui_text(prop, "Max Blur", "Maximum blur distance a pixel can spread over"); + RNA_def_property_range(prop, 1, 2048); + RNA_def_property_ui_range(prop, 1, 512, 1, -1); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); + RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); + /* Shadows */ prop = RNA_def_property(srna, "shadow_cube_size", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, eevee_shadow_size_items); -- cgit v1.2.3