POV-Ray : Newsgroups : povray.newusers : Grass (New Problem) Server Time
26 Nov 2024 23:44:55 EST (-0500)
  Grass (New Problem) (Message 1 to 4 of 4)  
From: Brent G
Subject: Grass (New Problem)
Date: 17 Sep 2003 15:34:07
Message: <3f68b72f$1@news.povray.org>
Yay :) Sorry I'm bugging you all with so many questions but . . . I got 
a question. Using Gilles' MakeGrass macro, I've created a nice patch of 
grass, only problem is that it's a mesh 100k some triangles (Yikes) and 
in relation to the rest of my scene it's a small portion, so I'll have 
to use alot of these patches . . now herein lies the problem, having to 
parse 100k triangles a few hundred times is . . . not good? I'm sure I'm 
missing something obvious here. . . .


Post a reply to this message

From: Christopher James Huff
Subject: Re: Grass (New Problem)
Date: 17 Sep 2003 18:19:00
Message: <cjameshuff-7D8F52.18180217092003@netplex.aussie.org>
In article <3f68b72f$1@news.povray.org>, Brent G <pov### [at] bc-hqcom> 
wrote:

> Yay :) Sorry I'm bugging you all with so many questions but . . . I got 
> a question. Using Gilles' MakeGrass macro, I've created a nice patch of 
> grass, only problem is that it's a mesh 100k some triangles (Yikes) and 
> in relation to the rest of my scene it's a small portion, so I'll have 
> to use alot of these patches . . now herein lies the problem, having to 
> parse 100k triangles a few hundred times is . . . not good? I'm sure I'm 
> missing something obvious here. . . .

You only parse it once, and use multiple copies of it. Actually, you 
should make several different patches, and pick from them randomly to 
avoid tiling artifacts.

When copying a mesh, POV will keep just one instance of the actual mesh 
data. 100 copies of that 100K triangle mesh will store 100K triangles 
and their associated data and 100 references to that data. This is what 
makes meshes so useful for grass.

-- 
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: Brent G
Subject: Re: Grass (New Problem)
Date: 17 Sep 2003 20:31:11
Message: <3f68fccf@news.povray.org>
Christopher James Huff wrote:

> In article <3f68b72f$1@news.povray.org>, Brent G <pov### [at] bc-hqcom> 
> wrote:
> 
> 
>>Yay :) Sorry I'm bugging you all with so many questions but . . . I got 
>>a question. Using Gilles' MakeGrass macro, I've created a nice patch of 
>>grass, only problem is that it's a mesh 100k some triangles (Yikes) and 
>>in relation to the rest of my scene it's a small portion, so I'll have 
>>to use alot of these patches . . now herein lies the problem, having to 
>>parse 100k triangles a few hundred times is . . . not good? I'm sure I'm 
>>missing something obvious here. . . .
> 
> 
> You only parse it once, and use multiple copies of it. Actually, you 
> should make several different patches, and pick from them randomly to 
> avoid tiling artifacts.
> 
> When copying a mesh, POV will keep just one instance of the actual mesh 
> data. 100 copies of that 100K triangle mesh will store 100K triangles 
> and their associated data and 100 references to that data. This is what 
> makes meshes so useful for grass.
> 

   object {
     #include "fgrass1.inc"

     texture {
       pigment {
         dents
         triangle_wave
         color_map {
           [0.0 rgb <0.0, 0.4, 0.1>]
           [1.0 rgb <0.1, 0.6, 0.2>]
         }
       }
     }
     scale 0.08
     translate <0.5,0.6,-8.0>
   }

Would that be correct then? Just alternate the #include line between 
grass patches?


Post a reply to this message

From: Gilles Tran
Subject: Re: Grass (New Problem)
Date: 18 Sep 2003 05:36:24
Message: <3f697c98$1@news.povray.org>

news:3f68fccf@news.povray.org...
>
> Would that be correct then? Just alternate the #include line between
> grass patches?
>

No, just parse and declare the patch once and then use the resulting object
as many times as you want.
#declare MyGrass=object{#include "fgrass1.inc" texture{...}}

object{MyGrass translate ... rotate ...}
object{MyGrass translate ... rotate ...}
object{MyGrass translate ... rotate ...}

In fact there's a makeprairie macro at the end of the main macro file that
does exactly that, but of course you can write the patch placement loop
yourself so that the grass goes where you want it to be.

G.

-- 

**********************
http://www.oyonale.com
**********************
- Graphic experiments
- POV-Ray and Poser computer images
- Posters


Post a reply to this message

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