Workbench: Fix non transparent background in viewport render
authorClément Foucault <foucault.clem@gmail.com>
Tue, 6 Nov 2018 23:15:30 +0000 (00:15 +0100)
committerClément Foucault <foucault.clem@gmail.com>
Tue, 6 Nov 2018 23:19:14 +0000 (00:19 +0100)
source/blender/draw/engines/workbench/workbench_data.c

index 94beedc144b2261767043afd0374ca7afb6d4db1..29a3249782d71976797a80a27c49208f336786e9 100644 (file)
@@ -53,7 +53,7 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd)
 
        WORKBENCH_UBO_World *wd = &wpd->world_data;
        wd->matcap_orientation = (wpd->shading.flag & V3D_SHADING_MATCAP_FLIP_X) != 0;
-       wd->background_alpha = (v3d || scene->r.alphamode == R_ADDSKY) ? 1.0f : 0.0f;
+       wd->background_alpha = (DRW_state_is_image_render() && scene->r.alphamode == R_ALPHAPREMUL) ? 0.0f : 1.0f;
 
        if (!v3d || ((v3d->shading.background_type & V3D_SHADING_BACKGROUND_WORLD) &&
            (scene->world != NULL)))