POV-Ray : Newsgroups : povray.binaries.images : Isosurface grass Server Time
30 Jul 2024 12:29:35 EDT (-0400)
  Isosurface grass (Message 1 to 4 of 4)  
From: Christian Froeschlin
Subject: Isosurface grass
Date: 17 Jul 2011 11:09:30
Message: <4e22fb2a@news.povray.org>
After all this talk of periodic functions in p.g. ... ;)

A patch of grass is a single isosurface. There are multiple
patches only to show lower densities on the left.

Render time was about 8 minutes for 800x600 with +a0.1
using 3.7 RC3 on a rather fast hexacore. Not something you
want to combine with radiosity, I think.


Post a reply to this message


Attachments:
Download 'grass.jpg' (208 KB)

Preview of image 'grass.jpg'
grass.jpg


 

From: Christian Froeschlin
Subject: Re: Isosurface grass
Date: 17 Jul 2011 11:46:55
Message: <4e2303ef@news.povray.org>
Closeup looks rather odd due to the way random perturbations
may affect the shape of grass blades ;)


Post a reply to this message


Attachments:
Download 'grass_closeup.jpg' (154 KB)

Preview of image 'grass_closeup.jpg'
grass_closeup.jpg


 

From: Jörg 'Yadgar' Bleimann
Subject: Re: Isosurface grass
Date: 19 Jul 2011 03:04:04
Message: <4e252c64$1@news.povray.org>
High!

On 17.07.2011 17:46, Christian Froeschlin wrote:
> Closeup looks rather odd due to the way random perturbations
> may affect the shape of grass blades ;)

Cool, alien grass for Port Whatmough! May I use the isosurface code?

See you in Khyberspace!

Yadgar

Now playing: The Battle Of Epping Forest (Genesis)


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Isosurface grass
Date: 19 Jul 2011 18:30:32
Message: <4e260588$1@news.povray.org>
> Cool, alien grass for Port Whatmough! May I use the isosurface code?

Sure, I cleaned it up a little bit:


//
// WIDTH and DEPTH limit the size of the isosurface / grass field
//
// SPACING, THICKNESS and HEIGHT determine grass blade geometry
//
// Sample call: GRASS(5,5,0.004,0.0015,0.08)
//
// Note:  max gradient and required accuracy of isosurface depend
// on spacing and thickness and may need to be tuned manually
#macro GRASS(WIDTH,DEPTH,SPACING,THICKNESS,HEIGHT)

#local NSA = 5*SPACING;     // Spacing noise amplitude
#local NSF = 1/(5*SPACING); // Spacing noise frequency
#local NHA = HEIGHT;        // Height noise amplitude
#local NHF = 1/HEIGHT;      // Height noise frequency

#local f_blade  = function(x,y,z)
{
   f_sphere(x/THICKNESS,y/HEIGHT,z/THICKNESS,1)
}

#local f_blades = function(x,y,z)
{
   f_blade(sin(x/SPACING)*SPACING,y,sin(z/SPACING)*SPACING)
}

#local f_grass  = function(x,y,z)
{
   f_blades(x + NSA * (f_bozo(x*NSF,       0, z*NSF)-0.5)
              + NHA * (f_bozo(x*NSF,   y*NHF, z*NSF)-0.5),
            y + NHA *  f_bozo(x*NSF, 0,z*NSF),
            z + NSA * (f_bozo(x*NSF,10,z*NSF)-0.5)
              + NHA * (f_bozo(x*NSF,10+y*NHF, z*NSF)-0.5)
           )
}

isosurface
{
   function { f_grass(x,y,z) }
   contained_by { box {<0,0,0>,<WIDTH,NHA+HEIGHT,DEPTH>} }
   accuracy 0.00005
   max_gradient 3000
}

#end


Post a reply to this message

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