[vtkusers] Is there a way to tell if a video card supports depth peeling?
Doug Hoppes
dhoppes at mbfbioscience.com
Mon Dec 2 08:37:34 EST 2013
Hi all,
I'm still playing with making my transparent objects look good. It was suggested that I look at the depth peeling versus vtkdepthsortpolydata (since the depth sort isn't all that fast). Of course, I read that the depth peeling isn't fast, either.
From the documentation, I have implemented (where the actor is a set ofspheres)
-------
m_pRenderWindow->SetAlphaBitPlanes(1);
m_pRenderWindow->SetMultiSamples(0);
m_pRenderer->GetActorRenderer()->UseDepthPeelingOn();
m_pRenderer->GetActorRenderer()->SetMaximumNumberOfPeels(100);
m_pRenderer->GetActorRenderer()->SetOcclusionRatio(0.1);
vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
mapper->SetInputConnection(appendData->GetOutputPort());
vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
actor->SetMapper(mapper);
actor->GetProperty()->SetOpacity(0.5);
actor->GetProperty()->SetColor(1, 0, 0);
actor->RotateX(-72); //put the object in a position where it is easy
m_pRenderer->AddActor(actor);
int depthPeelingWasUsed = m_pRenderer->GetActorRenderer()->GetLastRenderingUsedDepthPeeling();
-------
The depthPeelingWasUsed always returns false (0). From the documentation, it says that, for depth peeling, you really need OpenGL > 1.3. I'm using the amd radeon 7900.
Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20131202/57df4d50/attachment.htm>
More information about the vtkusers
mailing list