[vtkusers] Reusing of vtkOpenGLGPUVolumeRayCastMapper...

Francois Bertel francois.bertel at kitware.com
Wed Jun 16 10:51:44 EDT 2010


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
rendering.

On Wed, Jun 16, 2010 at 10:48 AM, Francois Bertel
<francois.bertel at kitware.com> wrote:
> Hello,
>
> Please post a minimal example to reproduce the problem.
>
> Regards.
>
> On Wed, Jun 16, 2010 at 6:01 AM, AGPX <agpxnet at yahoo.it> wrote:
>> Ok,
>>
>> 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
>> code:
>>
>> void vtkOpenGLGPUVolumeRayCastMapper::BuildProgram(vtkRenderWindow *w,
>>                                                    int parallelProjection,
>>                                                    int raycastMethod,
>>                                                    int shadeMethod,
>>                                                    int componentMethod)
>> {
>>
>>   assert("pre: valid_raycastMethod" &&
>>          raycastMethod>= vtkOpenGLGPUVolumeRayCastMapperMethodMIP
>>          && raycastMethod<=vtkOpenGLGPUVolumeRayCastMapperMethodAdditive);
>>
>>   if(this->Program==0)
>>     {
>>     this->Program=vtkShaderProgram2::New();
>>     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...
>>
>> Hello,
>>
>> 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!
>>   this->Build();
>>
>> ....
>>
>> 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
>> 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:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>
>
>
> --
> 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



More information about the vtkusers mailing list