Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2019-03-29 00:38:55 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-03-29 00:38:55 +0300
commit4d71b655ec05d4fcee72d4606e97a3e146804054 (patch)
tree32e2e3d20c499882a559c166d11195e2f9974174 /source/blender/editors
parent42dd888b98b598c240f78302b857fa60add08ca5 (diff)
GPU: Fix color difference when rendering to gpu_py_offscreen
Now we do the color management inside the Draw manager and output CM byte buffer.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/include/ED_view3d.h2
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c11
2 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index 04488aedf49..02ea0027938 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -450,7 +450,7 @@ void ED_view3d_draw_offscreen(
int drawtype,
struct View3D *v3d, struct ARegion *ar, int winx, int winy, float viewmat[4][4],
float winmat[4][4], bool do_sky, bool is_persp, const char *viewname,
- struct GPUFXSettings *fx_settings,
+ struct GPUFXSettings *fx_settings, bool do_color_managment,
struct GPUOffScreen *ofs, struct GPUViewport *viewport);
void ED_view3d_draw_setup_view(
struct wmWindow *win, struct Depsgraph *depsgraph, struct Scene *scene, struct ARegion *ar, struct View3D *v3d,
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 39a77329db5..522d081fdd6 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1455,7 +1455,7 @@ void ED_view3d_draw_offscreen(
View3D *v3d, ARegion *ar, int winx, int winy,
float viewmat[4][4], float winmat[4][4],
bool do_sky, bool UNUSED(is_persp), const char *viewname,
- GPUFXSettings *UNUSED(fx_settings),
+ GPUFXSettings *UNUSED(fx_settings), const bool do_color_management,
GPUOffScreen *ofs, GPUViewport *viewport)
{
RegionView3D *rv3d = ar->regiondata;
@@ -1501,7 +1501,7 @@ void ED_view3d_draw_offscreen(
/* main drawing call */
DRW_draw_render_loop_offscreen(
depsgraph, engine_type, ar, v3d,
- do_sky, ofs, viewport);
+ do_sky, do_color_management, ofs, viewport);
/* restore size */
ar->winx = bwinx;
@@ -1604,12 +1604,13 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(
}
if ((samples && use_full_sample) == 0) {
+ const bool do_color_management = (ibuf->rect_float == NULL);
/* Single-pass render, common case */
ED_view3d_draw_offscreen(
depsgraph, scene, drawtype,
v3d, ar, sizex, sizey, NULL, winmat,
draw_sky, !is_ortho, viewname,
- &fx_settings, ofs, NULL);
+ &fx_settings, do_color_management, ofs, NULL);
if (ibuf->rect_float) {
GPU_offscreen_read_pixels(ofs, GL_FLOAT, ibuf->rect_float);
@@ -1634,7 +1635,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(
depsgraph, scene, drawtype,
v3d, ar, sizex, sizey, NULL, winmat,
draw_sky, !is_ortho, viewname,
- &fx_settings, ofs, viewport);
+ &fx_settings, false, ofs, viewport);
GPU_offscreen_read_pixels(ofs, GL_FLOAT, accum_buffer);
/* skip the first sample */
@@ -1649,7 +1650,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(
depsgraph, scene, drawtype,
v3d, ar, sizex, sizey, NULL, winmat_jitter,
draw_sky, !is_ortho, viewname,
- &fx_settings, ofs, viewport);
+ &fx_settings, false, ofs, viewport);
GPU_offscreen_read_pixels(ofs, GL_FLOAT, rect_temp);
uint i = sizex * sizey * 4;