[vtkusers] Reusing of vtkOpenGLGPUVolumeRayCastMapper...
agpxnet at yahoo.it
Thu Jun 17 06:09:37 EDT 2010
I mean that (as far as I understand from VTK source code) by design you cannot change the render window of a (at least) volume mapper because once the shader program is loaded and the context is setup by the following code:
the Program->SetContext is never called again because the object Program will be never destroyed (this->Program is always != 0) for the entire life of the mapper. So, I cannot reuse a mapper with (and only with) a new render window. This is a serious problem. There's no way to destroy the shader program inside the mapper?
P.S.: The gradients are computed on-the-fly? That's a really good thing, I haven't noticed this. So probably the slow initialization (few seconds is too much for my purposes) is due to volume upload in video memory card? (512x512x416 16 bit).
Da: Francois Bertel <francois.bertel at kitware.com>
A: vtk vtk <vtkusers at vtk.org>
Inviato: Mer 16 giugno 2010, 16:51:44
Oggetto: Re: [vtkusers] Reusing of vtkOpenGLGPUVolumeRayCastMapper...
A side note: you are talking about a very slow initialization due to
the gradients computation. But there is no gradient precomputation for
the vtkOpenGLGPUVolumeRayCastMapper. It is done on-the-fly during
On Wed, Jun 16, 2010 at 10:48 AM, Francois Bertel
<francois.bertel at kitware.com> wrote:
> Please post a minimal example to reproduce the problem.
> On Wed, Jun 16, 2010 at 6:01 AM, AGPX <agpxnet at yahoo.it> wrote:
>> it not the assert that fails. The variable Context is invalid, it still
>> point to the old destroyed object. This happen because we never change the
>> Context of the class vtkShaderProgram2 to the new render window. That is the
>> void vtkOpenGLGPUVolumeRayCastMapper::BuildProgram(vtkRenderWindow *w,
>> int parallelProjection,
>> int raycastMethod,
>> int shadeMethod,
>> int componentMethod)
>> assert("pre: valid_raycastMethod" &&
>> raycastMethod>= vtkOpenGLGPUVolumeRayCastMapperMethodMIP
>> && raycastMethod<=vtkOpenGLGPUVolumeRayCastMapperMethodAdditive);
>> this->Program->SetContext(static_cast<vtkOpenGLRenderWindow *>(w));
>> The Program variable isn't 0 and so the new context will never be setup. How
>> I can solve this?
>> Da: AGPX <agpxnet at yahoo.it>
>> A: vtk vtk <vtkusers at vtk.org>
>> Inviato: Mer 16 giugno 2010, 10:40:35
>> Oggetto: [vtkusers] Reusing of vtkOpenGLGPUVolumeRayCastMapper...
>> I have a vtkOpenGLGPUVolumeRayCastMapper that I have previously used with
>> another actor, renderer and render window. I wish to reuse it (creating a
>> new actor, renderer and renderwindow), but I obtain an assert error:
>> // Description:
>> // Use the shader program.
>> // It saves the current shader program or fixed-pipeline in use.
>> // It also set the uniform variables.
>> void vtkShaderProgram2::Use()
>> assert("pre: context_is_set" && this->Context!=0);
>> assert("pre: current_context_matches" && this->Context->IsCurrent());
>> <---------------- Fail here!
>> Look like that the context isn't current. There's a way to "reset" the
>> mapper internal state? Note that the volume data input is the same, so I
>> wish to reuse the mapper in order to avoid the very slow initialization
>> (especially the gradients computation). Any hints?
>> Thanks in advance.
>> Powered by www.kitware.com
>> Visit other Kitware open-source projects at
>> Please keep messages on-topic and check the VTK FAQ at:
>> Follow this link to subscribe/unsubscribe:
> François Bertel, PhD | Kitware Inc. Suite 204
> 1 (518) 371 3971 x113 | 28 Corporate Drive
> | Clifton Park NY 12065, USA
François Bertel, PhD | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
| Clifton Park NY 12065, USA
Powered by www.kitware.com
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers