POV-Ray : Newsgroups : povray.newusers : Shadows Server Time
30 Jul 2024 04:21:16 EDT (-0400)
  Shadows (Message 1 to 4 of 4)  
From: Ramanan M G
Subject: Shadows
Date: 24 Aug 2004 21:31:59
Message: <412bec0f@news.povray.org>
How can I set the color, transparency and edge softness of the shadows. Is
there any statement like shadows {}?
Any advice will be appreciated.


Post a reply to this message

From: Jim Charter
Subject: Re: Shadows
Date: 24 Aug 2004 22:29:56
Message: <412bf9a4$1@news.povray.org>
Ramanan.M.G wrote:
> How can I set the color, transparency and edge softness of the shadows. Is
> there any statement like shadows {}?
> Any advice will be appreciated.
> 
> 
No.  These effects are controlled from the light sources.  You can 
consult the manual for details or even just experiment with diffrent 
light source examples from the insert menu.  Also the light effects in 
shadowed areas are manipulated with radiosity but you should learn what 
can be done with light sources first.


Post a reply to this message

From: Slime
Subject: Re: Shadows
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

From: Warp
Subject: Re: Shadows
Date: 25 Aug 2004 04:13:58
Message: <412c4a46@news.povray.org>
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

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