Eevee: DoF: Fix most color artifacts in render.

Use full 32bit floats buffers. This increase render time but also color fidelity.
This commit is contained in:
Clément Foucault 2018-01-11 15:14:26 +01:00
parent 494e4c0977
commit 5ef2be5f59
1 changed files with 5 additions and 2 deletions

View File

@ -125,12 +125,15 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *v
&fbl->dof_down_fb, &draw_engine_eevee_type,
buffer_size[0], buffer_size[1], tex_down, 3);
DRWFboTexture tex_scatter_far = {&txl->dof_far_blur, DRW_TEX_RGBA_16, DRW_TEX_FILTER};
/* Go full 32bits for rendering and reduce the color artifacts. */
DRWTextureFormat fb_format = DRW_state_is_image_render() ? DRW_TEX_RGBA_32 : DRW_TEX_RGBA_16;
DRWFboTexture tex_scatter_far = {&txl->dof_far_blur, fb_format, DRW_TEX_FILTER};
DRW_framebuffer_init(
&fbl->dof_scatter_far_fb, &draw_engine_eevee_type,
buffer_size[0], buffer_size[1], &tex_scatter_far, 1);
DRWFboTexture tex_scatter_near = {&txl->dof_near_blur, DRW_TEX_RGBA_16, DRW_TEX_FILTER};
DRWFboTexture tex_scatter_near = {&txl->dof_near_blur, fb_format, DRW_TEX_FILTER};
DRW_framebuffer_init(
&fbl->dof_scatter_near_fb, &draw_engine_eevee_type,
buffer_size[0], buffer_size[1], &tex_scatter_near, 1);