|
|
Here are some examples of making luminous spheres. There are two
different spheres using media, and a third one using a light source
inside a transparent sphere.
The red one on the left is a sphere with a simple spherical density,
varying from 0(Black) at the edges straight to 1(White) at the center.
The yellow one in the middle is similar to the red one, but the density
goes to 1 half of the way to the center, so the ball has a more solid
look.
The green one on the right is the only one which emits light. It is a
green light source inside a clear sphere with a specular highlight. The
glow effect is because the highlight is aligned perfectly with the
camera. This can be faster rendering than the media, and doesn't have
any problems with grainyness, but isn't as flexible as media. You could
make the others emit light by adding a light source to them.
Notice that in the media spheres there is an absorption media in
addition to the emission media. It's color is the "opposite" of the
emitting media. The purpose of this is to make the media more visible
against a background.
There are also some sampling parameters which may have to be adjusted
with some scenes, they aren't needed for this demo.
Also, if you want an actual sphere with the media effect around it, just
scale one of these spheres to be larger than your sphere and place the
media sphere so it surrounds the other sphere.
#include "colors.inc"
#version 3.1;
//-------------------------------------------
camera {
location < 0, 2.5, -8 >*2
angle 25
look_at < 0, 0, 0>
}
plane {y,0 pigment {checker color Black color White}}
//-------------------------------------------
sphere {< 0, 0, 0>, 1
pigment {color White filter 1}
hollow
interior {
media {
emission color rgb < 1, 0, 0>
absorption color rgb 1-< 1, 0, 0>
density {spherical
color_map {
[0 color Black]
[1 color White]
}
}
}
}
translate <-2, 1, 0>
}
sphere {< 0, 0, 0>, 1
pigment {color White filter 1}
hollow
interior {
media {
emission color rgb < 1, 1, 0>
absorption color rgb < 0, 0, 1>
density {spherical
color_map {
[0 color Black]
[0.5 color White]
[1 color White]
}
}
}
}
translate y*2
}
union {
sphere {< 0, 0, 0>, 1
pigment {color White filter 1}
finish {specular 1}
}
light_source { < 0, 0, 0 > color Green fade_distance 5 fade_power 2}
translate < 2, 1, 0>
}
Post a reply to this message
|
|