POV-Ray : Newsgroups : povray.newusers : Creating soft shadows Server Time
25 Jan 2022 15:05:27 EST (-0500)
  Creating soft shadows (Message 1 to 9 of 9)  
From: TheRealMorris
Subject: Creating soft shadows
Date: 28 Nov 2021 07:45:00
Message: <web.61a378e94b3d98b5ffb1c8fe8bf7213@news.povray.org>
I've been playing around with some top-down scenes using an orthographic camera
and one of the things I've tried to achieve, are what I would call "soft
shadows". I've played around with multiple light sources, area lights, etc. but
no matter what I've done, my shadows look rather really hard; area lights seem
to help but the resulting shadow is devoid of any depth and just a bland shade
of gray with almost constant coloring.

The effect I'm trying to achieve is something like the image attached.

Does anybody have any idea how such an effect could be achieved?

Thank you


Post a reply to this message


Attachments:
Download 'flatsample.jpeg.jpg' (22 KB)

Preview of image 'flatsample.jpeg.jpg'
flatsample.jpeg.jpg


 

From: Bald Eagle
Subject: Re: Creating soft shadows
Date: 28 Nov 2021 10:25:00
Message: <web.61a39f02c6a4be141f9dae3025979125@news.povray.org>
"TheRealMorris" <nomail@nomail> wrote:
> I've been playing around with some top-down scenes using an orthographic camera
> and one of the things I've tried to achieve, are what I would call "soft
> shadows". I've played around with multiple light sources, area lights, etc. but
> no matter what I've done, my shadows look rather really hard; area lights seem
> to help but the resulting shadow is devoid of any depth and just a bland shade
> of gray with almost constant coloring.

Without seeing your render, knowing the type and placement of objects in your
scene, or knowing what your lighting, camera, and default block setting are,
it's hard to really suggest anything useful.
Maybe provide a small sample scene?

> The effect I'm trying to achieve is something like the image attached.

