<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">nice animation JB!</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Dec 4, 2013 at 7:38 AM, Biddiscombe, John A. <span dir="ltr">&lt;<a href="mailto:biddisco@cscs.ch" target="_blank">biddisco@cscs.ch</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Just noticed a mistake in my text after clicking send ...<br>
<br>
Erratum : &quot;Decided on Depth Sorting&quot; - instead of depth peeling.<br>
<div class="im HOEnZb"><br>
&gt; -----Original Message-----<br>
&gt; From: Biddiscombe, John A.<br>
&gt; Sent: 04 December 2013 13:35<br>
&gt; To: Biddiscombe, John A.; David E DeMarle; Enya Shen<br>
&gt; Cc: vtkdev; <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
</div><div class="HOEnZb"><div class="h5">&gt; Subject: RE: [vtkusers] [vtk-developers] How to use color mapping for<br>
&gt; vtkPistonMapper?<br>
&gt;<br>
&gt; <a href="https://hpcforge.org/scm/browser.php?group_id=117" target="_blank">https://hpcforge.org/scm/browser.php?group_id=117</a><br>
&gt; is a project called pv-zoltan<br>
&gt;<br>
&gt; I needed to do transparent rendering of neuron circuits which are very large<br>
&gt; and complex, depth peeling is one option, but for some of these circuits I had<br>
&gt; to use a machine with no graphics capabilities, so I wanted a software render<br>
&gt; option and decided on depth peeling. see<br>
&gt; <a href="ftp://ftp.cscs.ch/out/biddisco/bbp/videos/5k-voltage-differentials.avi" target="_blank">ftp://ftp.cscs.ch/out/biddisco/bbp/videos/5k-voltage-differentials.avi</a> skip to<br>
&gt; about 45 seconds in for an example of the data that is interesting - it&#39;s just<br>
&gt; under 1 billion triangles, rendered in parallel. Some of the scenes are very<br>
&gt; complex, so for depth peeling, you really need hundreds of layers to be sure<br>
&gt; it&#39;s perfect (though nobody would be able to tell the difference).<br>
&gt;<br>
&gt; What is pv-zoltan : it&#39;s a set of classes to allow parallel mesh redistribution<br>
&gt; using the zoltan library from trilinos. Once the mesh is partitioned, I then<br>
&gt; depth sort the triangles and render in parallel with sort last compositing.<br>
&gt; 1) There is a custom depth sort class in the code which generates a depth<br>
&gt; sorted ID list and attaches it to the dataset, then a custom<br>
&gt; vtkPolyDataMapper/Painter which renders using the sorted order (this<br>
&gt; differs from the vtkDepthSortPolyData in vtk which actually sorts the<br>
&gt; polygons (and all cell/point arrays)  and effectively doubles the memory use,<br>
&gt; then renders with the normal polydatamapper/painter).  By generating an Id<br>
&gt; ordering and then painting in that order, we only add 1 int per cell.<br>
&gt; 2) mesh partitioning with zoltan - and some enhancements to the rendering<br>
&gt; front end to bypass the default compositing in paraview and use the KdTree<br>
&gt; from zoltan to do the ordered compositing.<br>
&gt; 3) Once that was working, I wanted to try to do the depth sort on the GPU,<br>
&gt; so I looked at piston and found it to be very easy to modify to suit my needs.<br>
&gt; I have changed the vtkDataSetToPiston class and the vtkPistonMapper<br>
&gt; slightly (and the code will only work with triangle based geometry unless you<br>
&gt; uncomment the triangulation routine somewhere). When the PISTON code<br>
&gt; is enabled, the CPU depth sort is disabled (point 1 above) and instead push<br>
&gt; the dataset to GPU, do depth sort on the fly (some thrust code thrown in<br>
&gt; using thrust::sort_by_key&lt;&gt; and a distance functor) and render in one pass<br>
&gt; effectively. (two loops, but only one render pass).<br>
&gt; 4) There is some code in the colorGPU branch which activates the colour<br>
&gt; table lookup and generation on the GPU as well, but I didn&#39;t get time to look<br>
&gt; at it this morning to remind myself of what happens where and when. I seem<br>
&gt; to recall I have a small bug in there which makes the table get regenerated<br>
&gt; more often than it needs to. And possibly more CPU-GPU traffic than strictly<br>
&gt; necessary, but nothing serious.<br>
&gt; 5) Because the transparent rendering uses per vertex opacity - instead of<br>
&gt; using a scalars to colours, we use a new two scalars to colours (originally<br>
&gt; written for the point sprite renderer), this takes one array for scalars and one<br>
&gt; for opacity, so the lookup stuff is a bit more versatile than the standard.<br>
&gt; 6) Everything is handled (rather smoothly I think, even if I do say so myself)<br>
&gt; by the DepthSortRepreseantation which connects everything together. It<br>
&gt; just needs a couple of small fixes for paraview to get working, but most of it<br>
&gt; should compile ok and work - except for the ordered compositing which<br>
&gt; requires some extra info passed via the vtkBoundsExtentTranslator in the<br>
&gt; plugin which holds the region assignments generated by Zoltan and is used to<br>
&gt; send the KdTree to the compositing code in the front end.<br>
&gt;<br>
&gt; .... currently my depth sort branch is out of date/order, so I won&#39;t paste a<br>
&gt; paraview patch. You&#39;d need to just comment out a couple of lines of the<br>
&gt; plugin code. I&#39;d suggest looking  at the piston stuff and having a play with it. I<br>
&gt; can&#39;t remember if I added an option to disable the depth sort and only do the<br>
&gt; render on the GPU, the interesting part is where the cuda array handles are<br>
&gt; passed from the dataset after sorting etc and given to OpenGL for rendering,<br>
&gt; most of the piston code itself is irrelevant and it&#39;s only the push to gpu and<br>
&gt; pass of handles to GL that is interesting. Many thanks to the original Piston<br>
&gt; developers for showing how to do it.<br>
&gt;<br>
&gt; NB. running on a single process ought to work, but there may be a gotcha I&#39;ve<br>
&gt; forgotten about. when I have a few hours spare I&#39;ll apply my patches to my<br>
&gt; current paraview tree and see if everything is still working ok and post an<br>
&gt; update.<br>
&gt;<br>
&gt; JB<br>
&gt;<br>
&gt;<br>
&gt; &gt; -----Original Message-----<br>
&gt; &gt; From: <a href="mailto:vtkusers-bounces@vtk.org">vtkusers-bounces@vtk.org</a> [mailto:<a href="mailto:vtkusers-bounces@vtk.org">vtkusers-bounces@vtk.org</a>] On<br>
&gt; &gt; Behalf Of Biddiscombe, John A.<br>
&gt; &gt; Sent: 03 December 2013 15:44<br>
&gt; &gt; To: David E DeMarle; Enya Shen<br>
&gt; &gt; Cc: vtkdev; <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
&gt; &gt; Subject: Re: [vtkusers] [vtk-developers] How to use color mapping for<br>
&gt; &gt; vtkPistonMapper?<br>
&gt; &gt;<br>
&gt; &gt; Yes. I&#39;ve enhanced the piston mapper and done the lookuptable on the<br>
&gt; GPU.<br>
&gt; &gt; I&#39;m stuck in a terminally dull meeting right now, but once I escape,<br>
&gt; &gt; I&#39;ll brush off the code and post a link.<br>
&gt; &gt;<br>
&gt; &gt; JB<br>
&gt; &gt;<br>
&gt; &gt; From: David DeMarle<br>
&gt; &gt; &lt;<a href="mailto:dave.demarle@kitware.com">dave.demarle@kitware.com</a>&lt;mailto:<a href="mailto:dave.demarle@kitware.com">dave.demarle@kitware.com</a>&gt;&gt;<br>
&gt; &gt; Date: Tuesday 3 December 2013 14:47<br>
&gt; &gt; To: Enya Shen<br>
&gt; &gt; &lt;<a href="mailto:enya.shen2010@gmail.com">enya.shen2010@gmail.com</a>&lt;mailto:<a href="mailto:enya.shen2010@gmail.com">enya.shen2010@gmail.com</a>&gt;&gt;<br>
&gt; &gt; Cc: VTK Developers &lt;<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>&lt;mailto:<a href="mailto:vtk-">vtk-</a><br>
&gt; &gt; <a href="mailto:developers@vtk.org">developers@vtk.org</a>&gt;&gt;, &quot;<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>&lt;mailto:<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>&gt;&quot;<br>
&gt; &gt; &lt;<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>&lt;mailto:<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>&gt;&gt;<br>
&gt; &gt; Subject: Re: [vtk-developers] How to use color mapping for<br>
&gt; &gt; vtkPistonMapper?<br>
&gt; &gt;<br>
&gt; &gt; Unfortunately I ran out of time and didn&#39;t get around to moving VTK&#39;s<br>
&gt; &gt; lookup table over when I originally implemented that class. So, the<br>
&gt; &gt; randow color map you see now is the only option when doing direct GPU<br>
&gt; &gt; to GPU rendering. Unless you hack the class yourself to make the<br>
&gt; &gt; transfer function configurable of course.<br>
&gt; &gt;<br>
&gt; &gt; If anyone out there has an updated implementation (ahem John B.)<br>
&gt; &gt; please direct us to it and we can see about folding your improvements in.<br>
&gt; &gt;<br>
&gt; &gt; thanks<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; David E DeMarle<br>
&gt; &gt; Kitware, Inc.<br>
&gt; &gt; R&amp;D Engineer<br>
&gt; &gt; 21 Corporate Drive<br>
&gt; &gt; Clifton Park, NY 12065-8662<br>
&gt; &gt; Phone: <a href="tel:518-881-4909" value="+15188814909">518-881-4909</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; On Tue, Dec 3, 2013 at 12:24 AM, Enya Shen<br>
&gt; &gt; &lt;<a href="mailto:enya.shen2010@gmail.com">enya.shen2010@gmail.com</a>&lt;mailto:<a href="mailto:enya.shen2010@gmail.com">enya.shen2010@gmail.com</a>&gt;&gt; wrote:<br>
&gt; &gt; Dear all,<br>
&gt; &gt;<br>
&gt; &gt; I try to use vtkPistonMapper, but when I set the color with<br>
&gt; &gt; setColor(double[3]), I got nothing changed.<br>
&gt; &gt;<br>
&gt; &gt; Thanks for any example or advice!<br>
&gt; &gt;<br>
&gt; &gt; Regards,<br>
&gt; &gt; Enya<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a>&lt;<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a>&gt;<br>
&gt; &gt;<br>
&gt; &gt; Visit other Kitware open-source projects at<br>
&gt; &gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt; &gt;<br>
&gt; &gt; Follow this link to subscribe/unsubscribe:<br>
&gt; &gt; <a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt; &gt;<br>
&gt; &gt; Visit other Kitware open-source projects at<br>
&gt; &gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt; &gt;<br>
&gt; &gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; &gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt; &gt;<br>
&gt; &gt; Follow this link to subscribe/unsubscribe:<br>
&gt; &gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div>