Hello Aashish,<div><br></div><div>I think it would indeed be possible to create a new vtkVolume instead of switching mappers. But right now I don't have the idea that the errors that I am getting are much of a performance hit. So for now (as my project is still in development), I'll leave it as it.</div>
<div><br></div><div>Tijmen<br><br><div class="gmail_quote">On Fri, Oct 7, 2011 at 6:03 PM, Aashish Chaudhary <span dir="ltr"><<a href="mailto:aashish.chaudhary@kitware.com">aashish.chaudhary@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Tijmen,<br>
<br>
Thanks for the update. I looked into the code and found some issues. I<br>
will get back to you on those once I have something concrete.<br>
<br>
On other note, can you create a new vtkVolume when you switch mappers<br>
? You would need to remove the out going vtkVolume from the renderer<br>
though.<br>
<br>
Best,<br>
<div><div></div><div class="h5"><br>
<br>
On Fri, Oct 7, 2011 at 8:41 AM, Tijmen Klein <<a href="mailto:T.R.Klein@student.rug.nl">T.R.Klein@student.rug.nl</a>> wrote:<br>
> A small update. Doing the volume->ReleaseGraphicsResources(renwin) call does<br>
> in fact lead to an error: "PreRender end ERROR (x502) Invalid operation". So<br>
> that's not much of a solution.<br>
> Tijmen<br>
><br>
> On Wed, Oct 5, 2011 at 4:43 PM, Aashish Chaudhary<br>
> <<a href="mailto:aashish.chaudhary@kitware.com">aashish.chaudhary@kitware.com</a>> wrote:<br>
>><br>
>> No problem. Thanks for the information.<br>
>><br>
>> On Wed, Oct 5, 2011 at 10:40 AM, Tijmen Klein <<a href="mailto:T.R.Klein@student.rug.nl">T.R.Klein@student.rug.nl</a>><br>
>> wrote:<br>
>> > Hi Aashish,<br>
>> > Sorry for not mentioning this, but I am indeed using<br>
>> > a vtkGPUVolumeRayCastMapper.<br>
>> > Cheers,<br>
>> > Tijmen<br>
>> ><br>
>> > On Wed, Oct 5, 2011 at 4:38 PM, Aashish Chaudhary<br>
>> > <<a href="mailto:aashish.chaudhary@kitware.com">aashish.chaudhary@kitware.com</a>> wrote:<br>
>> >><br>
>> >> Hi Tijmen,<br>
>> >><br>
>> >> On Wed, Oct 5, 2011 at 7:50 AM, Tijmen Klein <<a href="mailto:T.R.Klein@student.rug.nl">T.R.Klein@student.rug.nl</a>><br>
>> >> wrote:<br>
>> >> > I recently updated VTK from 5.6 to the 5.9 version from Git. Now when<br>
>> >> > I<br>
>> >> > close my application, I get this error repeated quite a few times: "a<br>
>> >> > vtkShader2 object is being deleted before ReleaseGraphicsResources()<br>
>> >> > has<br>
>> >> > been called."<br>
>> >> > After a while I found the origin of the this problem. I have a<br>
>> >> > vtkVolume,<br>
>> >> > and throughout the program the mapper of this vtkVolume is gets<br>
>> >> > changed.<br>
>> >> > So,<br>
>> >> > every now and then I do a call vtkVolume->setMapper(someMapper);<br>
>> >> > This used to work fine, and the (visual) results do still work.<br>
>> >> > However,<br>
>> >> > when I comment out the setMapper() lines, the errors do not occur<br>
>> >> > when<br>
>> >> > exiting. I was able to get rid of the errors by prepending the<br>
>> >> > setMapper()<br>
>> >> > call with a ReleaseGraphicsResources() call. So my code now looks<br>
>> >> > something<br>
>> >> > like this:<br>
>> >> > volume->ReleaseGraphicsResources(renWin);<br>
>> >> > volume->SetMapper(volumeMapper);<br>
>> >> > Is this intended and expected behavior, or is it a bug?<br>
>> >><br>
>> >> This seems like a bug. What particular mapper are you using? Is it<br>
>> >> vtkGPUVolumeRayCastMapper? I will have a look at it sometime today.<br>
>> >><br>
>> >> Thanks,<br>
>> >><br>
>> >><br>
>> >> > Cheers,<br>
>> >> > Tijmen<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<br>
>> >> > <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:<br>
>> >> > <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>
>> >> ><br>
>> >> ><br>
>> >><br>
>> >><br>
>> >><br>
>> >> --<br>
>> >> | Aashish Chaudhary<br>
>> >> | R&D Engineer<br>
>> >> | Kitware Inc.<br>
>> >> | <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>> ><br>
>> ><br>
>><br>
>><br>
>><br>
>> --<br>
>> | Aashish Chaudhary<br>
>> | R&D Engineer<br>
>> | Kitware Inc.<br>
>> | <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
><br>
<br>
<br>
<br>
--<br>
| Aashish Chaudhary<br>
| R&D Engineer<br>
| Kitware Inc.<br>
| <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
</div></div></blockquote></div><br></div>