From dedd9ce0aa17fb733c8b1c51b072555fcc4f2fd1 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 15 Sep 2020 15:40:04 +0200 Subject: Fix T80787: Fix White edges when rendering transparent smoke The UV/Image editor was doing interpolation including over the alpha value what makes will render incorrectly when interpolating between pure emissive colors and pre multiplied colors. This change disabled the interpolation. --- source/blender/draw/engines/image/image_engine.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'source/blender/draw') diff --git a/source/blender/draw/engines/image/image_engine.c b/source/blender/draw/engines/image/image_engine.c index 90bfb38dadf..2f380619c2c 100644 --- a/source/blender/draw/engines/image/image_engine.c +++ b/source/blender/draw/engines/image/image_engine.c @@ -141,15 +141,9 @@ static void image_cache_image(IMAGE_Data *vedata, Image *image, ImageUser *iuser const bool use_premul_alpha = image->alpha_mode == IMA_ALPHA_PREMUL; const bool is_tiled_texture = tex_tile_data != NULL; const bool do_repeat = (!is_tiled_texture) && ((sima->flag & SI_DRAW_TILE) != 0); - const bool is_zoom_out = sima->zoom < 1.0f; - - /* use interpolation filtering when zooming out */ - eGPUSamplerState state = 0; - SET_FLAG_FROM_TEST(state, is_zoom_out, GPU_SAMPLER_FILTER); int draw_flags = 0; SET_FLAG_FROM_TEST(draw_flags, do_repeat, SIMA_DRAW_FLAG_DO_REPEAT); - if ((sima->flag & SI_USE_ALPHA) != 0) { /* Show RGBA */ draw_flags |= SIMA_DRAW_FLAG_SHOW_ALPHA | SIMA_DRAW_FLAG_APPLY_ALPHA; @@ -181,11 +175,11 @@ static void image_cache_image(IMAGE_Data *vedata, Image *image, ImageUser *iuser GPUShader *shader = IMAGE_shader_image_get(is_tiled_texture); DRWShadingGroup *shgrp = DRW_shgroup_create(shader, psl->image_pass); if (is_tiled_texture) { - DRW_shgroup_uniform_texture_ex(shgrp, "imageTileArray", pd->texture, state); + DRW_shgroup_uniform_texture_ex(shgrp, "imageTileArray", pd->texture, 0); DRW_shgroup_uniform_texture(shgrp, "imageTileData", tex_tile_data); } else { - DRW_shgroup_uniform_texture_ex(shgrp, "imageTexture", pd->texture, state); + DRW_shgroup_uniform_texture_ex(shgrp, "imageTexture", pd->texture, 0); } DRW_shgroup_uniform_vec2_copy(shgrp, "farNearDistances", far_near); DRW_shgroup_uniform_vec4_copy(shgrp, "color", color); -- cgit v1.2.3