diff --git a/silx/gui/plot3d/scene/primitives.py b/silx/gui/plot3d/scene/primitives.py index 298513d3f2..7f35c3c481 100644 --- a/silx/gui/plot3d/scene/primitives.py +++ b/silx/gui/plot3d/scene/primitives.py @@ -1,7 +1,7 @@ # coding: utf-8 # /*########################################################################## # -# Copyright (c) 2015-2020 European Synchrotron Radiation Facility +# Copyright (c) 2015-2021 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -2041,7 +2041,10 @@ class _Image(Geometry): $scenePreCall(vCameraPosition); vec4 color = imageColor(data, vTexCoords); - color.a = alpha; + color.a *= alpha; + if (color.a == 0.) { /* Discard fully transparent pixels */ + discard; + } vec3 normal = vec3(0.0, 0.0, 1.0); gl_FragColor = $lightingCall(color, vPosition, normal);