 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
This maybe a dumb question...
I'm trying to create a forest for my IRTC entry. I initially put in
placeholders (8000 cones and spheres) which worked fine, but now I've tried
to replace them with proper trees and I keep running out of memory. Even if
I reduce it to only 80 trees it still runs out (despite me having 512MB RAM
and a 2Gig virtual memory file).
I've tried using Splinetree and MakeTree and I get the same problem with
both. I thought that with pov if you had multiple copies of the same object
they didn't take up loads of memory, or is that only meshes?
Does anyone know how I can make a forest of 8000 trees without pov trying to
use 8000 times the memory it needs for one tree?
Any help would be much appreciated
--
Tek
http://www.evilsuperbrain.com
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I'm sorry, but it is okay. You need trees out of meshes. Then you can reduce
memory load. Trees made out of spheres or cones need exact multiples of
memory.
I'm not sure with splines for Splinetree, but most of the memory need comes
from the leafes,which are mostly made out of spheres...
Christoph Hormann made a special version of MakeTree which generates memory
saving meshes one year ago, but he didnīt publish the code.
Norbert
Tek wrote:
>This maybe a dumb question...
>
>I'm trying to create a forest for my IRTC entry. I initially put in
>placeholders (8000 cones and spheres) which worked fine, but now I've tried
>to replace them with proper trees and I keep running out of memory. Even if
>I reduce it to only 80 trees it still runs out (despite me having 512MB RAM
>and a 2Gig virtual memory file).
>
>I've tried using Splinetree and MakeTree and I get the same problem with
>both. I thought that with pov if you had multiple copies of the same object
>they didn't take up loads of memory, or is that only meshes?
>
>Does anyone know how I can make a forest of 8000 trees without pov trying to
>use 8000 times the memory it needs for one tree?
>
>Any help would be much appreciated
>--
>Tek
>http://www.evilsuperbrain.com
>
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Excellent. Thanks for your help I was starting to panic.
I think I can come up with some nice trees using meshes, or maybe modify
maketree myself. Panic over :)
Cheers.
--
Tek
http://www.evilsuperbrain.com
"Norbert Kern" <nor### [at] t-online de> wrote in message
news:web.3e0069c2ea181baced02f1080@news.povray.org...
> I'm sorry, but it is okay. You need trees out of meshes. Then you can
reduce
> memory load. Trees made out of spheres or cones need exact multiples of
> memory.
> I'm not sure with splines for Splinetree, but most of the memory need
comes
> from the leafes,which are mostly made out of spheres...
>
> Christoph Hormann made a special version of MakeTree which generates
memory
> saving meshes one year ago, but he didn´t publish the code.
>
>
> Norbert
>
>
>
>
> Tek wrote:
> >This maybe a dumb question...
> >
> >I'm trying to create a forest for my IRTC entry. I initially put in
> >placeholders (8000 cones and spheres) which worked fine, but now I've
tried
> >to replace them with proper trees and I keep running out of memory. Even
if
> >I reduce it to only 80 trees it still runs out (despite me having 512MB
RAM
> >and a 2Gig virtual memory file).
> >
> >I've tried using Splinetree and MakeTree and I get the same problem with
> >both. I thought that with pov if you had multiple copies of the same
object
> >they didn't take up loads of memory, or is that only meshes?
> >
> >Does anyone know how I can make a forest of 8000 trees without pov trying
to
> >use 8000 times the memory it needs for one tree?
> >
> >Any help would be much appreciated
> >--
> >Tek
> >http://www.evilsuperbrain.com
> >
>
>
>
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Wasn't it Tek who wrote:
>This maybe a dumb question...
>
>I'm trying to create a forest for my IRTC entry. I initially put in
>placeholders (8000 cones and spheres) which worked fine, but now I've tried
>to replace them with proper trees and I keep running out of memory. Even if
>I reduce it to only 80 trees it still runs out (despite me having 512MB RAM
>and a 2Gig virtual memory file).
>
>I've tried using Splinetree and MakeTree and I get the same problem with
>both. I thought that with pov if you had multiple copies of the same object
>they didn't take up loads of memory, or is that only meshes?
>
>Does anyone know how I can make a forest of 8000 trees without pov trying to
>use 8000 times the memory it needs for one tree?
>
>Any help would be much appreciated
Paul T Dawson once released meshtree.inc that creates a tree as a mesh.
If you arrange for there to be only a few actual different mesh trees
you can create an image with a large number of copies of those few trees
quite efficiently. Randomly scale and rotate the copies and they look
reasonably different.
I ran a quick test on my 850 MHz machine, and 8000 copies of the same
highly detailed tree rendered in 59 seconds at 800x600 without AA. Peak
memory used was 29.6 Mb.
In my test, each tree had 584 branches and 6144 leaves, so the entire
orchard had over 49 million leaves.
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
POV-Ray needs object referencing. Maybe something for POV-Ray 4.0 or 3.6 ?
#declare Thing = intersection {
sphere {<-10.000, 0.000, 0.000> 11.000}
sphere {< 10.000, 0.000, 0.000> 11.000}
}
#declare Clone = \Thing;
or
#declare Clone = reference(Thing);
or
whatever
:-)
Apache
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Thorsten Froehlich
Subject: Re: Help needed! Forest memory problems
Date: 18 Dec 2002 15:28:24
Message: <3e00da68@news.povray.org>
|
|
 |
