Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2015-02-16 16:42:36 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-02-16 16:42:36 +0300
commitbbe1b54818d7bb349ddf63efbcb18347a78cf714 (patch)
treece8402c9af3fa2588c1bb3a7edf16e6d2d2549bb /source/blender/gpu/intern/gpu_compositing.c
parent6e08aa0a9e1cb8f781807274ca4b33212af9c035 (diff)
Fix T43689, viewport compositing does not respect alpha settings for
background. For SSAO supporting this is no problem, for DOF we would ideally do blurred alpha, but alpha channel in blurred buffers is occupied by coc field, so use original color alpha instead. It's not entirely correct but it's better than nothing.
Diffstat (limited to 'source/blender/gpu/intern/gpu_compositing.c')
-rw-r--r--source/blender/gpu/intern/gpu_compositing.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_compositing.c b/source/blender/gpu/intern/gpu_compositing.c
index b423c14bd4b..cf288070126 100644
--- a/source/blender/gpu/intern/gpu_compositing.c
+++ b/source/blender/gpu/intern/gpu_compositing.c
@@ -257,7 +257,7 @@ bool GPU_fx_compositor_initialize_passes(
GPUFX *fx, const rcti *rect, const rcti *scissor_rect,
const GPUFXSettings *fx_settings)
{
- int w = BLI_rcti_size_x(rect) + 1, h = BLI_rcti_size_y(rect) + 1;
+ int w = BLI_rcti_size_x(rect), h = BLI_rcti_size_y(rect);
char err_out[256];
int num_passes = 0;
char fx_flag = fx_settings->fx_flag;
@@ -282,6 +282,12 @@ bool GPU_fx_compositor_initialize_passes(
return false;
}
+ /* scissor is missing when drawing offscreen, in that case, dimensions match exactly. In opposite case
+ * add one to match viewport dimensions */
+ if (!scissor_rect) {
+ w++, h++;
+ }
+
fx->num_passes = 0;
/* dof really needs a ping-pong buffer to work */
if (fx_flag & GPU_FX_FLAG_DOF)