From 7aaa7aa9dd79b8c6e37f351fd67a93ba07fbb883 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 18 May 2019 20:52:20 +0200 Subject: Images: change alpha settings to support channel packing This also replaces the Use Alpha setting. We now have these alpha modes: * Straight: store RGB and alpha channels separately with alpha acting as a mask, also known as unassociated alpha. * Premultiplied: transparent RGB pixels are multiplied by the alpha channel. The natural format for renders. * Channel Packed: different images are packed in the RGB and alpha channels, and they should not influence each other. Channel packing is commonly used by game engines to save memory. * None: ignore alpha channel from the file and make image fully opaque. Cycles OSL does not correctly support Channel Packed and None yet, we are missing fine control over the OpenImageIO texture cache to do that. Fixes T53672 --- source/blender/makesdna/DNA_image_types.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h index 3e42aa17492..6141472125f 100644 --- a/source/blender/makesdna/DNA_image_types.h +++ b/source/blender/makesdna/DNA_image_types.h @@ -178,7 +178,7 @@ enum { /** For image user, but these flags are mixed. */ IMA_USER_FRAME_IN_RANGE = (1 << 10), IMA_VIEW_AS_RENDER = (1 << 11), - IMA_IGNORE_ALPHA = (1 << 12), + IMA_FLAG_UNUSED_12 = (1 << 12), /* cleared */ IMA_DEINTERLACE = (1 << 13), IMA_USE_VIEWS = (1 << 14), IMA_FLAG_UNUSED_15 = (1 << 15), /* cleared */ @@ -233,6 +233,8 @@ enum { enum { IMA_ALPHA_STRAIGHT = 0, IMA_ALPHA_PREMUL = 1, + IMA_ALPHA_CHANNEL_PACKED = 2, + IMA_ALPHA_IGNORE = 3, }; #endif -- cgit v1.2.3