|  |
|  |
|
 |
In article <3e00d424@news.povray.org> , "Apache"
<apa### [at] yahoo com> wrote:
> POV-Ray needs object referencing. Maybe something for POV-Ray 4.0 or 3.6 ?
>
> #declare Thing = intersection {
> sphere {<-10.000, 0.000, 0.000> 11.000}
> sphere {< 10.000, 0.000, 0.000> 11.000}
> }
>
> #declare Clone = \Thing;
> or
> #declare Clone = reference(Thing);
> or
> whatever
You not only missed that it is already done for meshes transparently, but
also that there is zero need for a user controlling something POV-Ray can do
automatically. So not need to mess up the syntax. Anyway, this has been
discussed to death in recent month anyway...
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Mike Williams wrote:
>Paul T Dawson once released meshtree.inc that creates a tree as a mesh.
>If you arrange for there to be only a few actual different mesh trees
>you can create an image with a large number of copies of those few trees
>quite efficiently. Randomly scale and rotate the copies and they look
>reasonably different.
>
>I ran a quick test on my 850 MHz machine, and 8000 copies of the same
>highly detailed tree rendered in 59 seconds at 800x600 without AA. Peak
>memory used was 29.6 Mb.
Ooooh! <drool!> Where can I find it?
RG - I'm not lost, I'm just on a random path to a random destination
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Try here:
http://www.netaxs.com/~ptdawson/ptdtree3.htm
--
autowitch
http://www.autowitch.org
> Ooooh! <drool!> Where can I find it?
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Having failed to find any really good mesh tree systems (ptdtree doesn't look
right for my purposes) I finally gave up and changed maketree to use meshes.
It took half an hour to modify the code! I wish I'd just done that in the first
place! :)
Unfortunately all my vector maths has had a sever impact on the parse time, but
I reckon I can fix that...
Thanks for your help everyone :)
--
Tek
http://www.evilsuperbrain.com
Tek <tek### [at] evilsuperbrain com> wrote in message news:3e004f42@news.povray.org...
> This maybe a dumb question...
>
> I'm trying to create a forest for my IRTC entry. I initially put in
> placeholders (8000 cones and spheres) which worked fine, but now I've tried
> to replace them with proper trees and I keep running out of memory. Even if
> I reduce it to only 80 trees it still runs out (despite me having 512MB RAM
> and a 2Gig virtual memory file).
>
> I've tried using Splinetree and MakeTree and I get the same problem with
> both. I thought that with pov if you had multiple copies of the same object
> they didn't take up loads of memory, or is that only meshes?
>
> Does anyone know how I can make a forest of 8000 trees without pov trying to
> use 8000 times the memory it needs for one tree?
>
> Any help would be much appreciated
> --
> Tek
> http://www.evilsuperbrain.com
>
>
>
>
>
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
ahem... make that 2 hours... and counting... I just discovered that I need
to change the union of all the leaves into a mesh...
--
Tek
http://www.evilsuperbrain.com
"Tek" <tek### [at] evilsuperbrain com> wrote in message
news:3e011416@news.povray.org...
> Having failed to find any really good mesh tree systems (ptdtree doesn't
look
> right for my purposes) I finally gave up and changed maketree to use
meshes.
>
> It took half an hour to modify the code! I wish I'd just done that in the
first
> place! :)
>
> Unfortunately all my vector maths has had a sever impact on the parse
time, but
> I reckon I can fix that...
>
> Thanks for your help everyone :)
>
> --
> Tek
> http://www.evilsuperbrain.com
>
>
> Tek <tek### [at] evilsuperbrain com> wrote in message
news:3e004f42@news.povray.org...
> > This maybe a dumb question...
> >
> > I'm trying to create a forest for my IRTC entry. I initially put in
> > placeholders (8000 cones and spheres) which worked fine, but now I've
tried
> > to replace them with proper trees and I keep running out of memory. Even
if
> > I reduce it to only 80 trees it still runs out (despite me having 512MB
RAM
> > and a 2Gig virtual memory file).
> >
> > I've tried using Splinetree and MakeTree and I get the same problem with
> > both. I thought that with pov if you had multiple copies of the same
object
> > they didn't take up loads of memory, or is that only meshes?
> >
> > Does anyone know how I can make a forest of 8000 trees without pov
trying to
> > use 8000 times the memory it needs for one tree?
> >
> > Any help would be much appreciated
> > --
> > Tek
> > http://www.evilsuperbrain.com
> >
> >
> >
> >
> >
>
>
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Tek
Subject: Re: Help needed! Forest memory problems - I give up!
Date: 19 Dec 2002 17:20:18
Message: <3e024622@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Okay, I give up!
I've spent about 5 hours re-writing maketree to use only meshes, and it now
means I can do 200 trees before my computer starts grinding to a halt! :(
I'm gonna give up and do much more simple trees or something.
If anyone can show me some source that duplicates a complicated mesh (5MB .inc
file) several thousand times without using hundreds of meg then I might be able
to find out what's going wrong. But the deadline draws closer so I'll just have
to find another way :(
--
Tek
http://www.evilsuperbrain.com
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Thorsten Froehlich
Subject: Re: Help needed! Forest memory problems - I give up!
Date: 19 Dec 2002 17:39:33
Message: <3e024aa5$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
In article <3e024622@news.povray.org> , "Tek" <tek### [at] evilsuperbrain com>
wrote:
> If anyone can show me some source that duplicates a complicated mesh (5MB .inc
> file)
Simple: Declare it once, then (re)use it via the "object" statement.
Thorsten
____________________________________________________
Thorsten Froehlich
e-mail: mac### [at] povray org
I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Tek
Subject: Re: Help needed! Forest memory problems - I give up!
Date: 19 Dec 2002 18:15:47
Message: <3e025323@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Nope, did that. It substantially reduced the memory, but it still couldn't
handle 8000.
--
Tek
http://www.evilsuperbrain.com
Thorsten Froehlich <tho### [at] trf de> wrote in message
news:3e024aa5$1@news.povray.org...
> In article <3e024622@news.povray.org> , "Tek" <tek### [at] evilsuperbrain com>
> wrote:
>
> > If anyone can show me some source that duplicates a complicated mesh (5MB
.inc
> > file)
>
> Simple: Declare it once, then (re)use it via the "object" statement.
>
> Thorsten
>
> ____________________________________________________
> Thorsten Froehlich
> e-mail: mac### [at] povray org
>
> I am a member of the POV-Ray Team.
> Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Thorsten Froehlich
Subject: Re: Help needed! Forest memory problems - I give up!
Date: 19 Dec 2002 18:56:19
Message: <3e025ca3$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
In article <3e025323@news.povray.org> , "Tek" <tek### [at] evilsuperbrain com>
wrote:
> Nope, did that. It substantially reduced the memory, but it still couldn't
> handle 8000.
Hmm, would you be willing to make the scene available somewhere?
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Tek
Subject: Re: Help needed! Forest memory problems - I give up!
Date: 19 Dec 2002 20:08:52
Message: <3e026da4@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Well I no longer have the code that didn't work, plus I'm not sure how Gilles
would feel about me distributing my modified version of his code. But you might
want to try this:
If you have maketree you can probably recreate my problem using the second
example tree (extree2.pov), provided you don't use the branches ('cause they're
not meshes).
Set it to output files (dofile = true), then run it so it produces 3 files.
Create a new scene that declares an object as:
#declare tree = #include "gtfoliage2.inc"
And then try placing 8000 instances of that object in a loop. In theory you
should experience the same difficulties I do, though if not I'd be interested to
know because it would indicate some other problem in my scene.
--
Tek
http://www.evilsuperbrain.com
Thorsten Froehlich <tho### [at] trf de> wrote in message
news:3e025ca3$1@news.povray.org...
> In article <3e025323@news.povray.org> , "Tek" <tek### [at] evilsuperbrain com>
> wrote:
>
> > Nope, did that. It substantially reduced the memory, but it still couldn't
> > handle 8000.
>
> Hmm, would you be willing to make the scene available somewhere?
>
> Thorsten
>
> ____________________________________________________
> Thorsten Froehlich, Duisburg, Germany
> e-mail: tho### [at] trf de
>
> Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Thu, 19 Dec 2002 23:15:11 -0000, "Tek" <tek### [at] evilsuperbrain com> wrote:
> Nope, did that. It substantially reduced the memory, but it still couldn't
> handle 8000.
Are you sure you did not used this that way:
#macro MyMesh()
#include "mesh_definition.inc"
#end
object{ MyMesh() }
object{ MyMesh() transform{ Somehow } }
?
ABX
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Christoph Hormann
Subject: Re: Help needed! Forest memory problems - I give up!
Date: 20 Dec 2002 03:30:56
Message: <3E02D541.9ED0828F@gmx.de>
|
|
 |
|  |
|  |
|
 |
Tek wrote:
>
> Well I no longer have the code that didn't work, plus I'm not sure how Gilles
> would feel about me distributing my modified version of his code. But you might
> want to try this:
>
> If you have maketree you can probably recreate my problem using the second
> example tree (extree2.pov), provided you don't use the branches ('cause they're
> not meshes).
>
> Set it to output files (dofile = true), then run it so it produces 3 files.
>
> Create a new scene that declares an object as:
> #declare tree = #include "gtfoliage2.inc"
>
> And then try placing 8000 instances of that object in a loop. In theory you
> should experience the same difficulties I do, though if not I'd be interested to
> know because it would indicate some other problem in my scene.
If you do that with an unmodified maketree you get one mesh for every leaf
and 'tree' is a union of several thousand meshes. Using that several
times will require at least the memory for the transformation matrices for
each mesh so you won't save much. The trick is to put all leaves in *one*
mesh. This involves some modification of the code, you have to transform
the vertices of the leaf instead of the leaf itself.
Christoph
--
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 07 Dec. 2002 _____./\/^>_*_<^\/\.______
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Tek
Subject: Re: Help needed! Forest memory problems - I give up!
Date: 20 Dec 2002 03:56:37
Message: <3e02db45@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Yep, I tried that too. It took most of last evening to rewrite the
transformation code, but once I had it still had all the same problems as
when it had been 1 mesh per leaf. My foliage include is just a 5 meg mesh.
Though my rewrite of the branch code works fine, so if I want lots of bare
trees there's no problem. :(
--
Tek
http://www.evilsuperbrain.com
"Christoph Hormann" <chr### [at] gmx de> wrote in message
news:3E02D541.9ED0828F@gmx.de...
>
>
> Tek wrote:
> >
> > Well I no longer have the code that didn't work, plus I'm not sure how
Gilles
> > would feel about me distributing my modified version of his code. But
you might
> > want to try this:
> >
> > If you have maketree you can probably recreate my problem using the
second
> > example tree (extree2.pov), provided you don't use the branches ('cause
they're
> > not meshes).
> >
> > Set it to output files (dofile = true), then run it so it produces 3
files.
> >
> > Create a new scene that declares an object as:
> > #declare tree = #include "gtfoliage2.inc"
> >
> > And then try placing 8000 instances of that object in a loop. In theory
you
> > should experience the same difficulties I do, though if not I'd be
interested to
> > know because it would indicate some other problem in my scene.
>
> If you do that with an unmodified maketree you get one mesh for every leaf
> and 'tree' is a union of several thousand meshes. Using that several
> times will require at least the memory for the transformation matrices for
> each mesh so you won't save much. The trick is to put all leaves in *one*
> mesh. This involves some modification of the code, you have to transform
> the vertices of the leaf instead of the leaf itself.
>
> Christoph
>
> --
> POV-Ray tutorials, include files, Sim-POV,
> HCR-Edit and more: http://www.tu-bs.de/~y0013390/
> Last updated 07 Dec. 2002 _____./\/^>_*_<^\/\.______
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
No it's definitely:
#declare MyMesh = #include "mesh.inc"
object { MyMesh transform }
object { MyMesh transform }
object { MyMesh transform }
--
Tek
http://www.evilsuperbrain.com
"ABX" <abx### [at] abx art pl> wrote in message
news:dbj50vgurcq3sniiuf7993lhikk33aesmf@4ax.com...
> On Thu, 19 Dec 2002 23:15:11 -0000, "Tek" <tek### [at] evilsuperbrain com> wrote:
> > Nope, did that. It substantially reduced the memory, but it still
couldn't
> > handle 8000.
>
> Are you sure you did not used this that way:
>
> #macro MyMesh()
> #include "mesh_definition.inc"
> #end
>
> object{ MyMesh() }
> object{ MyMesh() transform{ Somehow } }
>
> ?
>
> ABX
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Christoph Hormann
Subject: Re: Help needed! Forest memory problems - I give up!
Date: 20 Dec 2002 04:21:07
Message: <3E02E100.EC7FEB26@gmx.de>
|
|
 |
