|
![](/i/fill.gif) |
In article <nk9psvcnts17omiukiqjcc3541mht4ag7e@4ax.com>,
Erhard Ducke <duc### [at] gentlemansclub de> wrote:
> I wonder whether the density can be modified to drop logarithmical, not
> linear, this would give even a better effect...
Difficult with the spherical pattern, it would be easiest with a
function pattern. For inverse-square falloff:
density {function {1/pow(f_r(x, y, z), 2)}}
Or what I've seen called "gaussian" falloff:
function {exp(-f_r(x, y, z))}
However, note that inverse-square will reach 1 at a distance of 1, and
shoot up towards infinity at r = 0. The values outside the [0, 1] range
will get wrapped around. There are several ways to get around this...for
example, you could scale the pattern values down and clip them to the
[0, 1] range in the function, then specify a brighter than 1 color for
the white in the color map to bring the density back up. Or you could
use a different falloff function, such as the one used for distance
falloff in POV-Ray's light sources. The gaussian function won't have
this problem.
Also, neither inverse-square nor gaussial falloff will ever reach zero.
If you just want a smooth falloff with a finite radius, you might want
to try cosine falloff:
function {cos(min(1, f_r(x, y, z))*pi)/2 + 0.5}
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tag povray org
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |