POV-Ray : Newsgroups : povray.binaries.images : clouds : Re: clouds Server Time
1 Oct 2024 11:26:32 EDT (-0400)
  Re: clouds  
From: Kevin Wampler
Date: 23 Aug 2000 18:46:54
Message: <39A452DB.74C4FD24@u.arizona.edu>
Sorry that I forgot to tell how I did it.  Basically, the clouds are built using
Megapov's blob function.  This lets you build the general shape very precisely.
The more details forms are from a granite pattern which I subtracted from the
blob pattern.  Next, for realistic looking results, the cloud needs to be a more
or less constant density inside.  I do this by clipping the maximum value
allowed for the blob function at a very low value, then multiplying it by a
large value (or raising the scattering intensity) to compensate.  This gives the
cloud a sharp edge, but still lets light shine through it reasonably well.  This
method has the advantage that it lets you create a cloud with any basic shape
you wish, while allowing you to not worry about it's more detailed structure.
Since the granite pattern is subtracted from the blob pattern, the resulting
shape is contained entirely within the original blob pattern (provided the
threshold is set to 0).  This means that you can speed up rendering quite a bit
by bounding the media with the appropriate blob.  Unfortunately, it can still
take quite a bit of tinkering to get it to look just so.  In case I am not
explaining myself well, here it the relevant code.

#declare Cloud_form = function { pigment {
  blob {
    sphere { <0,0,0>, 10, 1 density_function 0, 1 }
    sphere { <1,8,0>, 5, 1 density_function 0, 1 }
    sphere { <0, 0, 0>, 8, 1 density_function 0, 1 scale <1, .7, 1> translate
<6, 1, 1>}
    sphere { <0, 0, 0>, 6, 1 density_function 0, 1 scale <1, .6, 1> translate
<10, 4, -2> }
    sphere { <0,0,0>, 13, 1 density_function 0, 1 scale <1, .5, .6> translate
<-10, 3, 4> }
    threshold 0
    max_density 1
  }
  color_map {
    [0 rgb 0]
    [1 rgb 1]
  }
} }

#declare Cloud_turb = function { pigment {
  granite
  color_map {
    [0 rgb 0]
    [.5 rgb 1]
    [1 rgb 1]
  }
  scale 15
} }

#declare Cloud1 = function { max(0, Cloud_form-.6*(1-Cloud_turb) ) }
#declare Cloud = function { min(Cloud1^.3, .07) }

intersection {
  box { <-20, 0, -20>, <20, 20, 20> }

  blob {
    sphere { <0,0,0>, 10, 1 }
    sphere { <1,8,0>, 5, 1 }
    sphere { <0, 0, 0>, 8, 1 scale <1, .7, 1> translate <6, 1, 1>}
    sphere { <0, 0, 0>, 6, 1 scale <1, .6, 1> translate <10, 4, -2> }
    sphere { <0,0,0>, 13, 1 scale <1, .5, .6> translate <-10, 3, 4> }
    threshold .001
  }

  texture { pigment { color rgbt 1 } }
  interior {
    media {
      method 2
      intervals 3
      scattering { 5, color rgb 1/5 extinction 1 eccentricity .2 }
      density {
        function { Cloud }
        color_map {
          [0  color rgb 0]
          [1  color rgb 1]
        }
      }
    }
  }
  scale 45
  translate <50, 200, 2500>
  hollow
}

Mick Hazelgrove wrote:

> Interesting, definately has possibilities. Are you going to let us in how it
> was done?
>
> Mick
>
> "Kevin Wampler" <wam### [at] uarizonaedu> wrote in message
> news:39A42EB0.97D01B8A@u.arizona.edu...
> > This is in response to a message in povray.general by Mick Hazelgrove
> > about realistic clouds.  This was originally intended to be part of an
> > entry of mine for the IRTC, but I stopped working on it when I got
> > sidetracked by other projects.  It's still quite rough (for instance,
> > bottoms of the clouds suck, but I think that I know how to fix that) and
> > I had intended to add more cloud layers, but it still may be useful.
> > Megapov was required to render this image.  The bottom of the image is
> > black because the ocean that goes there was commented out to improve
> > rendering time.
> >
>
> ----------------------------------------------------------------------------
> ----


Post a reply to this message

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