POV-Ray : Newsgroups : povray.general : Problems with media density : Re: Problems with media density Server Time
30 Jul 2024 02:27:42 EDT (-0400)
  Re: Problems with media density  
From: Kenneth
Date: 18 Jan 2010 02:20:07
Message: <web.4b540a8a66d8840b65f302820@news.povray.org>
"Reactor" <rea### [at] hotmailcom> wrote:
> David Given <dg### [at] cowlarkcom> wrote:
>
> > Are there any gotchas involved in unioning two hollow objects with media
> > together? Changing the atmosphere sampling method to 1 or 2 makes the
> > clouds look *really* weird, which is not what I was expecting.
> >
>
>
> The gotcha is a bug that can inappropriately reuse the sample settings for two
> medias in an object.  I don't know the exact details of it, I just know that
> it can sometimes show up.
>

Yeah, there is some non-intuitive behavior going on (although I don't think it
has much if anything to do with the union itself.) Once this behavior is
understood, though, it can be dealt with relatively easily. As Alain has
mentioned, the first sphere that the camera sees (with its particular samples
count) is the one that sets the samples value for any other media spheres
contained inside it--even if those spheres are given completely different
samples counts. Personally, I've always wondered if this is a bug, or 'just the
way POV operates' with media and transparency.

Here's a somewhat more telling example, of two spheres that only partially
overlap:

camera{
....
location  <0, 0, -15>
look_at   <0, 0, 0>
....
}

sphere{0,1.5 // the larger sphere
....
media{
emission .1
method 3
//intervals 1 // the default
samples 5 // very low
}
....
}

and

sphere{0,1 // smaller than first sphere
....
media{
emission .1*<1,0,0>
method 3
//intervals 1
samples 100 // much higher than 1st sphere
}
....
translate 1.5*x // so that it's partly inside 1st sphere, and partly outside
}

The majority of this combination will show only 5 samples in the
media--including the part of the 2nd sphere contained inside the 1st; but the
part of the 2nd sphere which extends *outside* the 1st will show its own 100
samples. It all depends on where the camera is--i.e., which sphere it first sees
at a particular point. (If the 2nd smaller sphere is BEHIND the first sphere and
completely outside it, I don't know what happens; I haven't tried that
experiment. I suspect that both would show their correct samples.)

The *easiest* way out of this situation is to give each sphere the same samples
count. That would eliminate any surprises--especially during animation, if the
camera is moving around or through the spheres.

Ken


Post a reply to this message

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