[vtkusers] Question to performance leak in multipass Rendering in VTK
Rocco Gasteiger
post at rocco-gasteiger.de
Wed Dec 9 12:12:54 EST 2009
Dear VTK users,
I derived my own render pass class from vtkRenderPass and want to perform
two render passes in it. My scene consists of two objects A and B. For each
object, I want to store its depth values in a depth texture by using frame
buffer objects (fbo). For accomplishing this task, I call two times
"this->DelegatePass->Render(&myRenderState)" within my derived rendering
class. My delegate rendering pass is a vtkDefaultPass. For rendering A I set
opacity of B to zero and for object B I do it the same for A. Here is a
pseudo code snippet of what I have done.
void vtkMyRenderPass::Render()
{
// Perform some tests
// .
// Create fbo and render state
// Get actor for object B
actorB->SetOpacity(0.0)
// Create first depth texture and assign it to fbo
// Perform first render pass
this->DelegatePass->Render(&newRenderState);
// Reset opacity of actorB
// Get actor for object A
actorA->SetOpacity(0.0)
// Create second depth texture and assign it to fbo
// Perform second render pass
this->DelegatePass->Render(&newRenderState);
// Reset opacity of actorA
}
It works fine so far. But I notice a strong performance leak during
interaction due to the second offscreen rendering. Can anybody give me a
hint what the reason for this is? My render window is 300x300 and I use a
GeForce 9800 GT. Do I have to write a separate render pass class for each
render pass and collect them in a vtkRenderPassCollection (e.g.
vtkMyRenderPassA and vtkMyRenderPassB, for object A and B)?
Many thanks in advance and best regards,
Rocco Gasteiger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091209/f81bd6dd/attachment.htm>
More information about the vtkusers
mailing list