diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-12-13 10:36:45 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-12-13 10:36:45 +0400 |
commit | 5a91df32713b7ad9be6befa7124b31890063d91b (patch) | |
tree | 11309c67510bb0ffd29438318896cf86b8024c02 /source/blender/editors | |
parent | 669b5902298f0f80159395d020657d6630a532ac (diff) |
Implement GPU-side dither
Summary:
Uses some magic pseudo-random which is actually a
texture coordinate hashing function.
TODOs:
- Dither noise is the same for all the frames.
- It's different from Floyd's dither we've been
using before.
- Currently CPU and GPU dithering used different
implementation. Ideally we need to use the same
dither in CPU.
Reviewers: brecht
Reviewed By: brecht
Differential Revision: http://developer.blender.org/D58
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/render/render_internal.c | 2 | ||||
-rw-r--r-- | source/blender/editors/screen/glutil.c | 12 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 6 |
3 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index e1a271e996b..1b090cb16ec 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -1150,7 +1150,7 @@ void render_view3d_draw(RenderEngine *engine, const bContext *C) /* Try using GLSL display transform. */ if (force_fallback == false) { - if (IMB_colormanagement_setup_glsl_draw(&scene->view_settings, &scene->display_settings, true)) { + if (IMB_colormanagement_setup_glsl_draw(&scene->view_settings, &scene->display_settings, 0.0f, true)) { glEnable(GL_BLEND); glColor4f(1.0f, 1.0f, 1.0f, 1.0f); glaDrawPixelsTex(rres.xof, rres.yof, rres.rectx, rres.recty, GL_RGBA, GL_FLOAT, diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 57d97178be5..af5f9d3c875 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -1044,9 +1044,6 @@ void glaDrawImBuf_glsl(ImBuf *ibuf, float x, float y, int zoomfilter, if (ibuf->rect == NULL && ibuf->rect_float == NULL) return; - /* Dithering is not supported on GLSL yet */ - force_fallback |= ibuf->dither != 0.0f; - /* Single channel images could not be transformed using GLSL yet */ force_fallback |= ibuf->channels == 1; @@ -1093,15 +1090,18 @@ void glaDrawImBuf_glsl(ImBuf *ibuf, float x, float y, int zoomfilter, if (ibuf->rect_float) { if (ibuf->float_colorspace) { ok = IMB_colormanagement_setup_glsl_draw_from_space(view_settings, display_settings, - ibuf->float_colorspace, true); + ibuf->float_colorspace, + ibuf->dither, true); } else { - ok = IMB_colormanagement_setup_glsl_draw(view_settings, display_settings, true); + ok = IMB_colormanagement_setup_glsl_draw(view_settings, display_settings, + ibuf->dither, true); } } else { ok = IMB_colormanagement_setup_glsl_draw_from_space(view_settings, display_settings, - ibuf->rect_colorspace, false); + ibuf->rect_colorspace, + ibuf->dither, false); } if (ok) { diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index cb69a7fe654..267b070fd42 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1086,10 +1086,10 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq type = GL_FLOAT; if (ibuf->float_colorspace) { - glsl_used = IMB_colormanagement_setup_glsl_draw_from_space_ctx(C, ibuf->float_colorspace, true); + glsl_used = IMB_colormanagement_setup_glsl_draw_from_space_ctx(C, ibuf->float_colorspace, ibuf->dither, true); } else { - glsl_used = IMB_colormanagement_setup_glsl_draw_ctx(C, true); + glsl_used = IMB_colormanagement_setup_glsl_draw_ctx(C, ibuf->dither, true); } } else if (ibuf->rect) { @@ -1097,7 +1097,7 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq format = GL_RGBA; type = GL_UNSIGNED_BYTE; - glsl_used = IMB_colormanagement_setup_glsl_draw_from_space_ctx(C, ibuf->rect_colorspace, false); + glsl_used = IMB_colormanagement_setup_glsl_draw_from_space_ctx(C, ibuf->rect_colorspace, ibuf->dither, false); } else { format = GL_RGBA; |