[vtkusers] mutli-pass framework, volume rendering without a vtkcamerapass

Bryn Lloyd lloyd at itis.ethz.ch
Wed Jun 8 17:22:51 EDT 2011


I have setup an example code, which simulates this scenario.

http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/RenderPassExistingContext

The volume rendering does not yet work. My guess is that the camera "cam2, which belongs to vtkRenderer ren2" is not setup correctly/updated.

If anybody could have a look and possibly fix it, I think it would be a nice example for those users who would like to mix VTK rendering with other rendering libraries or direct OpenGL calls. For instance it would be useful to the omagelib / ovtk project:

http://code.google.com/p/omegalib/

/Bryn







On Jun 8, 2011, at 6:22 PM, Bryn Lloyd wrote:

> Hi
>  
> If I want to use the multi-pass framework to do volume rendering in an existing OpenGL context, with an existing camera/lights etc how is the best way to proceed?
>  
> I have created a function called Render(), which basically calls:
> void VtkRender()
> {
> opaquePass->Render(state);
> peelingPass->Render(state);
> volumetricPass->Render(state);
> overlayPass->Render(state);
> }
>  
> I don’t make these passes a delegate sequence of a vtkCameraPass. In addition I don’t perform a light pass using vtkLightsPass. Instead the camera pass and light passes are done before calling VtkRender() using non-VTK code.
> For opaque and translucent props it works quite well.
>  
> However, the volumetric pass does not work yet. I have stepped through the code in Debug mode and checked all calls done during the volume rendering (using a vtkVolumeRayCastMapper).
> It obviously is trying to get certain values (e.g. transformations) from the vtkCamera of the vtkRenderer. This vtkCamera is otherwise not used and not setup or synched with the existing non-VTK camera.
>  
>  
> How can I set up the vtkCamera so that this will work? Could there be another reason why it is not working for volume rendering, but working correctly for opaque/depth peeling render passes?
>  
> If I get this to work I will add a self contained example to the Wiki Examples.
>  
> Thanks for any hints
> Bryn
>  
>  
>  
>  
> _______________________________________________
> 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




More information about the vtkusers mailing list