POV-Ray : Newsgroups : povray.general : Pov VFAQ has moved again! : Re: Pov VFAQ has moved again! Server Time
12 Aug 2024 19:32:46 EDT (-0400)
  Re: Pov VFAQ has moved again!  
From: Spider
Date: 24 Jan 1999 12:17:11
Message: <36AB548E.B72B010B@bahnhof.se>
New idea for the VFAQ...
In the render time area...
When you have many objects with the same texture, union them and apply the texture
only
once. This will decrease parse time and memory use. 

Here is an example I have been working with, it isn't as simple as you want it, but I
think you understand the idea.

//Spider

#version 3.1;
#declare EndY = 2500;
#declare EndX = 2000;
#declare Drops = 1250;

global_settings {
  assumed_gamma 1.0 
  max_trace_level  Drops*2  //Ridiculously high....
}

camera {
  location  <0.0, -700, -4500>
  direction 1*z
  right     4/3*x
  look_at   <0.0, 0.0,  0.0>
}
#declare M_solid = material { texture { pigment { rgb <.8, .3, .8> } } }
#declare drop = sphere { <0,0,0>, 4 }
union {
  #local DropsInv = 1/Drops;
  #local s1 = seed(666);
  #local s2 = seed(777);
  #local Amount = 40;
  #local N = 0;
  #while(N<=1)
    #local TransY = N*EndY; 
    #local LoopX = N*EndX; 
    #while(LoopX>0)
      #local TransX = LoopX;
      object { drop translate <TransX, TransY, 0> 
               rotate <0,rand(s2)*360,0> 
//               material{M_solid} //<--SLOW
      }
      #local LoopX=LoopX-Amount;
    #end
    #declare N=N+DropsInv;
  #end
  material{M_solid} //<--FAST
  translate <0,-.5*EndY,0>
}




Ken wrote:
> 
> The permant address is back up and running and the temporary
> address yeilds a fault. Please update your bookmarks.
> 
> http://www.students.tut.fi/~warp/povVFAQ.html
> 
> --
> Ken Tyler
> 
> tyl### [at] pacbellnet


Post a reply to this message

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