POV-Ray : Newsgroups : povray.animations : System resources depleted in animations : Re: System resources depleted in animations Server Time
5 Jul 2024 13:59:53 EDT (-0400)
  Re: System resources depleted in animations  
From: Bosley
Date: 27 Mar 2003 16:25:07
Message: <web.3e836b4b42ea70b950c09400@news.povray.org>
I was able to isolate the worst of the problem.  Below is a .POV file that
demonstrates it.  I was originally hoping to send the files as attachments,
but due to my situation, I must use the webview of the newsgroups where
that is prohibited.  There is one problem with sending the code this way.
You need a gif named Book1.gif.  I can provide mine on request with an
email, but I do not believe it is specific to that gif.

Two files are included below.  The first is the .ini file I used to create
the animation loop.  The second is the .POV.

####POV Specials.ini####
[Allview Generator]
;; Set frame output options
Width=320
Height=240
Antialias=Off

;; Set file output options
Output_to_File=on
Output_File_Type=S ;;BMP output
;;Output_File_Type=N ;;PNG output
Output_File_Name=f:\povart working images\Povhouse#3 Allviews\

;; Set animation options
Initial_Clock=1.0
Final_Clock=43.0
Final_Frame=43

;; Frame Selection
Subset_Start_Frame=1.0
Subset_End_Frame=20.0

[Experimental 360]
width=800
height=240
antialias=off

#####END of POV Specials.ini#####

####Scratch.POV######
/*Demonstration of problem:

        Here is a scene sample that demonstrates my problem.  It is a
bookcase whose book's spines reference GIFs for their texture.
        When I render this scene, system memory is gobbled up at an alarming
rate.  While I am not expert enough to absolutely absolve myself of fault,
I am confident this is a
        legitimate bug since POV does not Red Flag any errors while parsing.

        I believe the error to reside in this line:
                texture{pigment{image_pattern{gif "Book1.gif"}

        In my coding, I have the random number generator pick a random book
spine image, using a #switch structure.  Below, I have highlit
        the place where this switch can be determined. When the Book_Pattern
varible is set to a legal value or allowed to reference the
        random number generator, the bug is invoked.  However, when it is
set to 0 (or any other unspecified value), causing the above line
        not to be parsed, the undesired behavior does not occour.

*/
#include "colors.inc"
#include"skies.inc"
camera{
                        location<10,10,-10>
                 look_at<0,3,0>
                 }

// Exterior Lights
//light_source{<-30,38,25> color White }//shadowless}
light_source{<90,27,-90> color White shadowless}
//light_source{<-30,48,-25> color White }//shadowless}
light_source{<-50,58,27.25> color White shadowless}

// interior lights
light_source{<2,1.7,4+.01> color Gray85}
light_source{<-6,15,14> color Gray90}

// Environment
sky_sphere{S_Cloud3}
plane{ y,-.5
 texture{pigment{DarkGreen}}}

// Structure
#local Bookcase_Height=7;
#local Upvec=y;
#local Bookcase_Width=9;
#local Width_Vec=-z;
#local Bookcase_Depth=1;
#local Depth_Vec=-x;
#local Horz_Partions=6;
#local Vert_Partions=4;
#local Divider_Width=.75/12;
#local Base_Height=3/12;

#local Seed=seed(61274);//seed(42795);
#local Max_Book_Depth=10/12;
#local Min_Book_Depth=4/12;
#local Max_Book_Height=1;
#local Min_Book_Height=7/12;
#local Max_Book_Width=4/12;
#local Min_Book_Width=.5/12;
#local Percent_Full=.945;

#local Partion_Height=(Bookcase_Height-Base_Height)/Horz_Partions;
#local Partion_Width=Bookcase_Width/Vert_Partions;
#if (Max_Book_Height>Partion_Height)
        #local Max_Book_Height=Partition_Height;
        #end
#if (Max_Book_Depth>Bookcase_Depth)
        #local Max_Book_Depth=Bookcase_Depth;
        #end

