POV-Ray : Newsgroups : povray.advanced-users : alpha shadow : Re: alpha shadow Server Time
28 Jul 2024 14:33:58 EDT (-0400)
  Re: alpha shadow  
From: Mike Williams
Date: 16 Feb 2005 10:33:54
Message: <cBw0fBAvd2ECFwQQ@econym.demon.co.uk>
Wasn't it Elias Pschernig who wrote:
>Hm, hard to explain.. basically, I'm trying to create a transparent picture,
>which contains a shadow. The scene is just an object, which casts a shadow
>to the (invisibe) floor. The object should be fully opaque in the output
>(except anti-aliasing at the edge), and the shadow should be translucent
>(and have a soft edge). Now - I tried around a bit with no_image and
>no_shadow, but no success so far. The closest I could get was to use a
>translucent plane, and cast the shadow onto it - but then the result will
>nowhere be fully transparent.
>
>Any hints?

I have a tutorial for something similar but with a hard edged shadow.

<http://www.econym.demon.co.uk/shadowtut/index.htm>

I suggest you experiment with that first, before reading on. The rest of
this post won't make much sense until after you've read that page.


To get soft shadows, you have to use an area light when creating the
shadow, but you will need to reduce the brightness of the light to the
lowest value that gives pure white in all the illuminated areas,
otherwise the soft shadows don't look too good. In my scene a value of
rgb 2 worked, but it can be different depending on things like the
position of the light source.

Then you have to convert the shadow image to 256-colour gif rather than
2-colour. But now there are 256 possibilities for the palette number of
pure white, and you have to use a palette editor to find it. In my case
the palette number was 230, but I guess it could be anything depending
on what software you used to convert it to gif.

Then, in the final render, use 

   pigment {image_map {gif "shadow2.gif" once 
       transmit all 0.3   // dark bits partially transparent 
       transmit 230,1     // bright bits become 100% transparent
     }

[replace "230" by whatever palette number you found]

this sets all the colours other than white to be partially transparent,
and the white bits to be invisible.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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