[vtkusers] Layered Rendering? Example?

Julien Finet julien.finet at kitware.com
Thu Jul 3 16:28:40 EDT 2008


Hi John,

Renderers are rendered by vtkRendererCollection::Renderer(), it says:
...
  // Only have the renderers render from back to front.  This is necessary
  // because transparent renderers clear the z-buffer before each render and
  // then overlay their image.
  for (i = 0; i < numLayers; i++)
    {
    for (this->InitTraversal(rsit); (ren = this->GetNextRenderer(rsit)); )
      {
      if (ren->GetLayer() == i)
        {
        ren->Render();
        }
      }
    }
...

2 things: layers "order" the rendering. and layered renderers are considered
as transparent ( they write on top of the previous renderers). By default, a
renderer has a layer of 0. If you have different layers, make sure you
update the RendererWindow number of layers
(RenderWindow::SetNumberOfLayers(int) )

Hope it helps,
Julien.

On Thu, Jul 3, 2008 at 1:08 AM, John Eke <johne at annidis.com> wrote:

>  Hi,
>
> Could someone please briefly explain the basic concept behind layered
> rendering? whats the relationship between setting layers on renderers(eg
> renderer.SetLayer(0)) and adding multiple renderers to render windows (eg
> renderWindow.AddRenderer(renderer))? I ask because I had assumed adding
> renderers to a render window would automatically set the layers, or that
> somehow when adding renderers to a render window, you can specify the layer
> there (sort of like renderWindow.AddRenderer(renderer, 0)). So I guess I
> just need to be demystified a little bit.
>
> Thanks
>
> John
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080703/00cacf02/attachment.htm>


More information about the vtkusers mailing list