POV-Ray : Newsgroups : povray.general : Scene Optimization Server Time
25 Dec 2024 14:30:08 EST (-0500)
  Scene Optimization (Message 1 to 5 of 5)  
From: Sven Littkowski
Subject: Scene Optimization
Date: 11 May 2006 15:21:45
Message: <44638ec9@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

From: Florian Brucker
Subject: Re: Scene Optimization
Date: 11 May 2006 18:00:28
Message: <4463b3fc$1@news.povray.org>
> 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?

See the POV-Ray Speed Guide at the POV-Wiki:

	http://povray.tirnalong.com/ow.asp?SpeedGuide


HTH,
Florian


Post a reply to this message

From: Alain
Subject: Re: Scene Optimization
Date: 11 May 2006 21:57:19
Message: <4463eb7f$1@news.povray.org>
Sven Littkowski nous apporta ses lumieres en ce 11/05/2006 15:21:
> 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
> 
> ------------------------------------------------------------------------------------
>
When most of the elements of an union share the same texture(s), it's better to assign
that texture 
to the union instead of each element. This will save memory and can save some time. In
your case, 
you can assign Blau and InnenAufbaut to the whole thing as it looks like the ones that
are used the 
most. Saving memory can prevent the use of the swap file, thus providing dramatic
speed improvement.

You use loops to create unions of 100's to 1000's objects, spliting those to only
contain objects 
that use a common texture can help. Use several similar loops, one for each texture
familys. Don't 
forget to reinitialize the random streams.

Using layered textures increase rendering time, look if you can create single layer
textures to 
replace the layered ones.

-- 
Alain
-------------------------------------------------
If one synchronized swimmer drowns, do the rest have to drown too?


Post a reply to this message

From: Sven Littkowski
Subject: Re: Scene Optimization
Date: 12 May 2006 10:17:48
Message: <4464990c$1@news.povray.org>
Hi Alain,

thank you very much for your rersponse, and yes, you are right so far, I use 
for each cylinder an own texture. Simply, because I use that map_type which 
twists the texture around the cylinder. I am not sure if that would work if 
I apply it only to the entire union.

Sven


"Alain" <ele### [at] netscapenet> schrieb im Newsbeitrag 
news:4463eb7f$1@news.povray.org...
> Sven Littkowski nous apporta ses lumieres en ce 11/05/2006 15:21:
>> 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
>>
>>
------------------------------------------------------------------------------------
>>
> When most of the elements of an union share the same texture(s), it's 
> better to assign that texture to the union instead of each element. This 
> will save memory and can save some time. In your case, you can assign Blau 
> and InnenAufbaut to the whole thing as it looks like the ones that are 
> used the most. Saving memory can prevent the use of the swap file, thus 
> providing dramatic speed improvement.
>
> You use loops to create unions of 100's to 1000's objects, spliting those 
> to only contain objects that use a common texture can help. Use several 
> similar loops, one for each texture familys. Don't forget to reinitialize 
> the random streams.
>
> Using layered textures increase rendering time, look if you can create 
> single layer textures to replace the layered ones.
>
> -- 
> Alain
> -------------------------------------------------
> If one synchronized swimmer drowns, do the rest have to drown too?


Post a reply to this message

From: Alain
Subject: Re: Scene Optimization
Date: 13 May 2006 14:01:20
Message: <44661ef0$1@news.povray.org>
Sven Littkowski nous apporta ses lumieres en ce 12/05/2006 10:17:
> Hi Alain,
> 
> thank you very much for your rersponse, and yes, you are right so far, I use 
> for each cylinder an own texture. Simply, because I use that map_type which 
> twists the texture around the cylinder. I am not sure if that would work if 
> I apply it only to the entire union.
> 
> Sven
> 
> 
As the sample don't show any maping or warp, I assumed that the textures could apply
to the whole 
set of objects.
Does the spheres use spherical_warp in the textures? If not, you can at least combine
those.
If you start swaping, and you can't reduce the memory use, adding more RAM can bring
HUGE speed 
improvement if it can prevent the swaping. Also, unloading some unused processes will
free up some 
memory. BE CAREFUL whitch one you kill, removing the wrong one may crash the system,
but a reboot 
will cure it without any harm.

-- 
Alain
-------------------------------------------------
AAAAAA: American Association Against Acronym Abuse and Ambiguity.


Post a reply to this message

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