<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri",sans-serif;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi Andrea,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Z-sorting of transparent polygons is always a problem. You can cure it by turning on depth peeling, but it comes at a cost (for our models it makes renders take almost twice as long).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New""># create a rendering window and renderer<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">ren = vtk.vtkRenderer()<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-family:"Courier New"">ren.SetUseDepthPeeling(True)<o:p></o:p></span></b></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Eric<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> vtkusers <vtkusers-bounces@public.kitware.com> <b>
On Behalf Of </b>aborsic@ne-scientific.com<br>
<b>Sent:</b> Tuesday, December 4, 2018 11:20 AM<br>
<b>To:</b> vtkusers@public.kitware.com<br>
<b>Subject:</b> [vtkusers] Strange Visualization Results With Transparency on Polydata<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Dear All,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am experiencing some strange visualization results in VTK 8.1.0 on polydata using a LUT with some transparency for some entries and opacity for others.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am attaching a Python example to reproduce the problem. The code creates two polydata spheres which are spatially separated. An array with a uniform values of 1 is associated to cell data for the first sphere, and an array with values
of 2 to the second sphere. The two spheres are appended together for convenience with a polydata append filter.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">A LUT is created with two entries, solid red RGBA = (1,0,0,1) and transparent green RGBA = (0,1,0,0.2), the scalar range is set to (1,2) mapping the cells of the first sphere to the first LUT entry and the cells of the second sphere to
the second LUT entry. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">As shown by the attached rendering the red sphere also appears as semi-transparent, and in a wired way, if rotated some portions of the sphere seem more transparent, and others less. Setting the second LUT entry to solid green RGBA = (0,1,0,1)
makes both spheres opaque – this is expected, but why does modifying the alpha channel of the second LUT entry affects also the appearance of the first sphere?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am experiencing this on two different Windows 10 computers equipped with modern NVIDIA GPUs, and on a 2017 iMac 27 running Mojave, all these computers have VTK 8.1.0.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Any comment / advice is welcome,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks, Best Regards,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Andrea<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>