|
|
Mike Horvath <mik### [at] gmailcom> wrote:
> 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
Here is a test scene you can play with.
Personally I use two density maps to be more flexible.
Of course one map would be sufficient...
///////////////////////////////////////////////////////////
#version 3.7;
global_settings {
assumed_gamma 1
max_trace_level 5
noise_generator 2
}
#include "stdinc.inc"
#declare cam_loc = <0,0,-8>;
#declare lookat = <0,0,0>;
camera {
location cam_loc
look_at lookat
right x*image_width/image_height
up y
angle 15*image_width/image_height
}
#macro Dens (glowcol)
#declare density_1 =
density {
spherical
color_map {
[0.05 rgb 0]
[0.15 rgb glowcol]
}
}
#declare density_2 =
density {
spherical
color_map {
[0.05 rgb 0]
[0.7 rgb glowcol]
}
}
density {
average
density_map {
[1 density_1]
[1 density_2]
}
}
#end
#declare Color_ = <1,0.8,0.3>;
sphere {
<0,0,0>, 2
hollow
pigment {color rgbt 1}
interior {
media {
emission rgb 1
Dens (Color_)
}
}
scale 1
translate 0
}
////////////////////////////////////////////////
Norbert
Post a reply to this message
|
|