POV-Ray : Newsgroups : povray.general : Strange Attractors, rendering time & memory usage : Re: Strange Attractors, rendering time & memory usage Server Time
2 Nov 2024 11:25:30 EDT (-0400)
  Re: Strange Attractors, rendering time & memory usage  
From: Rune
Date: 14 Mar 2004 18:14:14
Message: <4054e746$1@news.povray.org>
Manuel Kasten wrote:
> Hello,
>
> the following code renders "Strange Attractors", its derived from
> Paul Bourkes scc entry. Has anybody got an idea how to reduce memory
> usage or parsing times on that?

Try to render the following as an animation with between 10 and 99
frames, depending on how much you want to reduce the memory use (more
frames = less memory). The catch is that the render time is longer,
since there are more frames. Parsing time does not increase with the
number of frames though.

//----------------------------------------------------------------------
--
//Quality 0: Preview            ~2.5 min @ Athlon XP 1900+ 512 MB Ram
//+w1024 +h1024 +a0.0 +r5 +fn +kff20      Memory use: ~30MB

//Quality 1: Final              ~15 min @ Athlon XP 1900+ 512 MB Ram
//+w1024 +h1024 +a0.0 +r5 +fn +kff20     Memory use: ~400MB

//Quality 2: Bigfinal           ~35 min @ Athlon XP 1900+ 512 MB Ram
//+w5000 +h5000 +a0.0 +r5 +fn +kff20     Memory use: ~400MB


#declare quality=1;

#declare a=1.5;
#declare b=1.84;
#declare c=-2;
#declare d=-1.8;

camera { right x }

#if(quality=0)
  #declare i=100000/final_frame;   //Preview
#else
  #declare i=2000000/final_frame;  //Final
#end

#if (frame_number=1)
   #declare x1=0;
   #declare y1=0;
   #declare nul=1000;
   #while(nul>0)
      #declare x1=sin(a*y1)-cos(b*x1);
      #declare y1=sin(c*x1)-cos(d*y1);
      #declare nul=nul-1;
   #end
#else
   #include "attractor.data"
   plane {
      -z, -1
      pigment {
         image_map {
            png concat("attractors",str(frame_number-1,-2,0),".png")
         }
         translate -0.5
      }
      finish {ambient 1 diffuse 0}
      scale 10
   }
#end

union {
   #if(quality=0)
      #declare R = 0.002;     //Preview
   #end #if(quality=1)
      #declare R = 0.001;     //Final
   #end #if(quality=2)
      #declare R = 0.0005;    //Bigfinal
   #end
   #while(i>0)
      #declare x2=sin(a*y1)-cos(b*x1);
      #declare y2=sin(c*x1)-cos(d*y1);
      sphere{
         <x2,y2,4.3>, R
         pigment {rgb 1}
         finish {ambient 1}
      }
      #declare x1 = x2 ;
      #declare y1 = y2 ;
      #declare i  = i-1;
   #end
}

#fopen data concat("attractor.data") write
#write (data,"#declare x1 = ",x1,";")
#write (data,"#declare y1 = ",y1,";")
#fclose data


Post a reply to this message

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