POV-Ray : Newsgroups : povray.advanced-users : tracing performance for meshes : Re: tracing performance for meshes Server Time
29 Jun 2024 01:51:26 EDT (-0400)
  Re: tracing performance for meshes  
From: Warp
Date: 18 Aug 2010 08:12:24
Message: <4c6bce28@news.povray.org>
ghostch <nomail@nomail> wrote:
> Hello everyone!
> My question regards the rendering speed of smooth triangle meshes. What I have
> tried is to reduce the number of triangles of my meshes using VTK's decimator
> routine: Since the meshes originally come from a marching cubes triangulation,
> they consist of a large number of relatively small triangles - many of them
> coplanar. So the decimator eliminates up to 90% of the triangles without visible
> loss of detail.
> However, for povray it takes double or triple the time to render the reduced
> meshes. Why is that? Could it be that the different sizes of triangles in the
> reduced mesh (the decimator tends to produce very "long" triangles with sharp
> angles sometimes)?

  POV-Ray uses a tree data structure for the triangles in a mesh, which
means that the total amount of triangles in the mesh has no big impact
in rendering speed (increasing the amount of triangles increases ray
intersection tests logarithmically, which is almost negligible). Perhaps
the only thing which might become an issue with larger triangle amounts
is memory usage (in other words, if you run out of free RAM with your
mesh, it's going to render quite slowly, but naturally this is an issue
only in that case).

  From a rendering point of view the shape, size and texturing options of
the mesh will have a much larger effect on rendering speed than the amount
of triangles.

  As for the shape of the triangles themselves, it might actually be a
factor. I don't remember now exactly how triangles are placed in the
tree data structure, but it might well be that very long and thin triangles
may cause efficiency problems in some cases because they cause the need to
traverse more tree nodes than a larger number of small triangles would.
The optimal case for this tree structure is probably if the majority of
triangles are as equilateral as possible.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.