|
|
Le 16-01-07 17:01, Mike Horvath a écrit :
> I'm confused about how to set up a spherical density map.
>
> I want a density map that is dense at the origin, and stays dense until
> it gets close to 1 unit away, then fall off sharply.
>
> How would I set this up?
>
> Thanks.
>
>
> Mike
Knowing that the spherical evaluate to 1 at <0,0,0> and drop to zero at
radius 1.
Like this:
density {
spherical
color_map {
[0 rgb 0]
[0.8 rgb 10]
}
}
This gives full density for 80% of the radius, that will sharply drop to
zero in the last 20% of the radius.
You don't need to drop to zero before the pattern actualy drop to zero,
so, using 0.05 as a controll value is just wastefull.
Using two densities and averaging them don't offer any real advantage
and take about twice as long to render. You need to evaluate both
density, add them and divide the result.
The patterns cylindrical, planar and boxed work the same.
cylindrical evaluate to 1 along the Y axis and drop to zero at radius 1.
planar evaluate at 1 on the X-Z plane and drop to zero at -1 and +1.
boxed conform to box{-1, 1} with a value of zero at the surface.
I can't recoment to ever use stdinc.inc. It include a large number of
other inc files that you may not need. In Norbert's example, NOT a
single bit from those includes are ever used.
Alain
Post a reply to this message
|
|