[vtkusers] Slow rendering of derived class of vtkImplicitFunction

David.Pont at ForestResearch.co.nz David.Pont at ForestResearch.co.nz
Thu Oct 9 16:42:48 EDT 2003


Salut Christophe,
    You are right, limiting the sample bounds will help with speed.
Why do you need to use vtkCylinder and vtkCone to generate 3D arrows... can
you use vtkCylinderSource and vtkConeSource instead? You can control the
resolution directly and the speed will be blazingly fast compared to
vtkSampleFunction->vtkContourFilter. Maybe I am missing something here...?
  Dave P


|---------+---------------------------->
|         |           Christophe Franco|
|         |           <cfranco at amsatec.|
|         |           fr>              |
|         |           Sent by:         |
|         |           vtkusers-admin at vt|
|         |           k.org            |
|         |                            |
|         |                            |
|         |           09/10/2003 20:17 |
|         |                            |
|---------+---------------------------->
  >--------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                                |
  |       To:       vtkusers at vtk.org                                                                                               |
  |       cc:                                                                                                                      |
  |       Subject:  Re: [vtkusers] Slow rendering of derived class of vtkImplicitFunction                                          |
  >--------------------------------------------------------------------------------------------------------------------------------|




David.Pont at ForestResearch.co.nz wrote:

 > Hi,
 >    My guess is that vtkSampleFunction is the part that takes the most
  time.
 > You use SetSampleDimensions to define the number of samples, for example
 > 50*50*50 = 125,000 samples. Your implicit function EvaluateFunction
will be
 > called for each of these, and I see your EvaluateFunction uses exp and
 > sqrt.
 > This volume is then contoured to produce a surface, the contouring
 > algorithms are relatively efficient, but this might be the next slowest
 > part.
 > If you use smaller SampleDimensions you will note a dramatic
(exponential)
 > increase in speed, but you will also notice a poor representation of the
 > surface. The problem with vtkSampleFunction is that in order to
sample the
 > surface at high resolution you have to sample a lot of dead space
away from
 > the surface.


A way to reduce slightly this slowliness without sacrifying quality of
the representation can be reducing the sampling "box" to the minimum
size. This way, with less samples, you can get the same result.

But I think a major problem with this vtkSampleFunction is that it can
only sample on a 3D rectangular box, with faces aligned onto X, Y and Z
axis. In many cases, it would be much more efficient to use a box more
related to the function sampled, then to apply a rotation. Or is it
already possible and I have missed something ?

Because I have quite the same problem, using vtkCone and vtkCylinder (to
build 3D arrows), and even after calculating the minimum coordinates in
X, Y and Z for a given cone or cylinder (which axis are not always
aligned with X, Y nor Z), it still takes me at lease 10*10*10 samples to
have a decent representation (and more than CPU time, it takes me huge
amounts of memory, for a cone + a cylinder, about 2.5MB of RAM)


_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: <
http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers








More information about the vtkusers mailing list