|
|
> How can I set the color, transparency and edge softness of the shadows.
Well, in POV-Ray, light is modeled in a mathematically correct way to
simulate reality. In order to change the appearance of shadows, you must
change the behavior of the light in the scene. If a shadow is "colored",
then what that really means is that there's colored light from a different
light source which is hitting the shadowed spot.
So, to "color" a shadow, you'll need multiple lights of different colors,
like this:
light_source {
<-1,1,-1>*999
rgb <1,.5,.5> // mostly red
}
light_source {
<1,1,-1>*999
rgb <.5,.5,1> // mostly blue
}
The blue light's shadows will be red and the red light's shadows will be
blue, simply because those are the colors of light reaching the respective
partially shadowed areas.
The transparency of a shadow is determined by the transparency of the object
that is creating the shadow. If an object is 50% transparent, then it will
block 50% of the light which causes the shadow to be only half as dark as
normal.
You may be looking for the "ambient" feature, which sets the ambient light
properties of an object. In other words, it lets you set the color of the
object in shadowed areas, and in nonshadowed areas this ambient color is
added to the light from the light source. To create an object with
completely black shadowed areas, use 0 ambient light:
sphere {
0,1
finish {ambient 0}
}
And to create an object with grey shadowed areas (and increased brightness
in non-shadowed areas), use:
finish {ambient 0.5}
Another option which gives more control over lighting is the "diffuse"
keyword which I won't get into here; check "3.4.3 Finish" in the
documentation for more.
The "edge softness" of shadows is determined by the light source itself. By
default light sources are single points in space which create perfectly
sharp shadows. To simulate softness, you must set up the light as an "area
light":
light {
<-1,1,-1>*9999
rgb 1
area_light
x, y, // two vectors which specify the 2D square area that the light takes
up
7, 7 // how many samples in each direction to create the softness?
adaptive 1 // only take a few samples and then additional ones only if it
appears that the samples are being taken in a shadowed area (speeds things
up) (optional)
circular // make the light's area a circle (optional)
orient // orient the light's area towards the point being sampled for shadow
(requires circular) (optional)
}
For more information and better explanation on area_lights, check "2.2.4.4
The Area Light Source" in the documentation.
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
|
|
|
Slime <fak### [at] emailaddress> wrote:
> Well, in POV-Ray, light is modeled in a mathematically correct way to
> simulate reality.
Technically that's hardly true.
Point lights do not exist in reality (a point light is infinitely
small - a mathematical point - and such light sources do not exist).
A point light in POV-Ray is an approximation of a small and distant light
source, not a mathematically correct exact simulation.
In real life all light sources are area ligths of one shape or another.
However, POV-Ray fails to simulate this in a mathematically exact way
as well (the reason being simply that it would be way too heavy, if not
impossible to do so). POV-Ray only approximates area lights in a way that
looks good enough in the final image.
In real life also all surfaces emit light as well (by reflecting light)
and thus act as light sources. While POV-Ray can approximate this with a
stochastic algorithm, that's also just an (often quite inaccurate)
approximation.
What you meant was that POV-Ray creates shadows by simulating real-life
light sources and does not "create shadows" which exist on their own
independent of any light source (like most scanline renderers do). Thus
the look of shadows are always defined by the light source causing these
shadows, and a shadow itself is not any primitive or entity you could
handle in POV-Ray.
--
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -
Post a reply to this message
|
|