mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix channel packed images display in the Image/Node editor
Channel packed images should not have their RGB affected by alpha. rendering in Cycles and Eevee was fine already, but displaying these was not right in the Image and Node editors. Not 100% sure what to do for the "Color and Alpha" mode, but I guess this should stay like it was before (applying the alpha). "Color", "R", "G", and "B" modes were changed to not have color be affected by alpha though. ref. T89034 Maniphest Tasks: T89034 Differential Revision: https://developer.blender.org/D11871
This commit is contained in:
parent
7b94e7cca4
commit
563fdaaa39
1 changed files with 31 additions and 8 deletions
|
|
@ -31,6 +31,7 @@
|
|||
#include "DNA_camera_types.h"
|
||||
#include "DNA_screen_types.h"
|
||||
|
||||
#include "IMB_imbuf.h"
|
||||
#include "IMB_imbuf_types.h"
|
||||
|
||||
#include "ED_image.h"
|
||||
|
|
@ -222,19 +223,30 @@ static void image_cache_image(IMAGE_Data *vedata, Image *image, ImageUser *iuser
|
|||
copy_v4_fl4(shuffle, 1.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
else if ((sima_flag & SI_SHOW_R) != 0) {
|
||||
draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA | IMAGE_DRAW_FLAG_SHUFFLING;
|
||||
draw_flags |= IMAGE_DRAW_FLAG_SHUFFLING;
|
||||
if (IMB_alpha_affects_rgb(ibuf)) {
|
||||
draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
|
||||
}
|
||||
copy_v4_fl4(shuffle, 1.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
else if ((sima_flag & SI_SHOW_G) != 0) {
|
||||
draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA | IMAGE_DRAW_FLAG_SHUFFLING;
|
||||
draw_flags |= IMAGE_DRAW_FLAG_SHUFFLING;
|
||||
if (IMB_alpha_affects_rgb(ibuf)) {
|
||||
draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
|
||||
}
|
||||
copy_v4_fl4(shuffle, 0.0f, 1.0f, 0.0f, 0.0f);
|
||||
}
|
||||
else if ((sima_flag & SI_SHOW_B) != 0) {
|
||||
draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA | IMAGE_DRAW_FLAG_SHUFFLING;
|
||||
draw_flags |= IMAGE_DRAW_FLAG_SHUFFLING;
|
||||
if (IMB_alpha_affects_rgb(ibuf)) {
|
||||
draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
|
||||
}
|
||||
copy_v4_fl4(shuffle, 0.0f, 0.0f, 1.0f, 0.0f);
|
||||
}
|
||||
else /* RGB */ {
|
||||
draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
|
||||
if (IMB_alpha_affects_rgb(ibuf)) {
|
||||
draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (space_type == SPACE_NODE) {
|
||||
|
|
@ -248,19 +260,30 @@ static void image_cache_image(IMAGE_Data *vedata, Image *image, ImageUser *iuser
|
|||
copy_v4_fl4(shuffle, 0.0f, 0.0f, 0.0f, 1.0f);
|
||||
}
|
||||
else if ((snode->flag & SNODE_SHOW_R) != 0) {
|
||||
draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA | IMAGE_DRAW_FLAG_SHUFFLING;
|
||||
draw_flags |= IMAGE_DRAW_FLAG_SHUFFLING;
|
||||
if (IMB_alpha_affects_rgb(ibuf)) {
|
||||
draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
|
||||
}
|
||||
copy_v4_fl4(shuffle, 1.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
else if ((snode->flag & SNODE_SHOW_G) != 0) {
|
||||
draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA | IMAGE_DRAW_FLAG_SHUFFLING;
|
||||
draw_flags |= IMAGE_DRAW_FLAG_SHUFFLING;
|
||||
if (IMB_alpha_affects_rgb(ibuf)) {
|
||||
draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
|
||||
}
|
||||
copy_v4_fl4(shuffle, 0.0f, 1.0f, 0.0f, 0.0f);
|
||||
}
|
||||
else if ((snode->flag & SNODE_SHOW_B) != 0) {
|
||||
draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA | IMAGE_DRAW_FLAG_SHUFFLING;
|
||||
draw_flags |= IMAGE_DRAW_FLAG_SHUFFLING;
|
||||
if (IMB_alpha_affects_rgb(ibuf)) {
|
||||
draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
|
||||
}
|
||||
copy_v4_fl4(shuffle, 0.0f, 0.0f, 1.0f, 0.0f);
|
||||
}
|
||||
else /* RGB */ {
|
||||
draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
|
||||
if (IMB_alpha_affects_rgb(ibuf)) {
|
||||
draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue