POV-Ray : Newsgroups : povray.binaries.images : Real Clouds with Real Problems : Re: Real Clouds with Real Problems Server Time
4 Nov 2024 13:59:24 EST (-0500)
  Re: Real Clouds with Real Problems  
From: Abe
Date: 29 Mar 2008 12:15:01
Message: <web.47ee768991cbe459810d540e0@news.povray.org>
"Kirk Andrews" <kir### [at] tektonartcom> wrote:
> So I'm continuing on my acquaintance with media.  I have this scene where I have
> a large sphere with sparse media which acts as atmosphere.  Then, I add an oval
> which contains much denser media in order to make a cloud (which is within the
> large sphere, of course).  I'm happy with the results of either media when used
> independently, but in this picture you can clearly see the outline of the oval,
> as if the oval cancels the other media with its own.  Can someone help me with
> this?
>
> My current solution is to define everything as a function, and then simply add
> the functions together and just have one object with a complicated media
> definition.  This works, but with the downside that I have to used more samples
> on *everything* rather than just on the clouds which need the greater
> definition.  This slows the render considerably.
>
> (The samples are not turned up very high in this render, by the way)

Nice image.

I have been dealing with the same issue for several years (as I suspect have
many others).

The problem is, roughly, as you described it: minimize the number of samples
where the media density/lighting is uniform and concentrate the sampling where
the media density/lighting is variable. (N.B. You used the expression "sparse
media" which I interpret to mean low density. While a low density can minimize
the visual impact of sampling artifacts, it is actually the instance of a
constant density v. a variable density which allow for an acceptably fewer
number of samples.)

Media parameters allow for the direct control of the number of samples, but not
the sample spacing. Generally speaking, sample spacing is indirectly controlled
by the size of the media container in conjunction with the number of samples.
This is where the idea for using separate and differently sized media
containers for atmosphere and clouds comes in. Unfortunately, as we know,
intersecting media containers become visible in the participating media. I am
guessing it might have to do with additional samples which are initiated when
the ray intersects the additional media containers and/or the manner in which
the sample "results" are combined.

One workaround is as you described it: put everything in one container and use
functions to control the different densities. Another solution (one which I
prefer) is to make a spherical shell for the cloud container, something like

//Camera is located at <0,0,0> "ground level"
#declare cloud_base_altitude=10;
#declare cloud_depth=1;
#declare cloud_shell_radius=1000;

#declare cloud_shell=
difference{
  sphere{<0,0,0>, cloud_shell_radius+cloud_depth}
  sphere{<0,0,0>, cloud_shell_radius}
  hollow
  pigment{color rgbt 1}
  translate -y*(cloud_shell_radius-cloud_base_altitude)
}

The spherical shell container creates another issue. The distance that the ray
travels when it traverses the shell near the horizon is much longer than when
it traverses the shell directly overhead. In other words, that sampling density
is generally higher overhead and lower at the horizon. Also the orientation of
the sampling ray to the media (cloud) pattern changes. This often manifests
itself in choppy or shelf like artifacts in the clouds near the horizon. In
order to address _that_ issue, I've been moderately successful in defining a y
oriented cylindrical based pigment pattern which transitions from a high
contrast cloud pattern directly overhead through progressively lower contrasts,
to a uniform media at the horizon. This also seems take advantage of the method
3 sub sampling which will increase near the horizon where you need it.

Anyway, if you're a povray diehard like me, keep it up. You'll come up with a
solution which will work for you. Otherwise Terragen 2 is looking pretty good.
:-)

Abe

Afterthought: I realize that I've used the word "density" in both its general
sense and its SDL sense. I hope it's not too confusing the way I've phrased
things.


Post a reply to this message

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