[Bf-blender-cvs] [dedd9ce0aa1] master: Fix T80787: Fix White edges when rendering transparent smoke

Jeroen Bakker noreply at git.blender.org
Tue Sep 15 15:44:25 CEST 2020


Commit: dedd9ce0aa17fb733c8b1c51b072555fcc4f2fd1
Author: Jeroen Bakker
Date:   Tue Sep 15 15:40:04 2020 +0200
Branches: master
https://developer.blender.org/rBdedd9ce0aa17fb733c8b1c51b072555fcc4f2fd1

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.

===================================================================

M	source/blender/draw/engines/image/image_engine.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list