<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Jul 9, 2017 at 4:33 PM, Milef, Nicholas Boris <span dir="ltr"><<a href="mailto:milefn@rpi.edu" target="_blank">milefn@rpi.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">Thanks Ken! This is just what I was looking for. A couple of followup questions:
<div><br>
</div>
<div>1. Is it possible to have an actor with different shaders for different passes? </div></div></div></div></blockquote><div><br></div><div>The passes can modify a mapper's shader but a mapper does not store shaders per pass.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt"><div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt"><div>Or would we need to use separate actors/mappers since each mapper only has one shader? Recompiling shaders on the fly isn't an option for us.</div></div></div></div></blockquote><div><br></div><div>VTK caches and shares shaders between mappers so once a given shader program has been used once it will be not recompiled for the duration of the run. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt"><div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">
<div>2. Is it possible to replace the default vtkDefaultPass for the vtkRenderer with a different subclass of vtkDefaultPass or at least disable the default vtkDefaultPass? I couldn't find any API commands that would allow me to do this without subclassing
 the vtkRenderer, but I could've missed something.</div></div></div></div></blockquote><div><br></div><div>When you specify a render pass on the renderer, whatever render pass you specify takes full control of the render process and the default process is skipped. </div><div><br></div><div>Thanks</div><div>Ken</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt"><div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt"><div>
<div>
<div>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<hr>
<div id="m_3760231931056682981m_1593494032320907908divRpF21326" style="direction:ltr"><font face="Tahoma" size="2" color="#000000"><b>From:</b> Ken Martin [<a href="mailto:ken.martin@kitware.com" target="_blank">ken.martin@kitware.com</a>]<br>
<b>Sent:</b> Thursday, July 06, 2017 4:18 PM<br>
<b>To:</b> Milef, Nicholas Boris<br>
<b>Cc:</b> <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br>
<b>Subject:</b> Re: [vtkusers] Separating actors for different render passes<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">With the render passes you can setup as many passes as you want in whatever order you want. This shows an example where the render process is all driven by passes.
<div><br>
</div>
<div><a href="https://gitlab.kitware.com/vtk/vtk/blob/master/Rendering/OpenGL2/Testing/Cxx/TestSobelGradientMagnitudePass.cxx" target="_blank">https://gitlab.kitware.com/vtk<wbr>/vtk/blob/master/Rendering/Ope<wbr>nGL2/Testing/Cxx/TestSobelGrad<wbr>ientMagnitudePass.cxx</a><br>
</div>
<div><br>
</div>
<div>As an example for shadow maps when needed we use nested opaque passes to render the scene from the view of the light sources which we then use in another opaque pass to compute lighting from the view of the camera.</div>
<div><br>
</div>
<div>Render passes also have hooks that mappers call so that passes can modify the mapper shader code etc while executing.<br>
</div>
<div><br>
</div>
<div>Passes can also use information properties on actors to filter them in other passes.  For example an outer render pass can add information on actors that causes some of them to not be rendered (or to be rendered differently) by other passes ala</div>
<div><br>
</div>
<div>
<div>// ------------------------------<wbr>------------------------------<wbr>----------------</div>
<div>// Description:</div>
<div>// Opaque pass with key checking.</div>
<div>// \pre s_exists: s!=0</div>
<div>void vtkDefaultPass::RenderFiltered<wbr>OpaqueGeometry(const vtkRenderState *s)</div>
<div>{</div>
<div>  assert("pre: s_exists" && s!=0);</div>
<div><br>
</div>
<div>  int c=s->GetPropArrayCount();</div>
<div>  int i=0;</div>
<div>  while(i<c)</div>
<div>  {</div>
<div>    vtkProp *p=s->GetPropArray()[i];</div>
<div>    if(p->HasKeys(s->GetRequiredKe<wbr>ys()))</div>
<div>    {</div>
<div>      int rendered=</div>
<div>        p->RenderFilteredOpaqueGeometr<wbr>y(s->GetRenderer(),s->GetRequi<wbr>redKeys());</div>
<div>      this->NumberOfRenderedProps+=r<wbr>endered;</div>
<div>    }</div>
<div>    ++i;</div>
<div>  }</div>
<div>}</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Jul 6, 2017 at 3:30 PM, Milef, Nicholas Boris <span dir="ltr">
<<a href="mailto:milefn@rpi.edu" target="_blank">milefn@rpi.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">Is there currently a way to separate actors into custom render passes? If I'm not mistaken, opaque objects currently get rendered before translucent objects, but is there a way to
 add additional geometry passes (or before opaque geometry, or between translucent and opaque geometry, etc.)?</div>
</div>
<br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">
http://www.kitware.com/opensou<wbr>rce/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" rel="noreferrer" target="_blank">
http://www.vtk.org/Wiki/VTK_FA<wbr>Q</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">
http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/vtkusers</a><br>
<br><span class="m_3760231931056682981HOEnZb"><font color="#888888">
</font></span></blockquote><span class="m_3760231931056682981HOEnZb"><font color="#888888">
</font></span></div><span class="m_3760231931056682981HOEnZb"><font color="#888888">
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="m_3760231931056682981m_1593494032320907908gmail_signature">
<div dir="ltr">
<div>Ken Martin PhD
<div>Distinguished Engineer<br>
<span style="font-size:12.8px">Kitware Inc.</span><br>
</div>
<div>28 Corporate Drive<br>
Clifton Park NY 12065<br>
<div><br>
</div>
<div><span style="font-size:10pt;font-family:Tahoma,sans-serif">This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee.  Access to this email by anyone else
 is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the
 original message.  Thank you.</span></div>
</div>
</div>
</div>
</div>
</font></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_3760231931056682981gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Ken Martin PhD<div>Distinguished Engineer<br><span style="font-size:12.8px">Kitware Inc.</span><br></div><div>28 Corporate Drive<br>Clifton Park NY 12065<br><div><br></div><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">This communication,
including all attachments, contains confidential and legally privileged
information, and it is intended only for the use of the addressee.  Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken in reliance on it is prohibited and may be
unlawful. If you received this communication in error please notify us
immediately and destroy the original message. 
Thank you.</span></div></div></div></div></div>
</div></div>