diff options
author | Jeroen Bakker <jeroen@blender.org> | 2022-01-28 13:19:27 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-01-28 13:48:47 +0300 |
commit | dcb7b3f9f78484840edc60bc4cf711823b7eec17 (patch) | |
tree | 70682ed0fa9ea2b44562ecbda0c18858843950ed | |
parent | 379814a1184312aa3714491b92bf5b2ea94cce23 (diff) |
Image Engine: Fix issue show alpha flag not reset.
After showing the alpha in the image editor the setting was not reset
so all images in the editor showed as being transparent.
This commit fixes this by resetting the flag before updating.
4 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/draw/engines/image/image_private.hh b/source/blender/draw/engines/image/image_private.hh index c8968ddf9c6..6d665db4c41 100644 --- a/source/blender/draw/engines/image/image_private.hh +++ b/source/blender/draw/engines/image/image_private.hh @@ -54,7 +54,6 @@ struct IMAGE_Data { #define IMAGE_DRAW_FLAG_APPLY_ALPHA (1 << 1) #define IMAGE_DRAW_FLAG_SHUFFLING (1 << 2) #define IMAGE_DRAW_FLAG_DEPTH (1 << 3) -#define IMAGE_DRAW_FLAG_DO_REPEAT (1 << 4) /** * Abstract class for a drawing mode of the image engine. diff --git a/source/blender/draw/engines/image/image_shader_params.hh b/source/blender/draw/engines/image/image_shader_params.hh index fd16d9cdc4b..3fcea696594 100644 --- a/source/blender/draw/engines/image/image_shader_params.hh +++ b/source/blender/draw/engines/image/image_shader_params.hh @@ -44,6 +44,7 @@ struct ShaderParameters { void update(AbstractSpaceAccessor *space, const Scene *scene, Image *image, ImBuf *image_buffer) { + flags = 0; copy_v4_fl(shuffle, 1.0f); copy_v2_fl2(far_near, 100.0f, 0.0f); diff --git a/source/blender/draw/engines/image/image_space_image.hh b/source/blender/draw/engines/image/image_space_image.hh index 900ac57c652..96abe2e57f4 100644 --- a/source/blender/draw/engines/image/image_space_image.hh +++ b/source/blender/draw/engines/image/image_space_image.hh @@ -56,11 +56,9 @@ class SpaceImageAccessor : public AbstractSpaceAccessor { void get_shader_parameters(ShaderParameters &r_shader_parameters, ImBuf *image_buffer, - bool is_tiled) override + bool UNUSED(is_tiled)) override { const int sima_flag = sima->flag & ED_space_image_get_display_channel_mask(image_buffer); - const bool do_repeat = (!is_tiled) && ((sima->flag & SI_DRAW_TILE) != 0); - SET_FLAG_FROM_TEST(r_shader_parameters.flags, do_repeat, IMAGE_DRAW_FLAG_DO_REPEAT); if ((sima_flag & SI_USE_ALPHA) != 0) { /* Show RGBA */ r_shader_parameters.flags |= IMAGE_DRAW_FLAG_SHOW_ALPHA | IMAGE_DRAW_FLAG_APPLY_ALPHA; diff --git a/source/blender/draw/engines/image/shaders/engine_image_frag.glsl b/source/blender/draw/engines/image/shaders/engine_image_frag.glsl index 604f9b807b3..298487baab2 100644 --- a/source/blender/draw/engines/image/shaders/engine_image_frag.glsl +++ b/source/blender/draw/engines/image/shaders/engine_image_frag.glsl @@ -5,7 +5,6 @@ #define IMAGE_DRAW_FLAG_APPLY_ALPHA (1 << 1) #define IMAGE_DRAW_FLAG_SHUFFLING (1 << 2) #define IMAGE_DRAW_FLAG_DEPTH (1 << 3) -#define IMAGE_DRAW_FLAG_DO_REPEAT (1 << 4) uniform sampler2D imageTexture; |