POV-Ray : Newsgroups : povray.general : Does layout of triangles affect rendering speed in mesh(2) : Re: Does layout of triangles affect rendering speed in mesh(2) Server Time
4 Aug 2024 20:15:07 EDT (-0400)
  Re: Does layout of triangles affect rendering speed in mesh(2)  
From:
Date: 21 Feb 2003 01:21:03
Message: <3e55bde1.895458351@news.povray.org>
On Tue, 18 Feb 2003 05:58:01 EST, "idoit" <ido### [at] tiscalise> wrote:
>Could someone with intimate knowledge of the PovRay mesh data structures
>or other relevant experiences advise me if rendering speed could be
>improved by laying out the vertex vectors by iterating over the Z-axis
>values first and keeping the X-axis constan as far as possible.

It's been some years since I messed with this lets see how much I
remember. POV-Ray allocates storage for each object as it's parsed, in
the order the objects are parsed. Then all objects are traversed to
build the bounding tree. Once rendering the system has to page in as
the objects are referenced, thus locality of reference has a lot to
say in avoiding paging. If the bounding tree doesn't fit in real
storage you're in for a really long trace.

>I.E. in pseudo code change:
>for (z = 0; z < z_max; z++) for (x = 0; x < x_max; x++)  { print (<x,y,z>)}
>to
>for (x = 0; x < x_max; z++) for (z = 0; z < z_max; z++)  { print (<x,y,z>,)}

Should make quite a difference, but reflections and light rays will
cause objects to be referenced 'outside' the area they occupy
on-screen. With 'well-behaved' meshes you can have memory usage up to
4-8 times real memory without much paging, once the bounding tree is
built.

/Erkki


Post a reply to this message

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