POV-Ray : Newsgroups : povray.newusers : Creating soft shadows : Re: Creating soft shadows Server Time 5 Aug 2024 02:17:45 EDT (-0400)
 From: Kenneth Date: 4 Dec 2021 12:55:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.61aba8c4c6a4be144cef624e6e066e29%40news.povray.org",
"dateCreated": "2021-12-04T17:55:00+00:00",
"datePublished": "2021-12-04T17:55:00+00:00",
"author": {
"@type": "Person",
"name": "Kenneth"
}
}
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
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
}
```

Attachments: