[Bf-blender-cvs] [e954e565e1a] blender-v2.83-release: Fix T79999: Double color management applied during viewport animation render

Jeroen Bakker noreply at git.blender.org
Wed Mar 3 09:35:35 CET 2021


Commit: e954e565e1a83e2018278a4be73f5c7ecd22ec45
Author: Jeroen Bakker
Date:   Tue Feb 9 15:24:29 2021 +0100
Branches: blender-v2.83-release
https://developer.blender.org/rBe954e565e1a83e2018278a4be73f5c7ecd22ec45

Fix T79999: Double color management applied during viewport animation render

In 2.81 there was a change to increase the performance of viewport
animation rendering. This change would perform the color management on the
GPU if the only 8bit was needed. This saved CPU cycles and data
transfer.

The issue is that in the image editor or when saving the image the CM
will be reapplied. Although the speed is desired, exporting the actual
colors has more priority.

In the ticket there is an analysis that shows that shows that this fix
is the correct short term step to take. It would be better that the
render result is aware of the color space of its buffers so the applying
color management could be skipped when saving to disk or drawing in the
image editor.

The issue with this change is the performance penalty it has.

Reviewed By: Brecht van Lommel

Maniphest Tasks: T79999

Differential Revision: https://developer.blender.org/D10371

===================================================================

M	source/blender/editors/render/render_opengl.c

===================================================================

diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index 87ba5ca630f..e4e6c93b6db 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -368,9 +368,6 @@ static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, R
     char err_out[256] = "unknown";
     ImBuf *ibuf_view;
     const int alpha_mode = (draw_sky) ? R_ADDSKY : R_ALPHAPREMUL;
-    eImBufFlags imbuf_flags = oglrender->color_depth <= R_IMF_CHAN_DEPTH_8 ? IB_rect :
-                                                                             IB_rectfloat;
-
     if (view_context) {
       ibuf_view = ED_view3d_draw_offscreen_imbuf(depsgraph,
                                                  scene,
@@ -379,7 +376,7 @@ static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, R
                                                  region,
                                                  sizex,
                                                  sizey,
-                                                 imbuf_flags,
+                                                 IB_rectfloat,
                                                  alpha_mode,
                                                  viewname,
                                                  oglrender->ofs,
@@ -398,7 +395,7 @@ static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, R
                                                         scene->camera,
                                                         oglrender->sizex,
                                                         oglrender->sizey,
-                                                        imbuf_flags,
+                                                        IB_rectfloat,
                                                         V3D_OFSDRAW_SHOW_ANNOTATION,
                                                         alpha_mode,
                                                         viewname,



More information about the Bf-blender-cvs mailing list