POV-Ray : Newsgroups : povray.advanced-users : Fake shadows in 32-bit images? : Re: Fake shadows in 32-bit images? Server Time
24 Apr 2024 14:41:44 EDT (-0400)
  Re: Fake shadows in 32-bit images?  
From: Kenneth
Date: 27 Aug 2021 20:45:00
Message: <web.612985ef7599ad524cef624e6e066e29@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
>
> ... a quick and dirty cheat like this works:
>
> Take your object(s) and put all of the parts in a merge.
> Define a vector location LS for your light source.
> Define a second vector location LS2 that is -vnormalize(LS) so that it is
> mirrored across the origin.
> Define a matrix transform with LS2 as your new y basis vector.
> Put your object in the scene with the no_shadow keyword.
>
> Put your object in the scene again, apply the matrix transform, and scale it
> really small in the y direction, and apply your semi-transparent texture
> to it.
> [code]

> > I also added some zeros to the y scale of the "shadow" to remove an
> > artifact at Bald Eagle's nice solution.
> > > [Norbert Kern's follow-up code]
>
> Thanks Norbert,
>
> I actually had quite a few zeros and removed them because I had an issue with
> the "shadow" even showing up.
>
> I am curious about the artifact (was that at the connection of the sphere and
> cylinder?  That's why I switched from union {} to merge {}, to minimize that).
>

Playing with both versions of this interesting 'fake shadows' code... and
changing the mentioned y-scale to 0.001 (less zeros)...I see the strange
artifacts, which occur whether a union OR merge is used. I think the
semi-transparent texture of the 'matrix object' is *partly* to blame...
     pigment{rgbt <0,0,0,.5>}
.... as it naturally shows the various object surfaces where they interconnect.
But I'm mostly curious as to just what the additional y-SCALING is for, and why
it solves the problem-- and why it is SO sensitive to the particular tiny scale
that is used (the number of zeros). I'm obviously not grasping why y needs any
scaling at all.

From experimenting, a y-scale of simply 1.0 shifts the matrix-object to a
completely different orientation(!), which I don't understand. And a y-scale of
0.000001 makes the object disappear, as mentioned. I would have assumed that the
matrix transform *by itself* would have been enough to shear the 'shadow object'
correctly, in concert with the -vnormalize(...) trick-- no additional scaling
required.


Post a reply to this message

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