POV-Ray : Newsgroups : povray.newusers : Should Parsing really take that long? How to speed it up? : Re: Should Parsing really take that long? How to speed it up? Server Time
29 Apr 2024 10:16:08 EDT (-0400)
  Re: Should Parsing really take that long? How to speed it up?  
From: clipka
Date: 4 Dec 2015 17:25:32
Message: <566212dc$1@news.povray.org>
Am 04.12.2015 um 21:46 schrieb ILM:

> I went a step further and looked into the file.
> 
> #declare cube=pigment { image_map { png "povincludes/cube.png"} }
> object { M_0
>   matrix <
>   0.7071472,  -5.718298E-05,  -0.7070668,
>   4.944397E-05,  1,  -3.142396E-05,
>   0.7070668,  -1.273882E-05,  0.7071472,
>   94.1652,  8.476583,  -71.2338>
> 
> this Object repeats 30.000 times (!) with different numbers.

Does the "#declare cube=pigment ..." statement repeat as well?
That would be bad, and explain a lot.


> Question 1: How should the file (scene?) look like when it contains a object
> that is repeated 30.000 times at different locations to minimize parsing time.

As for the object itself, that looks about as good as it gets: The
object description actually references a "template" presumably defined
earlier (named M_0 in this case), with the matrix<...> statement
specifying the location and orientation of the respective copy by means
of a coordinate transformation matrix.

The "#declare cube=pigment ..." statement should be present only once
(for each distinct filename, that is); if that is indeed the case, then
there's not much more to optimize there either. If the statement is
repeated all around the place, then it's an indication that the author
of the generating software /tried/ to optimize the generated .pov file
but made some stupid blunder along the way. (As a matter of fact, the
very purpose of the "#declare" statement is to define templates for
various things to be referenced later, in this case some texture
property. You'll also find some "#declare M_0=..." somewhere, hopefully
in just one single place.)


Post a reply to this message

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