|  |
|  |
|
 |
Tek wrote:
>
> Yep, I tried that too. It took most of last evening to rewrite the
> transformation code, but once I had it still had all the same problems as
> when it had been 1 mesh per leaf. My foliage include is just a 5 meg mesh.
>
If your code looks like:
#declare Mesh= mesh { ... }
object { Mesh ... }
object { Mesh ... }
...
this should work.
If you have the mesh written to a file you should make sure it really
contains a single mesh.
Christoph
--
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 07 Dec. 2002 _____./\/^>_*_<^\/\.______
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Hmm... my code doesn't quite look like that. I do this:
#declare Mesh = #include "mesh.inc"
#declare Forest =
union {
#local nTree = 0;
#while (nTree < 8000)
object { Mesh transform { ... } }
#local nTree = nTree + 1;
#end
}
The union couldn't cause problems could it?
BTW, the file definitely has only one mesh in.
--
Tek
http://www.evilsuperbrain.com
"Christoph Hormann" <chr### [at] gmx de> wrote in message
news:3E02E100.EC7FEB26@gmx.de...
>
>
> Tek wrote:
> >
> > Yep, I tried that too. It took most of last evening to rewrite the
> > transformation code, but once I had it still had all the same problems
as
> > when it had been 1 mesh per leaf. My foliage include is just a 5 meg
mesh.
> >
>
> If your code looks like:
>
> #declare Mesh= mesh { ... }
>
> object { Mesh ... }
> object { Mesh ... }
> ...
>
> this should work.
>
> If you have the mesh written to a file you should make sure it really
> contains a single mesh.
>
> Christoph
>
> --
> POV-Ray tutorials, include files, Sim-POV,
> HCR-Edit and more: http://www.tu-bs.de/~y0013390/
> Last updated 07 Dec. 2002 _____./\/^>_*_<^\/\.______
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Fri, 20 Dec 2002 11:39:16 -0000, "Tek" <tek### [at] evilsuperbrain com> wrote:
> BTW, the file definitely has only one mesh in.
just for sure, between 'mesh{' and '}' ?
ABX
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"ABX" <abx### [at] abx art pl> wrote in message
news:3i060vchcpflhhhkq5vn7n55agm7fvgdsf@4ax.com...
> just for sure, between 'mesh{' and '}' ?
The file is just:
mesh{
triangle{ ...}
triangle{ ...}
.
. //several thousand triangles
.
triangle{ ...}
triangle{ ...}
texture { txtLeaf }
}
BTW, for what it's worth I've come up with some good looking flat trees, so
I will be able to finish my image. But I still want to work out why the mesh
ones wouldn't work!
Thanks for helping with this, guys. Keep it coming :)
--
Tek
http://www.evilsuperbrain.com
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Christoph Hormann
Subject: Re: Help needed! Forest memory problems - I give up!
Date: 20 Dec 2002 07:42:04
Message: <3E03101C.C39DAD00@gmx.de>
|
|
 |
