POV-Ray : Newsgroups : povray.advanced-users : Help needed! Forest memory problems Server Time
29 Jul 2024 08:16:14 EDT (-0400)
  Help needed! Forest memory problems (Message 22 to 31 of 31)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: ABX
Subject: Re: Help needed! Forest memory problems - I give up!
Date: 20 Dec 2002 06:44:45
Message: <3i060vchcpflhhhkq5vn7n55agm7fvgdsf@4ax.com>
On Fri, 20 Dec 2002 11:39:16 -0000, "Tek" <tek### [at] evilsuperbraincom> wrote:
> BTW, the file definitely has only one mesh in.

just for sure, between 'mesh{' and '}' ?

ABX


Post a reply to this message

From: Tek
Subject: Re: Help needed! Forest memory problems - I give up!
Date: 20 Dec 2002 06:55:45
Message: <3e030541$1@news.povray.org>
"ABX" <abx### [at] abxartpl> 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] gmxde> 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

From: Apache
Subject: Re: Help needed! Forest memory problems
Date: 20 Dec 2002 18:47:22
Message: <3e03ac0a@news.povray.org>
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] evilsuperbraincom> 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

From: Christopher James Huff
Subject: Re: Help needed! Forest memory problems - I give up!
Date: 20 Dec 2002 23:36:44
Message: <chrishuff-BEB8B3.23310120122002@netplex.aussie.org>
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] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Warp
Subject: Re: Help needed! Forest memory problems
Date: 21 Dec 2002 08:48:57
Message: <3e047149@news.povray.org>
Apache <apa### [at] yahoocom> 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

<<< Previous 10 Messages Goto Initial 10 Messages

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