From 7215e5085e803dd50272fad91cd1fe53ad2c905d Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Mon, 31 Jan 2011 11:57:37 +0000 Subject: 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. --- source/blender/editors/space_image/image_draw.c | 2 +- source/blender/editors/space_node/node_draw.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'source/blender/editors') 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); -- cgit v1.2.3