[vtkusers] Question to performance leak in multipass Rendering inVTK
Rocco Gasteiger
post at rocco-gasteiger.de
Thu Dec 10 03:23:47 EST 2009
Hello again,
In my previous post, I forgot to mention that the performance leak occurs
only for objects with high number of triangles (about 70,000 triangles). In
my first pass of my derived rendering pass class, no performance leak is
noticeable. But turn on the second rendering pass within the class the
performance leak occurs. So it seems that in my second rendering pass the
whole geometry is loaded to the GPU again and this for every rendering step.
Is that the reason and how can I resolve this circumstance? I think I miss
some important understanding of the underlying rendering pipeline of the
multipass framework.
Thanks in advance ,
Rocco
From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf
Of Rocco Gasteiger
Sent: Wednesday, December 09, 2009 6:13 PM
To: vtkusers at vtk.org
Subject: [vtkusers] Question to performance leak in multipass Rendering
inVTK
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/20091210/f62de2da/attachment.htm>
More information about the vtkusers
mailing list