[vtk-developers] Why is BuildShaders() continuously being called?

Ken Martin ken.martin at kitware.com
Mon Sep 12 09:55:43 EDT 2016


Thanks. I need to make that test more conservative. I'll try making a topic
soon to update it. Probably what it needs is

(actor->GetProperty() && actor->GetProperty()->GetMTime() > ...) ||
(actor->GetTexture() && actor->GetTexture()->GetMTime() > ...) ||

as opposed to the

actor->GetMTime() > ...

line

Thanks
Ken

On Fri, Sep 9, 2016 at 6:20 PM, Milef, Nicholas Boris <milefn at rpi.edu>
wrote:

> Thanks Ken. I was moving a few cone sources around (about 50) with
> SetPosition() and I see that they called Modified() which I'm guessing
> changes MTime? It was mostly for debugging because I can actually get
> around some of this in shaders to avoid going through the rendering
> pipeline. But, there are times when I need to move actors in real time, so
> this can sometimes be a bottleneck for me.
>
> Thanks,
> Nick
> ------------------------------
> *From:* Ken Martin [ken.martin at kitware.com]
> *Sent:* Friday, September 09, 2016 5:58 PM
> *To:* Milef, Nicholas Boris
> *Cc:* vtk-developers at vtk.org
> *Subject:* Re: [vtk-developers] Why is BuildShaders() continuously being
> called?
>
> When  GetNeedToRebuildShaders returns true. Which roughly is
>
>   if (cellBO.Program == 0 ||
>       cellBO.ShaderSourceTime < this->GetMTime() ||
>       cellBO.ShaderSourceTime < actor->GetMTime() ||
>       cellBO.ShaderSourceTime < this->CurrentInput->GetMTime() ||
>       cellBO.ShaderSourceTime < this->SelectionStateChanged ||
>       cellBO.ShaderSourceTime < renderPassMTime ||
>       cellBO.ShaderSourceTime < this->LightComplexityChanged[&cellBO])
>     {
>     return true;
>     }
>
> So if the main points are if you are modifying the actor, mapper, or your
> data. If one of those is being modified every frame then let me know the
> use case and we can see if the current test is being too aggressive etc.
>
> Thanks
> Ken
>
>
>
>
> On Fri, Sep 9, 2016 at 5:47 PM, Milef, Nicholas Boris <milefn at rpi.edu
> <http://redir.aspx?REF=ONPFOfU2bpzpsrcIgt2m7hhEWUJNJohZBPDsZ_BG4gPOQ7kY_tjTCAFtYWlsdG86bWlsZWZuQHJwaS5lZHU.>
> > wrote:
>
>> Under what conditions are shaders actually rebuilt? This seems to be the
>> source of my performance issues and I need to know how to avoid this. The
>> function I'm referring to is in vtkOpenGLPolyDataMapper(). It seems that
>> they get rebuilt when an object gets modified, is this true?
>>
>> Thanks,
>> Nick
>>
>> _______________________________________________
>> Powered by www.kitware.com
>> <http://redir.aspx?REF=z0loocjZVeRvKP64EwrIgSUxd20gmnkUMWd_jmz3X9gvpbsY_tjTCAFodHRwOi8vd3d3LmtpdHdhcmUuY29t>
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> <http://redir.aspx?REF=xjL0ZBleD_hOp6gyTWCXZg3Oa88-8VbNha3cE3QD4LwvpbsY_tjTCAFodHRwOi8vd3d3LmtpdHdhcmUuY29tL29wZW5zb3VyY2Uvb3BlbnNvdXJjZS5odG1s>
>>
>> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>> <http://redir.aspx?REF=F1wcM-MWHo04vjS2vE_PfRsGFLOBuooAfHuTJGGv_fAvpbsY_tjTCAFodHRwOi8vbWFya21haWwub3JnL3NlYXJjaC8_cT12dGstZGV2ZWxvcGVycw..>
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtk-developers
>> <http://redir.aspx?REF=MhWBAevYNiqKNHblyp0YPuAiErwuqE4gdxAjUqqO-0YvpbsY_tjTCAFodHRwOi8vcHVibGljLmtpdHdhcmUuY29tL21haWxtYW4vbGlzdGluZm8vdnRrLWRldmVsb3BlcnM.>
>>
>>
>>
>
>
> --
> Ken Martin PhD
> Chairman & CFO
> Kitware Inc.
> 28 Corporate Drive
> Clifton Park NY 12065
> 518 371 3971
>
> 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.
>



-- 
Ken Martin PhD
Chairman & CFO
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065
518 371 3971

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20160912/ff4ebba3/attachment.html>


More information about the vtk-developers mailing list