|  |
|  |
|
 |
Tek wrote:
>
> Hmm... my code doesn't quite look like that. I do this:
>
> #declare Mesh = #include "mesh.inc"
>
> #declare Forest =
> union {
> #local nTree = 0;
> #while (nTree < 8000)
> object { Mesh transform { ... } }
>
> #local nTree = nTree + 1;
> #end
> }
>
> The union couldn't cause problems could it?
Well, if it does not work i would try dropping the union. As i said the
code i suggested has proven to work in many cases.
Christoph
--
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 07 Dec. 2002 _____./\/^>_*_<^\/\.______
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Greg M Johnson
Subject: Re: Help needed! Forest memory problems - I give up!
Date: 20 Dec 2002 13:56:00
Message: <3e0367c0$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
"Christoph Hormann" <chr### [at] gmx de> wrote in message
news:3E02E100.EC7FEB26@gmx.de...
> If your code looks like:
> #declare Mesh= mesh { ... }
> object { Mesh ... }
> object { Mesh ... }
> ...
> this should work.
Can one do
#declare Meshtrunk=mesh { ... }
#declare Meshleaf=mesh { ... }
object {Meshtrunk transform foobar1}
object {Meshtrunk transform foobar2}
object {Meshtrunk transform foobar3}
object {Meshleaf transform foobar1}
object {Meshleaf transform foobar2}
object {Meshleaf transform foobar3}
and get the benefit?
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Christoph Hormann
Subject: Re: Help needed! Forest memory problems - I give up!
Date: 20 Dec 2002 14:59:46
Message: <3E0376B0.D806F52C@gmx.de>
|
|
 |
