POV-Ray : Newsgroups : povray.text.scene-files : Scene Optimization Rules for Speed Server Time
22 Dec 2024 03:55:51 EST (-0500)
  Scene Optimization Rules for Speed (Message 1 to 1 of 1)  
From: Sven Littkowski
Subject: Scene Optimization Rules for Speed
Date: 11 May 2006 15:27:48
Message: <44639034@news.povray.org>
Greetings.

What tricks, rules and hints do you know to optimize a complex or any other)
scene in order to prevent unneccessary slowing down of the rendering?

In fact, I have a complex scene in which I have a union (of cylinders and
sphere) being inside a big cylinder (which I made of a difference of a big
with a small cylinder or through an intersection with a big cylinder).
However, that slows down so much.

Let me show you the part of my scene which seems to slows down.

Sven

------------------------------------------------------------------------------------

#declare BayTowers=intersection
{
 union
 {
  cylinder { < 0.0, -330.0, 0.0 > < 0.0, -300.0, 0.0 > 100.0 texture {
Blau } texture {InnenAufbaut } translate < 0.0, 0.0, 450.0 > }
  sphere { < 0.0, 0.0, 0.0 > 100.0 scale < 1.0, 0.3, 1.0 > translate <
0.0, -300.0, 0.0 > texture { Dunkelblau } texture { InnenOben } translate <
0.0, 0.0, 450.0 > }

  cylinder { < 0.0, -330.0, 0.0 > < 0.0, -300.0, 0.0 > 100.0 texture {
Blau } texture {InnenAufbaut } translate < 0.0, 0.0, 450.0 > }
  sphere { < 0.0, 0.0, 0.0 > 100.0 scale < 1.0, 0.3, 1.0 > translate <
0.0, -300.0, 0.0 > texture { Dunkelblau } texture { InnenOben } translate <
0.0, 0.0, 450.0 > scale < 1.0, -1.0, 1.0 > }

  cylinder { < 0.0, -330.0, 0.0 > < 0.0, -300.0, 0.0 > 100.0 texture {
Blau } texture {InnenAufbaut } translate < 0.0, 0.0, 1150.0 > }
  sphere { < 0.0, 0.0, 0.0 > 100.0 scale < 1.0, 0.3, 1.0 > translate <
0.0, -300.0, 0.0 > texture { Dunkelblau } texture { InnenOben } translate <
0.0, 0.0, 1150.0 > }

  cylinder { < 0.0, -330.0, 0.0 > < 0.0, -300.0, 0.0 > 100.0 texture {
Blau } texture {InnenAufbaut } translate < 0.0, 0.0, 1150.0 > }
  sphere { < 0.0, 0.0, 0.0 > 100.0 scale < 1.0, 0.3, 1.0 > translate <
0.0, -300.0, 0.0 > texture { Dunkelblau } texture { InnenOben } translate <
0.0, 0.0, 1150.0 > scale < 1.0, -1.0, 1.0 > }

  cylinder { < 0.0, -330.0, 0.0 > < 0.0, 330.0, 0.0 > 100.0 texture { Blau }
texture {InnenAufbaut } translate < 330.0, 0.0, 100.0 > }
  cylinder { < 0.0, -330.0, 0.0 > < 0.0, 330.0, 0.0 > 100.0 texture { Blau }
texture {InnenAufbaut } translate < 330.0, 0.0, 700.0 > }

  cylinder { < 0.0, -330.0, 0.0 > < 0.0, -150.0, 0.0 > 70.0 texture { Blau }
texture {InnenAufbaut } translate < 270.0, 0.0, 200.0 > }
  cylinder { < 0.0, -330.0, 0.0 > < 0.0, -150.0, 0.0 > 70.0 texture { Blau }
texture {InnenAufbaut } translate < 270.0, 0.0, 600.0 > }
  cylinder { < 0.0, -330.0, 0.0 > < 0.0, -150.0, 0.0 > 70.0 texture { Blau }
texture {InnenAufbaut } translate < 270.0, 0.0, 200.0 > scale < 1.0, -1.0,
1.0 > }
  cylinder { < 0.0, -330.0, 0.0 > < 0.0, -150.0, 0.0 > 70.0 texture { Blau }
texture {InnenAufbaut } translate < 270.0, 0.0, 600.0 > scale < 1.0, -1.0,
1.0 > }

  cylinder { < 0.0, -330.0, 0.0 > < 0.0, -200.0, 0.0 > 50.0 texture { Blau }
texture {InnenAufbaut } translate < 240.0, 0.0, 250.0 > }
  cylinder { < 0.0, -330.0, 0.0 > < 0.0, -200.0, 0.0 > 50.0 texture { Blau }
texture {InnenAufbaut } translate < 240.0, 0.0, 550.0 > }
  cylinder { < 0.0, -330.0, 0.0 > < 0.0, -200.0, 0.0 > 50.0 texture { Blau }
texture {InnenAufbaut } translate < 240.0, 0.0, 250.0 > scale < 1.0, -1.0,
1.0 > }
  cylinder { < 0.0, -330.0, 0.0 > < 0.0, -200.0, 0.0 > 50.0 texture { Blau }
texture {InnenAufbaut } translate < 240.0, 0.0, 550.0 > scale < 1.0, -1.0,
1.0 > }

  cylinder { < 0.0, -330.0, 0.0 > < 0.0, -170.0, 0.0 > 150.0 texture {
Blau } texture {InnenAufbaut } translate < 250.0, 0.0, 400.0 > }
  cylinder { < 0.0, -330.0, 0.0 > < 0.0, -170.0, 0.0 > 150.0 texture {
Blau } texture {InnenAufbaut } translate < 250.0, 0.0, 400.0 > scale <
1.0, -1.0, 1.0 > }

  #declare Turn=0;
  #declare Diameter=seed(1);
  #declare Tall=seed(2);
  #declare Wide=seed(3);
  #declare Deep=seed(4);
  #while(Turn<100)
   #declare MyDiameter=70.0*rand(Diameter);
   #declare MyTall=50.0*rand(Tall);
   #declare MyWide=(-100.0)+(200.0*rand(Wide));
   #declare MyDeep=1600.0*rand(Deep);
   cylinder
   {
    < 0.0, 0.0, 0.0 > < 0.0, MyTall, 0.0 > MyDiameter
    texture { Blau }
    texture { InnenAufbaut }
    translate < MyWide, -330.0, MyDeep >
   }
   sphere
   {
    < 0.0, 0.0, 0.0 > MyDiameter
    scale < 1.0, 0.3, 1.0 >
    texture { Dunkelblau }
    texture { InnenOben }
    translate < MyWide, -330.0+MyTall, MyDeep >
   }
   cylinder
   {
    < 0.0, MyTall+((MyDiameter/10)*3), 0.0 > < 0.0,
MyTall+((MyDiameter/10)*3)+0.1, 0.0 > MyDiameter/3
    texture { Dunkelblau }
    translate < MyWide, -330.0, MyDeep >
   }
   cylinder
   {
    < 0.0, MyTall+((MyDiameter/10)*3), 0.0 > < 0.0,
MyTall+((MyDiameter/10)*3)+0.11, 0.0 > MyDiameter/3.25
    texture { InnenOben }
    translate < MyWide, -330.0, MyDeep >
   }
   cylinder
   {
    < 0.0, 0.0, 0.0 > < 0.0, MyTall, 0.0 > MyDiameter
    texture { Blau }
    texture { InnenAufbaut }
    translate < MyWide, -330.0, MyDeep >
    scale < 1.0, -1.0, 1.0 >
   }
   sphere
   {
    < 0.0, 0.0, 0.0 > MyDiameter
    scale < 1.0, 0.3, 1.0 >
    texture { Dunkelblau }
    texture { InnenOben }
    translate < MyWide, -330.0+MyTall, MyDeep >
    scale < 1.0, -1.0, 1.0 >
   }
   cylinder
   {
    < 0.0, 0.0, 0.0 > < 0.0, MyTall+MyDiameter+0.1, 0.0 > MyDiameter/3
    texture { HellBlau }
    translate < MyWide, -330.0, MyDeep >
    scale < 1.0, -1.0, 1.0 >
   }
   cylinder
   {
    < 0.0, 0.0, 0.0 > < 0.0, MyTall+MyDiameter+0.11, 0.0 > MyDiameter/3.25
    texture { InnenOben }
    translate < MyWide, -330.0, MyDeep >
    scale < 1.0, -1.0, 1.0 >
   }
   #declare Turn=Turn+1;
  #end
  #declare Turn=0;   // Gesamte verbindungslose Seite
  #declare Diameter=seed(5);
  #declare Tall=seed(6);
  #declare Angle=seed(7);
  #declare Deep=seed(8);
  #while(Turn<300)
   #declare MyDiameter=50.0*rand(Diameter);
   #declare MyTall=30.0*rand(Tall);
   #declare MyAngle=180.0*rand(Angle);
   #declare MyDeep=1600.0*rand(Deep);
   union
   {
    sphere
    {
     < 0.0, 0.0, 0.0 > MyDiameter
     scale < 1.0, 0.3, 1.0 >
     texture { Dunkelblau }
     texture { InnenOben }
     translate < 0.0, MyTall/2, 0.0 >
    }
    cylinder
    {
     < 0.0, -(MyTall/2), 0.0 > < 0.0, MyTall/2, 0.0 > MyDiameter
     texture { Blau }
     texture { InnenAufbaut }
    }
    sphere
    {
     < 0.0, 0.0, 0.0 > MyDiameter
     scale < 1.0, 0.3, 1.0 >
     texture { Dunkelblau }
     texture { InnenOben }
     translate < 0.0, -MyTall/2, 0.0 >
    }
    cylinder
    {
     < 0.0, -MyTall-MyDiameter-0.1, 0.0 > < 0.0, MyTall+MyDiameter+0.1, 0.0
 > MyDiameter/3
     texture { HellBlau }
    }
    cylinder
    {
     < 0.0, -MyTall-MyDiameter-0.11, 0.0 > < 0.0, MyTall+MyDiameter+0.11,
0.0 > MyDiameter/3.25
     texture { InnenOben }
    }
    rotate < 0.0, 0.0, MyAngle >
    translate < 0.0, -330.0, MyDeep >
    rotate < 0.0, 0.0, -MyAngle >
   }
   #declare Turn=Turn+1;
  #end

  #declare Turn=0;   // Vordere Verbindungsseite
  #declare Diameter=seed(9);
  #declare Tall=seed(10);
  #declare Angle=seed(11);
  #declare Deep=seed(12);
  #while(Turn<60)
   #declare MyDiameter=50.0*rand(Diameter);
   #declare MyTall=30.0*rand(Tall);
   #declare MyAngle=180.0*rand(Angle);
   #declare MyDeep=200.0*rand(Deep);
   union
   {
    sphere
    {
     < 0.0, 0.0, 0.0 > MyDiameter
     scale < 1.0, 0.3, 1.0 >
     texture { Dunkelblau }
     texture { InnenOben }
     translate < 0.0, MyTall/2, 0.0 >
    }
    cylinder
    {
     < 0.0, -(MyTall/2), 0.0 > < 0.0, MyTall/2, 0.0 > MyDiameter
     texture { Blau }
     texture { InnenAufbaut }
    }
    sphere
    {
     < 0.0, 0.0, 0.0 > MyDiameter
     scale < 1.0, 0.3, 1.0 >
     texture { Dunkelblau }
     texture { InnenOben }
     translate < 0.0, -MyTall/2, 0.0 >
    }
    cylinder
    {
     < 0.0, -MyTall-MyDiameter-0.1, 0.0 > < 0.0, MyTall+MyDiameter+0.1, 0.0
 > MyDiameter/3
     texture { HellBlau }
    }
    cylinder
    {
     < 0.0, -MyTall-MyDiameter-0.11, 0.0 > < 0.0, MyTall+MyDiameter+0.11,
0.0 > MyDiameter/3.25
     texture { InnenOben }
    }
    rotate < 0.0, 0.0, MyAngle >
    translate < 0.0, -330.0, MyDeep >
    rotate < 0.0, 0.0, -MyAngle >
   }
   #declare Turn=Turn+1;
  #end

  #declare Turn=0;  // Hintere Verbindungsseite
  #declare Diameter=seed(13);
  #declare Tall=seed(14);
  #declare Angle=seed(15);
  #declare Deep=seed(16);
  #while(Turn<200)
   #declare MyDiameter=50.0*rand(Diameter);
   #declare MyTall=30.0*rand(Tall);
   #declare MyAngle=180.0*rand(Angle);
   #declare MyDeep=1000.0*rand(Deep);
   union
   {
    sphere
    {
     < 0.0, 0.0, 0.0 > MyDiameter
     scale < 1.0, 0.3, 1.0 >
     texture { Dunkelblau }
     texture { InnenOben }
     translate < 0.0, MyTall/2, 0.0 >
    }
    cylinder
    {
     < 0.0, -(MyTall/2), 0.0 > < 0.0, MyTall/2, 0.0 > MyDiameter
     texture { Blau }
     texture { InnenAufbaut }
    }
    sphere
    {
     < 0.0, 0.0, 0.0 > MyDiameter
     scale < 1.0, 0.3, 1.0 >
     texture { Dunkelblau }
     texture { InnenOben }
     translate < 0.0, -MyTall/2, 0.0 >
    }
    cylinder
    {
     < 0.0, -MyTall-MyDiameter-0.1, 0.0 > < 0.0, MyTall+MyDiameter+0.1, 0.0
 > MyDiameter/3
     texture { HellBlau }
    }
    cylinder
    {
     < 0.0, -MyTall-MyDiameter-0.11, 0.0 > < 0.0, MyTall+MyDiameter+0.11,
0.0 > MyDiameter/3.25
     texture { InnenOben }
    }
    rotate < 0.0, 0.0, MyAngle >
    translate < 0.0, -330.0, MyDeep >
    rotate < 0.0, 0.0, -MyAngle >
   }
   #declare Turn=Turn+1;
  #end
/* */
  #declare Diameter=1;
  #declare Width=85.0;
  #declare Height=260;

  #declare Turn=0;  // Leitlichter
  #while(Turn<=1600)
   #declare Runde=0;
   #while(Runde<360)
    cylinder { < -Width, Height, Turn > < Width, Height, Turn > Diameter
pigment { LightBlue } finish { ambient 1.0 } rotate < 0.0, 0.0, Runde > }
    #declare Runde=Runde+36;
   #end
   #declare Turn=Turn+100;
  #end

  light_source
  {
   < 0.0, 0.0, 800.0 > color White / 2
   fade_distance 1000.0
   fade_power 2
  }
 }
 cylinder { < 0.0, 0.0, -200.01 > < 0.0, 0.0, 1800.01 > 330.0 texture {
Blau } texture { Innen } }
}


Post a reply to this message

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