POV-Ray : Newsgroups : povray.newusers : Rendering memory limitations : Re: Rendering memory limitations Server Time
29 Jul 2024 00:33:43 EDT (-0400)
  Re: Rendering memory limitations  
From: nemesis
Date: 17 May 2007 15:50:01
Message: <web.464caf8dc7f5d682773c9a3e0@news.povray.org>
this is an interesting experiment and I thought it'd be useful to share with
you.

I made this simple scene to test:

background { rgb .6 }

#local dna_base =  union {
    sphere { 0, 1 pigment { rgb z } translate y*2 }
    cylinder { -y,y .2 pigment { rgb x } }
    sphere { 0, 1 pigment { rgb z } translate -y*2 }
}

#declare dna =
union {
    #local i = 0;
    #while (i < 100000)
        object { dna_base rotate x*45*i
  translate -2*y*sin(i+1)/2 +1.2*x*(i+1)
 }
        #declare i = i + 1;
    #end
}

object { dna
    translate z*140
}

light_source { 10*(4-8*z) 1.2 }

and the memory consumption quickly got over 200MB, at which point I halted
the process and started over a slightly modified scene:

background { rgb .6 }

#local dna_base =  union {
    sphere { 0, 1 pigment { rgb z } translate y*2 }
    cylinder { -y,y .2 pigment { rgb x } }
    sphere { 0, 1 pigment { rgb z } translate -y*2 }
}

#declare dna =
union {
    #local i = 0;
    #while (i < 1000 )//100000)
        object { dna_base rotate x*45*i
  translate -2*y*sin(i+1)/2 +1.2*x*(i+1)
 }
        #declare i = i + 1;
    #end
}

union {
    #local i = 0;
    #while (i < 100 )//100000)
        object { dna translate -2*y*(i+1) }
        #declare i = i + 1;
    #end

    translate z*140
}

light_source { 10*(4-8*z) 1.2 }

well, forget it:  CSG really turns povray into a memory hog no matter what
you do.  It has gone over 200MB as well and I halted again.  It just took a
lot more time to get there.  Important lesson here:  better few unions with
lots of objects than lots of unions with fewer (but huge!) objects...

So I guess it's your choice:  get a true solid surface for insane amounts of
memory or a resolution-limited but much more economic polygonal mesh...
thank god the DNA isn't an isosurface! :P


Post a reply to this message

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