|  |
|  |
|
 |
"Greg M. Johnson" wrote:
>
> Can one do
> #declare Meshtrunk=mesh { ... }
> #declare Meshleaf=mesh { ... }
>
> object {Meshtrunk transform foobar1}
> object {Meshtrunk transform foobar2}
> object {Meshtrunk transform foobar3}
>
> object {Meshleaf transform foobar1}
> object {Meshleaf transform foobar2}
> object {Meshleaf transform foobar3}
>
> and get the benefit?
Of course, and this makes a lot of sense if Meshleaf and Meshtrunk have
different textures because making them one mesh would require texturing
the individual triangles which would cost more memory.
Concerning render speed one large mesh of course renders faster than
several small ones.
Christoph
--
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 07 Dec. 2002 _____./\/^>_*_<^\/\.______
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
oops! Why isn't POV-Ray doing this yet? Or maybe it already does? Hmmm... I
think I'm a bit confused here :-)
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Greg M Johnson
Subject: Re: Help needed! Forest memory problems - I give up!
Date: 20 Dec 2002 22:14:31
Message: <3e03dc97$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
"Tek" <tek### [at] evilsuperbrain com> wrote in message
news:3e030164$1@news.povray.org...
> Hmm... my code doesn't quite look like that. I do this:
>
> #declare Mesh = #include "mesh.inc"
>
> #declare Forest =
> union {
> #local nTree = 0;
> #while (nTree < 8000)
> object { Mesh transform { ... } }
>
> #local nTree = nTree + 1;
> #end
> }
>
Is the problem in the way you're re-including the file each time.
**I** would do it this way:
Have a "mesh.inc" which does a
#declare TREE= mesh{....}
Then in your main file at the beginning have a single
#include"mesh.inc"
then in your macro say object{TREE transform{...}}
I don't know of a design benefit for calling it the way you do....
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Tek
Subject: Re: Help needed! Forest memory problems - I give up!
Date: 20 Dec 2002 22:42:19
Message: <3e03e31b@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Greg M. Johnson <gregj:-)56590@ao:-)l.com> wrote in message
news:3e03dc97$1@news.povray.org...
> I don't know of a design benefit for calling it the way you do....
There's no design benefit, I was just working with the way that maketree was
originally written. It would be simple to change but I didn't think it would
make any difference.
I don't think there's any difference since I belive #include literally inserts
the contents of the given file at the point where it's invoked.
--
Tek
http://www.evilsuperbrain.com
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3e03dc97$1@news.povray.org>,
"Greg M. Johnson" <gregj:-)56590@ao:-)l.com> wrote:
> Is the problem in the way you're re-including the file each time.
His code only includes the file once. Maybe you misunderstand the
#declare statement (it does not act like the C #define statement) or
meant something else...
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tag povray org
http://tag.povray.org/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Apache <apa### [at] yahoo com> wrote:
> oops! Why isn't POV-Ray doing this yet? Or maybe it already does? Hmmm... I
> think I'm a bit confused here :-)
I think that the reason is mostly historical.
For some primitives certain transformations are handled in a special way.
For example, if you translate a sphere, no transformation matrix is generated
for it, but its center is simply changed accordingly. This is a kind of
simple optimization. Of course this means that referencing is not possible
with this feature.
I don't remember if anyone has actually measured if it really affects the
speed of the rendering that much, specially with usual scenes (instead of
artificial ones constructed just to measure this).
--
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}// - Warp -
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |