diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-01-31 14:57:37 +0300 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-01-31 14:57:37 +0300 |
commit | 7215e5085e803dd50272fad91cd1fe53ad2c905d (patch) | |
tree | 5b68779b535cbe0ccaed2339a10ebac6e281b2ea /source/blender | |
parent | 97002c2d90bb067d9e5b7cd592619bf388950a48 (diff) |
Changed alpha blending mode for image editor and node previews. This was using the sum of the image and alpha-faded background, leading to almost-white transparent areas. New code uses correct GL_SRC_ALPHA for the source image.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_image/image_draw.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_draw.c | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index 5fd86e2ed9a..3932caeeba6 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -390,7 +390,7 @@ static void draw_image_buffer(SpaceImage *sima, ARegion *ar, Scene *scene, Image sima_draw_alpha_backdrop(x, y, ibuf->x, ibuf->y, zoomx, zoomy, col1, col2); glEnable(GL_BLEND); - glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } /* we don't draw floats buffers directly but diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 7de19c6b9e2..de0616f791e 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -616,12 +616,11 @@ static void node_draw_preview(bNodePreview *preview, rctf *prv) glPixelZoom(xscale, yscale); glEnable(GL_BLEND); - glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA ); /* premul graphics */ + glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); /* premul graphics */ glColor4f(1.0, 1.0, 1.0, 1.0); glaDrawPixelsTex(prv->xmin, prv->ymin, preview->xsize, preview->ysize, GL_UNSIGNED_BYTE, preview->rect); - glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); glDisable(GL_BLEND); glPixelZoom(1.0f, 1.0f); |