[vtkusers] problem on depth peeling rendering with multiple renderers

Anuwat Dechvijankit anuwat_boy at yahoo.com
Wed Jul 22 06:25:04 EDT 2015


Hi all,

I have a problem with depth peeling rendering using vtk 6.2To generate this problem, i took code based on example of http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/MultipleViewports


When I enabled depth peeling feature,
only lower left corner render could be visible. 
Is it a bug or limitation of depth peeling?
best regards,
Anuwat

---- CODE----#include <vtkSphereSource.h>#include <vtkProperty.h>#include <vtkPolyData.h>#include <vtkSmartPointer.h>#include <vtkPolyDataMapper.h>#include <vtkActor.h>#include <vtkRenderWindow.h>#include <vtkRenderer.h>#include <vtkRenderWindowInteractor.h> #include <vtksys/ios/sstream> int main(int, char *[]){  vtkSmartPointer<vtkRenderWindow> renderWindow =     vtkSmartPointer<vtkRenderWindow>::New();   vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =     vtkSmartPointer<vtkRenderWindowInteractor>::New(); renderWindow->SetAlphaBitPlanes(1); renderWindow->SetMultiSamples(0);  renderWindowInteractor->SetRenderWindow(renderWindow);   // Define viewport ranges  double xmins[4] = {0,.5,0,.5};  double xmaxs[4] = {0.5,1,0.5,1};  double ymins[4] = {0,0,.5,.5};  double ymaxs[4]= {0.5,0.5,1,1};  for(unsigned i = 0; i < 4; i++)    {    vtkSmartPointer<vtkRenderer> renderer =       vtkSmartPointer<vtkRenderer>::New();     renderWindow->AddRenderer(renderer);    renderer->SetViewport(xmins[i],ymins[i],xmaxs[i],ymaxs[i]);     // Create a sphere    vtkSmartPointer<vtkSphereSource> sphereSource =       vtkSmartPointer<vtkSphereSource>::New();    sphereSource->SetCenter(0.0, 0.0, 0.0);    sphereSource->SetRadius(5);    sphereSource->Update();     // Create a mapper and actor    vtkSmartPointer<vtkPolyDataMapper> mapper =       vtkSmartPointer<vtkPolyDataMapper>::New();    mapper->SetInputConnection(sphereSource->GetOutputPort());    vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();    actor->SetMapper(mapper); actor->GetProperty()->SetOpacity(0.5);    renderer->AddActor(actor);    renderer->ResetCamera();  renderer->SetUseDepthPeeling(1); renderer->SetMaximumNumberOfPeels(100); renderer->SetOcclusionRatio(0.0);     renderWindow->Render();     renderWindow->SetWindowName("Multiple ViewPorts");    }   renderWindowInteractor->Start();   return EXIT_SUCCESS;}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150722/4cff9c26/attachment.html>


More information about the vtkusers mailing list