Is that - a cylinder or something?
(It's hard for me to tell)

I'd suggest that you use a sky_sphere to provide more overall ambient
illumination, maybe an area light to create penumbral shadows, and depending on
the exact effect you're trying to achieve, you might experiment with transmit,
no_object, and no_shadow keywords to create an invisible surrogate object to
filter the light rather than cast a hard shadow.


Post a reply to this message

From: TheRealMorris
Subject: Re: Creating soft shadows
Date: 28 Nov 2021 16:25:00
Message: <web.61a3f2c3c6a4be14ffb1c8fe8bf7213@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "TheRealMorris" <nomail@nomail> wrote:
> > I've been playing around with some top-down scenes using an orthographic camera
> > and one of the things I've tried to achieve, are what I would call "soft
> > shadows". I've played around with multiple light sources, area lights, etc. but
> > no matter what I've done, my shadows look rather really hard; area lights seem
> > to help but the resulting shadow is devoid of any depth and just a bland shade
> > of gray with almost constant coloring.
>
> Without seeing your render, knowing the type and placement of objects in your
> scene, or knowing what your lighting, camera, and default block setting are,
> it's hard to really suggest anything useful.
> Maybe provide a small sample scene?
>
> > The effect I'm trying to achieve is something like the image attached.
>
> Is that - a cylinder or something?
> (It's hard for me to tell)
>
> I'd suggest that you use a sky_sphere to provide more overall ambient
> illumination, maybe an area light to create penumbral shadows, and depending on
> the exact effect you're trying to achieve, you might experiment with transmit,
> no_object, and no_shadow keywords to create an invisible surrogate object to
> filter the light rather than cast a hard shadow.

Thank you for your tips, I will experiment and get back to you on this. I hope
to be able to do so this week, but due to before-Christmas madness, it may have
to wait until the next weekend.


Post a reply to this message

From: Kenneth
Subject: Re: Creating soft shadows
Date: 2 Dec 2021 03:35:00
Message: <web.61a8841fc6a4be144cef624e6e066e29@news.povray.org>
"TheRealMorris" <nomail@nomail> wrote:
>
> I've been playing around with some top-down scenes using an orthographic
> camera and one of the things I've tried to achieve, are what I would
> call "soft shadows"...

I arrived at something that looks like your example by using a "parallel linear
area_light", which I had never tried before. I used a cylinder for the object,
half-buried in the main plane (specifically so that there are no 'shadowed
undercuts' between cylinder and plane-- which seems to improve the effect.) My
renders are top-down too, using an orthographic camera.

I have not done a detailed analysis of *how* the area_light actually works in
this situation-- but I think it is basically horizontal, hovering over the
object, and only 'one-dimensional' in z (the 'linear' aspect of the light, like
a long tube). The light's 'area' appears to be split more or less evenly behind
the object and in front of it (-z and +z)-- but I'm not sure. In any case, that
seems to be the key to getting this shadow effect.

The various values I used in the light are kind of extreme, but make the shadow
smooth and with a smooth gradation. Play around with the light's z-dimension
(and its z-translation) to see what happens; the thing to watch out for is the
light casting a partial shadow of the cylinder in the opposite direction-- which
should be avoided, of course!

I also tried this exact same set-up with a text{...} object-- which did not work
very well. I suspect that the light's z-dimension and translation need to be
changed, maybe radically.

-------
#version 3.8; // or whatever
global_settings{assumed_gamma 1.0}

camera {
  orthographic
  location  <.5, 5, .15>
  look_at   <.5, 0, .151>
  right     x*image_width/image_height
  direction z
  angle 17
}

light_source {
  <0,0,0>  // light's position (translated below)
  color rgb 6.0
  area_light
  <0, 0, 0> <0, 0, 30> // lights spread out across this distance (x * z)
  1, 33  // total number of lights in grid-- a 'linear' light
  adaptive 2 // ?
  jitter
 // circular // No!
 // orient // No!
  translate <0, .75, -12.5>
  parallel
  point_at -y // <0,-1,0>; or +z?  (<0,0,1>) ?
}

plane{y,0
texture{
 pigment{rgb 1}
 finish{ambient 0 emission 0 diffuse .8}
 }
}

cylinder{0,1*x,.03  // half-buried in plane
// OR...
/*
text{
    ttf "timrom.ttf" "POV-Ray"
    .2, 0
    scale .2*<1,.17,1>
    translate <0,0,0>
*/
texture{
 pigment{rgb .4*<0,1,1>}
 finish{ambient 1 emission 0 diffuse 0}
 }
//rotate 30*y
}


Post a reply to this message


Attachments:
Download 'parallel_area_light_shadow_exp.jpg' (60 KB)

Preview of image 'parallel_area_light_shadow_exp.jpg'
parallel_area_light_shadow_exp.jpg


 

From: Alain Martel
Subject: Re: Creating soft shadows
Date: 2 Dec 2021 10:13:57
Message: <61a8e2b5$1@news.povray.org>
Le 2021-12-02 à 03:30, Kenneth a écrit :
> "TheRealMorris" <nomail@nomail> wrote:
>>
>> I've been playing around with some top-down scenes using an orthographic
>> camera and one of the things I've tried to achieve, are what I would
>> call "soft shadows"...
> 
> I arrived at something that looks like your example by using a "parallel linear
> area_light", which I had never tried before. I used a cylinder for the object,
> half-buried in the main plane (specifically so that there are no 'shadowed
> undercuts' between cylinder and plane-- which seems to improve the effect.) My
> renders are top-down too, using an orthographic camera.
> 
> I have not done a detailed analysis of *how* the area_light actually works in
> this situation-- but I think it is basically horizontal, hovering over the
> object, and only 'one-dimensional' in z (the 'linear' aspect of the light, like
> a long tube). The light's 'area' appears to be split more or less evenly behind
> the object and in front of it (-z and +z)-- but I'm not sure. In any case, that
> seems to be the key to getting this shadow effect.
> 
> The various values I used in the light are kind of extreme, but make the shadow
> smooth and with a smooth gradation. Play around with the light's z-dimension
> (and its z-translation) to see what happens; the thing to watch out for is the
> light casting a partial shadow of the cylinder in the opposite direction-- which
> should be avoided, of course!
> 
> I also tried this exact same set-up with a text{...} object-- which did not work
> very well. I suspect that the light's z-dimension and translation need to be
> changed, maybe radically.
> 
> -------
> #version 3.8; // or whatever
> global_settings{assumed_gamma 1.0}
> 
> camera {
>    orthographic
>    location  <.5, 5, .15>
>    look_at   <.5, 0, .151>
>    right     x*image_width/image_height
>    direction z
>    angle 17
> }
> 
> light_source {
>    <0,0,0>  // light's position (translated below)
>    color rgb 6.0
>    area_light
>    <0, 0, 0> <0, 0, 30> // lights spread out across this distance (x * z)
>    1, 33  // total number of lights in grid-- a 'linear' light
>    adaptive 2 // ?
>    jitter
>   // circular // No!
>   // orient // No!
>    translate <0, .75, -12.5>
>    parallel
>    point_at -y // <0,-1,0>; or +z?  (<0,0,1>) ?
> }
> 
> plane{y,0
> texture{
>   pigment{rgb 1}
>   finish{ambient 0 emission 0 diffuse .8}
>   }
> }
> 
> cylinder{0,1*x,.03  // half-buried in plane
> // OR...
> /*
> text{
>      ttf "timrom.ttf" "POV-Ray"
>      .2, 0
>      scale .2*<1,.17,1>
>      translate <0,0,0>
> */
> texture{
>   pigment{rgb .4*<0,1,1>}
>   finish{ambient 1 emission 0 diffuse 0}
>   }
> //rotate 30*y
> }
> 
For the two cylinders, adaptive 1, or maybe even adaptive 0, would 
probably have been enough.
For the text object, it's not. You probably need to use adaptive 3 or 
even 4 to get a correct result.


Post a reply to this message

From: Kenneth
Subject: Re: Creating soft shadows
Date: 3 Dec 2021 16:20:00
Message: <web.61aa8940c6a4be144cef624e6e066e29@news.povray.org>
Alain Martel <kua### [at] videotronca> wrote:
>
> For the two cylinders, adaptive 1, or maybe even adaptive 0, would
> probably have been enough.
> For the text object, it's not. You probably need to use adaptive 3 or
> even 4 to get a correct result.

You're correct with both suggestions. And for the letters, I cranked up adaptive
to 5(!), which continued to make the letter shadows even smoother... but with a
slower render, of course.

But that's odd behavior, and does not agree with the documentation about
'adaptive': For my tests, I used a 'linear' light array of   1,33  which is
'only' 33 lights (1*31). According to the docs,
"The number of rays never exceeds the values you specify for rows and columns of
points."

So for 33 lights in my area_light, the maximum *useful* adaptive value should be
       adaptive 2  (5X5=25 rays)
But the adaptive mechanism is definitely still working at values of 3 through 5;
I did some visual 'difference' tests to confirm this-- and the render times get
slower as well.

I am currently running POV-ray v3.8.0 beta 1 in Windows, so the way 'adaptive'
works may have changed(?) at some point...or else there is something fundamental
about the doc's description of 'adaptive' that I still don't understand.


Post a reply to this message

From: Kenneth
Subject: Re: Creating soft shadows
Date: 3 Dec 2021 16:30:00
Message: <web.61aa8bc1c6a4be144cef624e6e066e29@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
>
> But that's odd behavior, and does not agree with the documentation about
> 'adaptive': For my tests, I used a 'linear' light array of   1,33  which is
> 'only' 33 lights (1*31).

Oops, (1*33), sorry.


Post a reply to this message

From: Alain Martel
Subject: Re: Creating soft shadows
Date: 4 Dec 2021 10:18:44
Message: <61ab86d4$1@news.povray.org>
Le 2021-12-03 à 16:16, Kenneth a écrit :
> Alain Martel <kua### [at] videotronca> wrote:
>>
>> For the two cylinders, adaptive 1, or maybe even adaptive 0, would
>> probably have been enough.
>> For the text object, it's not. You probably need to use adaptive 3 or
>> even 4 to get a correct result.
> 
> You're correct with both suggestions. And for the letters, I cranked up adaptive
> to 5(!), which continued to make the letter shadows even smoother... but with a
> slower render, of course.
> 
> But that's odd behavior, and does not agree with the documentation about
> 'adaptive': For my tests, I used a 'linear' light array of   1,33  which is
> 'only' 33 lights (1*31). According to the docs,
> "The number of rays never exceeds the values you specify for rows and columns of
> points."

It can't exceed the specified values in one direction. It's per 
direction, not total.
If the number of elements for the two directions are not the same, then, 
the initial sampling can be different.

> 
> So for 33 lights in my area_light, the maximum *useful* adaptive value should be
>         adaptive 2  (5X5=25 rays)

In your case, that's 1x5 rays when using adaptive 2. The number of 
samples in the U direction is limited to 1, while the number of samples 
in the V direction can reach up to 33.

> But the adaptive mechanism is definitely still working at values of 3 through 5;
> I did some visual 'difference' tests to confirm this-- and the render times get
> slower as well.
> 
> I am currently running POV-ray v3.8.0 beta 1 in Windows, so the way 'adaptive'
> works may have changed(?) at some point...or else there is something fundamental
> about the doc's description of 'adaptive' that I still don't understand.
> 
> 
> 
In your scene, the actual starting sampling are :
adaptive 0 : 1x2
adaptive 1 : 1x3
adaptive 2 : 1x5
adaptive 3 : 1x9
adaptive 4 : 1x17
adaptive 5 : 1x33


Post a reply to this message

From: Kenneth
Subject: Re: Creating soft shadows
Date: 4 Dec 2021 12:55:00
Message: <web.61aba8c4c6a4be144cef624e6e066e29@news.povray.org>
Alain Martel <kua### [at] videotronca> wrote:
> >
> > But that's odd behavior, and does not agree with the documentation about
> > 'adaptive': For my tests, I used a 'linear' light array of   1,33  which is
> > 'only' 33 lights (1*33). According to the docs,
> > "The number of rays never exceeds the values you specify for rows
> > and columns of points."
>
> It can't exceed the specified values in one direction. It's per
> direction, not total.
> If the number of elements for the two directions are not the same, then,
> the initial sampling can be different...
>

Thank you, Alain! That is a *very* useful and clear analysis of my 'adaptive'
results. I had a funny feeling that the 'linear' nature of my area_light was
responsible in some way.

For the OP:
My original code example was basically the result of trial-and-error, but I now
have a much clearer idea of how the parallel/linear combination works. I was
mainly confused about the point_at <...> value and what it does: I always
thought it was a vector direction, but it's actually a location in space.
The *combination* of the light's location and point_at is what determines the
parallel light's illumination direction. (The docs have always confused me about
this.) My light's 'area' is from <0,0,0> to <0,0,30>-- essentially a
one-dimensional 'line' from the origin out to z=30. (But the *center* of that is
at the origin, so it actually extends from -15*z to 15*z, before any
translations.) So I reset point_at to be <0,0,0> likewise, not z or -y, and the
resulting shadow direction is correct-- because the x-location is the same in
both cases.

A different example would be point_at <5,0,0>. But this would skew the shadow to
the right-- and look rather ugly and 'smudged'  as well--  because the light's
'area' is that line out from the origin at x=0, not x=5.

Anyway, here is a better code example. I flipped the text letters to be
horizontal. The result reminds me of an old-style movie title from the 1930's.

----------
#version 3.8; // or whatever
global_settings{assumed_gamma 1.0}
camera {
  orthographic
  location  <.35, 5, .1>
  look_at   <.35, 0, .1>
  right     x*image_width/image_height
  direction z
  angle 16
}

plane{y, 0
texture{
 pigment{rgb 1}
 finish{ambient .05 emission 0 diffuse .95}
 }
}

light_source{
<0, 0, 0>
color rgb 1.0
area_light
0*x  5*z
1, 33
adaptive 5
jitter
translate <0.0, 2.0, -2.5> // z is half of 'area' dimension
parallel
point_at <0, 0, 0>
rotate -30*y
}

text{
    ttf "timrom.ttf" "POV-Ray"
    .2, 0
    rotate 90*x
    scale <.25,1,.25>
    translate .2*y
texture{
 pigment{rgb .4*<0,1,1>}
 finish{ambient 1 emission 0 diffuse 0}
 }
rotate 20*y
}


Post a reply to this message


Attachments:
Download 'parallel_linear_area_light_letters_jpeg.jpg' (42 KB)

Preview of image 'parallel_linear_area_light_letters_jpeg.jpg'
parallel_linear_area_light_letters_jpeg.jpg


 

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