POV-Ray : Newsgroups : povray.newusers : Shadows : Re: Shadows Server Time
30 Jul 2024 06:25:37 EDT (-0400)
  Re: Shadows  
From: Slime
Date: 24 Aug 2004 22:41:14
Message: <412bfc4a@news.povray.org>
> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.