union{  union{
polygon{5,<0,0,0>,Bookcase_Height*Upvec,Bookcase_Height*Upvec+Bookcase_Width*Width_Vec,Bookcase_Width*Width_Vec,<0,0,0>
                        translate 1/24*Depth_Vec
                        }

box{<0,0,0>,Base_Height*Upvec+Bookcase_Width*Width_Vec+Bookcase_Depth*Depth_Vec}

box{<0,0,0>,Bookcase_Height*Upvec+Divider_Width*Width_Vec+Bookcase_Depth*Depth_Vec}

box{Bookcase_Width*Width_Vec,Bookcase_Height*Upvec+(Bookcase_Width-Divider_Width)*Width_Vec+Bookcase_Depth*Depth_Vec}

box{Bookcase_Height*Upvec,(Bookcase_Height-Divider_Width)*Upvec+Bookcase_Width*Width_Vec+Bookcase_Depth*Depth_Vec}
        //Verical Dividers
                #local c=Vert_Partions-1;
                #while(c>=1)

box{<0,0,0>,Bookcase_Height*Upvec+Divider_Width*Width_Vec+Bookcase_Depth*Depth_Vec
                                translate Partion_Width*Width_Vec*c
                                }
                        #local c=c-1;
                        #end
        //shelves
                #local c=Horz_Partions-1;
                #while(c>=1)

box{Bookcase_Height*Upvec,(Bookcase_Height-Divider_Width)*Upvec+Bookcase_Width*Width_Vec+Bookcase_Depth*Depth_Vec
                                translate -Partion_Height*Upvec*c
                                }
                        #local c=c-1;
                        #end
                texture{pigment{White}//T_Wood14
                        scale .5
                        }
                }
//Books
        #local c2=0;
        #while (c2<Vert_Partions)
                #local c1=0;
                #while (c1<Horz_Partions)
                        #local c=Divider_Width;
                        #while(c<Partion_Width-Divider_Width)
                                #local
Book_Depth=(Max_Book_Depth-Min_Book_Depth)*rand(Seed)+Min_Book_Depth;
                                #local
Book_Height=(Max_Book_Height-Min_Book_Height)*rand(Seed)+Min_Book_Height;
                                #local
Book_Width=(Max_Book_Width-Min_Book_Width)*rand(Seed)+Min_Book_Width;
                                #local
Book_Color=<rand(Seed),rand(Seed),rand(Seed)>;

//***** Critical varible for forking:
//      set Book_Pattern to 0 to bypass bug, 1-9 for forcing the selction to
all books,and edit line for my ramdom selector

                                #local Book_Pattern=1;//ceil(rand(Seed)*9);
//*****

                                #if (c+Book_Width<Partion_Width)

box{<0,0,0>,Book_Depth*Depth_Vec+Book_Height*Upvec+Book_Width*Width_Vec
                                                #switch(Book_Pattern)
                                                        #case(1)

texture{pigment{image_pattern{gif "Book1.gif"}

   rotate -90*y

   scale Book_Depth*Depth_Vec+Book_Height*Upvec+Book_Width*Width_Vec

   }
                                                                        }
                                                                #break
                                                        #case(2)

texture{pigment{image_pattern{gif "Book2.gif"}

   rotate -90*y

   scale Book_Depth*Depth_Vec+Book_Height*Upvec+Book_Width*Width_Vec

   }
                                                                        }
                                                                #break
                                                        #case(3)

texture{pigment{image_pattern{gif "Book3.gif"}

   rotate -90*y

   scale Book_Depth*Depth_Vec+Book_Height*Upvec+Book_Width*Width_Vec

   }
                                                                        }
                                                                #break
                                                        #case(4)

texture{pigment{image_pattern{gif "Book4.gif"}

   rotate -90*y

   scale Book_Depth*Depth_Vec+Book_Height*Upvec+Book_Width*Width_Vec

   }
                                                                        }
                                                                #break
                                                        #case(5)

texture{pigment{image_pattern{gif "Book5.gif"}

   rotate -90*y

   scale Book_Depth*Depth_Vec+Book_Height*Upvec+Book_Width*Width_Vec

   }
                                                                        }
                                                                #break
                                                        #case(6)

texture{pigment{image_pattern{gif "Book6.gif"}

   rotate -90*y

   scale Book_Depth*Depth_Vec+Book_Height*Upvec+Book_Width*Width_Vec

   }
                                                                        }
                                                                #break
                                                        #case(7)

texture{pigment{image_pattern{gif "Book7.gif"}

   rotate -90*y

   scale Book_Depth*Depth_Vec+Book_Height*Upvec+Book_Width*Width_Vec

   }
                                                                        }
                                                                #break
                                                        #case(8)

texture{pigment{image_pattern{gif "Book8.gif"}

   rotate -90*y

   scale Book_Depth*Depth_Vec+Book_Height*Upvec+Book_Width*Width_Vec

   }
                                                                        }
                                                                #break
                                                        #case(9)

texture{pigment{image_pattern{gif "Book9.gif"}

   rotate -90*y

   scale Book_Depth*Depth_Vec+Book_Height*Upvec+Book_Width*Width_Vec

   }
                                                                        }
                                                                #break
                                                        #end
                                                 texture{pigment{color
Book_Color
                                                                filter .9
                                                                }
                                                        }

                                                        translate
(c1*Partion_Height+Base_Height)*Upvec+(c2*Partion_Width+c)*Width_Vec
                                                }
                                        #end
                                #local c=c+Book_Width;
                                #if (rand(Seed)>Percent_Full)
                                        #local c=Partion_Width;
                                        #end
                                #end
                        #local c1=c1+1;
                        #end
                #local c2=c2+1;
                #end
        }

#### End scratch.pov #####

I hope having to cut and paste this does not corrupt the file.  If
nessesary, I can email any of the above files or results on request.
>
>Thanks for the help,
>Bosley
>(dillender@#no-spam#bigmailbox.net)
>


Post a reply to this message

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