diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-18 21:52:20 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-19 15:36:42 +0300 |
commit | 7aaa7aa9dd79b8c6e37f351fd67a93ba07fbb883 (patch) | |
tree | 6d64084b9b104ad3d9f2bbff2b3d0404ec356862 /source/blender/blenloader/intern/versioning_280.c | |
parent | 3b23b5c638feae0ad6319440771b83a64a1f9ebe (diff) |
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
Diffstat (limited to 'source/blender/blenloader/intern/versioning_280.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 7ba0eb7b791..13ccc374073 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -3450,6 +3450,17 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } + if (!MAIN_VERSION_ATLEAST(bmain, 280, 70)) { + /* New image alpha modes. */ + LISTBASE_FOREACH (Image *, image, &bmain->images) { + const int IMA_IGNORE_ALPHA = (1 << 12); + if (image->flag & IMA_IGNORE_ALPHA) { + image->alpha_mode = IMA_ALPHA_IGNORE; + image->flag &= ~IMA_IGNORE_ALPHA; + } + } + } + { /* Versioning code until next subversion bump goes here. */ } |