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/screen/glutil.c | |
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/screen/glutil.c')
-rw-r--r-- | source/blender/editors/screen/glutil.c | 12 |
1 files changed, 6 insertions, 6 deletions
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) { |