diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-06-20 16:10:32 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-06-20 16:11:10 +0400 |
commit | 8937feadae08e69e0af27848e4921223ad60dafc (patch) | |
tree | c57d5d1f0cd785026cabc8f95621685cfe915a9d /source/blender/editors/render | |
parent | ca0c0e754931df011ff5421a57e02f8bdfa4559a (diff) |
GLSL tweaks for viewport render draw
- Was missing pixel scale
- Dither is now supported on GPU
Diffstat (limited to 'source/blender/editors/render')
-rw-r--r-- | source/blender/editors/render/render_internal.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 1bf48064fbe..eaaed0fd453 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -1432,19 +1432,18 @@ void render_view3d_draw(RenderEngine *engine, const bContext *C) float scale_x = (float) ar->winx / rres.rectx; float scale_y = (float) ar->winy / rres.recty; - /* Dithering is not supported on GLSL yet */ - force_fallback |= dither != 0.0f; - /* If user decided not to use GLSL, fallback to glaDrawPixelsAuto */ force_fallback |= (U.image_draw_method != IMAGE_DRAW_METHOD_GLSL); /* Try using GLSL display transform. */ if (force_fallback == false) { - if (IMB_colormanagement_setup_glsl_draw(&scene->view_settings, &scene->display_settings, 0.0f, true)) { + if (IMB_colormanagement_setup_glsl_draw(&scene->view_settings, &scene->display_settings, dither, true)) { glEnable(GL_BLEND); glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + glPixelZoom(scale_x, scale_y); glaDrawPixelsTex(rres.xof, rres.yof, rres.rectx, rres.recty, GL_RGBA, GL_FLOAT, GL_NEAREST, rres.rectf); + glPixelZoom(1.0f, 1.0f); glDisable(GL_BLEND); IMB_colormanagement_finish_glsl_draw(); |