POV-Ray : Newsgroups : povray.advanced-users : Grass Server Time
25 Nov 2024 14:29:15 EST (-0500)
  Grass (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Niki Estner
Subject: Grass
Date: 30 Aug 2002 04:24:00
Message: <3d6f2ba0@news.povray.org>
Hi there,

I got a scene where I need some grass. I know, there are include files on
the www that do wonderful grass, but in my case the camera is quite far of,
so only rough shapes can be seen: I decided to make only ellipsoids for the
grass. So I built a #while loop that creates 500.000 spheres, all scaled,
rotated and translated.
Unfortunately this needs far too much memory. (much more that I have)
I tried something alike with triangles (in a mesh), but with that it'd need
weeks to render the scene (spheres with lots of swapping are actually
faster!)

I don't think this is a new problem: using many particles for hair, grass,
explosions isn't a big idea, and using the fastest raytracing object - the
sphere - is also only reasonable. Did anyone find a way to keep the memory
usage in bounds?

Niki


Post a reply to this message

From: Micha Riser
Subject: Re: Grass
Date: 30 Aug 2002 04:54:43
Message: <3d6f32d2@news.povray.org>
Niki Estner wrote:

> Unfortunately this needs far too much memory. (much more that I have)
> I tried something alike with triangles (in a mesh), but with that it'd
> need weeks to render the scene (spheres with lots of swapping are actually
> faster!)

Mesh have the advantage that when you copy them they need only some bytes 
(probably a few hundreds) for the copy. This does not help when you use 
mesh of a single grass blade and copy it 500000 times. But when you instead 
make a mesh of 1000 grass blades and copy it 500 times you only need the 
memory for 1000 grass blades plus 499 times the memory for the mesh copy. 
It should also render reasonably fast. Rune has made an intersting grass 
texture that actually works on the texture level and does not simulate the 
individual blades with objects 
(http://runevision.com/3d/include/include.asp).

- Micha

-- 
http://objects.povworld.org - the POV-Ray Objects Collection


Post a reply to this message

From: Slime
Subject: Re: Grass
Date: 30 Aug 2002 09:09:06
Message: <3d6f6e72$1@news.povray.org>
> Unfortunately this needs far too much memory. (much more that I have)
> I tried something alike with triangles (in a mesh), but with that it'd
need
> weeks to render the scene (spheres with lots of swapping are actually
> faster!)

#declare a grass blade, and then place however many of them with
object{grassblade translate...}. Then it's not creating a new object in
memory for every blade.

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: Le Forgeron
Subject: Re: Grass
Date: 30 Aug 2002 09:59:51
Message: <3D6F7A84.3050403@free.fr>
Niki Estner wrote:

> Hi there,
> 
> I got a scene where I need some grass. I know, there are include files on
> the www that do wonderful grass, but in my case the camera is quite far of,
> so only rough shapes can be seen: I decided to make only ellipsoids for the
> grass. So I built a #while loop that creates 500.000 spheres, all scaled,
> rotated and translated.
> Unfortunately this needs far too much memory. (much more that I have)
> I tried something alike with triangles (in a mesh), but with that it'd need
> weeks to render the scene (spheres with lots of swapping are actually
> faster!)
> 
> I don't think this is a new problem: using many particles for hair, grass,
> explosions isn't a big idea, and using the fastest raytracing object - the
> sphere - is also only reasonable. Did anyone find a way to keep the memory
> usage in bounds?


Classical with grass is to make a mesh of triangles for a "unit",
then duplicate the mesh around to pave.

The right tuning of "unit" is nevertheless required:
  - too small, there is too much mesh bounding box to test against.
  - too big, memory usage is too high and there is more time
    to find the intersection in the mesh than finding the mesh it is 
part of with bounding box.

To avoid pattern repetition, a little jitter as well as random rotation


Post a reply to this message

From: Christopher James Huff
Subject: Re: Grass
Date: 30 Aug 2002 12:18:39
Message: <chrishuff-1AD438.12180330082002@netplex.aussie.org>
In article <3d6f6e72$1@news.povray.org>, "Slime" <slm### [at] slimelandcom> 
wrote:

> #declare a grass blade, and then place however many of them with
> object{grassblade translate...}. Then it's not creating a new object in
> memory for every blade.

Wrong, it does create a new object for each blade. With meshes, the 
geometry data gets shared between all the copies, so you can make lots 
of complex objects with very little memory...each mesh only needs 
transformations, flags, a pointer to the geometry data, and maybe 
textures (I'm not sure how textures are handled).

The usual method of making grass is to make a mesh of a patch of grass, 
and duplicate that patch around the scene. To avoid tiling effects, you 
can randomly select from an array of several different patches and/or 
randomly rotate or flip (scale by -1 along a dimension) the patches.

-- 
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: Christopher James Huff
Subject: Re: Grass
Date: 30 Aug 2002 12:20:02
Message: <chrishuff-066138.12192630082002@netplex.aussie.org>
In article <3d6f2ba0@news.povray.org>,
 "Niki Estner" <nik### [at] freenetde> wrote:

> I don't think this is a new problem: using many particles for hair, grass,
> explosions isn't a big idea, and using the fastest raytracing object - the
> sphere - is also only reasonable. Did anyone find a way to keep the memory
> usage in bounds?

What makes you think the sphere is the fastest?
Using meshes is more efficient memory-wise, and probably a lot faster 
than a bunch of spheres.

-- 
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: Niki Estner
Subject: Re: Grass
Date: 30 Aug 2002 13:17:26
Message: <3d6fa8a6@news.povray.org>
> What makes you think the sphere is the fastest?
I tried putting 10000 spheres and 10000 triangles into a scene. Rendering
the triangle scene took about 5 times longer (don't know the exact numbers
any more).
For a triangle an intersection between a plane and a ray has to be
calculated, and then it has to be checked if the point is inside the
triangle. For a sphere, only the intersection point has to be calculated. I
think checking if a point is inside a triangle is more complex than
calculating the ray-sphere intersection.

> Using meshes is more efficient memory-wise, and probably a lot faster
> than a bunch of spheres.
Triangles surely need less memory, but they seem to render slower. Also, if
I want similar effects to the sphere-grass, I need smooth triangles, which
render even more slower.


Post a reply to this message

From: Christoph Hormann
Subject: Re: Grass
Date: 30 Aug 2002 13:57:22
Message: <3D6FB202.E175FCBC@gmx.de>
Niki Estner wrote:
> 
> I tried putting 10000 spheres and 10000 triangles into a scene. Rendering
> the triangle scene took about 5 times longer (don't know the exact numbers
> any more).
> For a triangle an intersection between a plane and a ray has to be
> calculated, and then it has to be checked if the point is inside the
> triangle. For a sphere, only the intersection point has to be calculated.
> [...]

No, a high number of triangles in a mesh will always render much faster
than individual spheres (of roughly the same size of course)

You should make sure your triangles are in a mesh (and not a union) and
all in one mesh of course.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 13 Aug. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Warp
Subject: Re: Grass
Date: 30 Aug 2002 15:08:25
Message: <3d6fc2a8@news.povray.org>
Actually povray can optimize a bunch of spheres so that they will
render faster (by defining bounding box hierarchies).
  20000 spheres will not take twice as long to render as 10000 spheres.
I haven't measured, but I would guess that the factor is more close to
something like 1.1 or whatever.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Dearmad
Subject: Re: Grass
Date: 30 Aug 2002 16:43:16
Message: <3D6FD99B.73803C96@applesnake.net>
if they're far enough off that spheres could have done it, then I'd have
used nothing but a procedural texture on a contoured surface.

-p
-- 
Modeling slave:
"Ballet pour ma fille."
http://www.applesnake.net


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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