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:
authorJeroen Bakker <jbakker>2019-10-05 18:18:41 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2019-10-05 18:18:53 +0300
commit0bdf4e2f2d1cd9538ac0196db8c302c21d49c860 (patch)
tree85dcecffae9e8c0fa17335dea117f1c2ff0e599b /source/blender/draw/modes/shaders
parent629a1c1639cb82d8cf421f02bd7fd12f5f3415c6 (diff)
Show Background Image Beneath Transparent Objects (Cycles only)
Camera background images were not shown under transparent objects. This patch performs an alpha under for background images for cycles. In order to see the difference the Film transparency needs to be turned on. Note that workbench and EEVEE still needs to be adapted as they don't write store alpha value in the viewport. Side note. This implementation is already an improvement of the current behavior, what users are requesting. (Show background images underneath cycles viewport rendering.) It is clear that this patch still needs to be extended to workbench and eevee. For now that should be marked as a known limitation. Reviewed By: fclem Differential Revision: https://developer.blender.org/D5437
Diffstat (limited to 'source/blender/draw/modes/shaders')
-rw-r--r--source/blender/draw/modes/shaders/object_camera_image_frag.glsl2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/draw/modes/shaders/object_camera_image_frag.glsl b/source/blender/draw/modes/shaders/object_camera_image_frag.glsl
index 5d8ad3c79ea..7804ebdb8c9 100644
--- a/source/blender/draw/modes/shaders/object_camera_image_frag.glsl
+++ b/source/blender/draw/modes/shaders/object_camera_image_frag.glsl
@@ -19,5 +19,7 @@ void main()
#endif
color.a *= alpha;
+ color.rgb *= color.a;
+
fragColor = color;
}