POV-Ray : Newsgroups : povray.advanced-users : shadow on transparent background : Re: shadow on transparent background Server Time
29 Jul 2024 04:26:47 EDT (-0400)
  Re: shadow on transparent background  
From: Mike Williams
Date: 22 Dec 2002 04:17:03
Message: <3jOqnGA2KYB+EwM2@econym.demon.co.uk>
Wasn't it Alex Kluchikov who wrote:
> I used POV-Ray to make a character moving over some video background. It was 
>simple to render it  into tga files each frame with alpha channel and import 
>into Adobe Premiere as 
>numdered stills. And when I placed my character into 2d scene I discovered a 
>PROBLEM - it has no shadow! May be anybody did the same and solved the problem?
>
> I have only one idea - to render character without shadow but with alpha 
>channel in first sequence, and shadow without object in second, and then use 
>images of second sequence as 
>alpha chanel of completely black image. But this method first: needs 2 render 
>stages, second: sutable only for shadows on planes (because more complex 
>surfaces will produce 
>shadows too).
>
> So, we have a problem - to get image of our object and it's shadow and nothing 
>else at all. Is there a better way to do this, than mine?

Have you tried applying the "no_shadow" keyword in your shadow rendering
pass to the complex surface that you want to cast the shadow onto? That
might prevent it casting self shadows, but you probably need to ensure
that all parts of the surface that are visible from your camera position
are illuminated.

My usual method for this sort of thing is to do two renders, the first
one is for the shadows and has special lighting. The shadows are
rendered without alpha, but with very bright lighting (I use rgb 10) so
that the surface onto which the shadows are cast becomes 100% white
where it is illuminated. All the objects are no_image.

I then use a second POV render stage, with normal intensity lighting, to
render the objects and cast the shadow image map onto the background by
using a two-colour gif image with transmit palette specifiers that makes
the white bits invisible and the dark bits partially transparent,
something like. 

 object { Background
   pigment {image_map {gif "shadow2.gif" once 
   transmit 1,1    // bright bits become 100% transparent
   transmit 0,0.8  // dark bits partially transparent
   }
 rotate x*90
 translate <-5,0,-5>
 }

The thing about two-colour gif images is that it should be easy to know
which palette numbers correspond to your two colours. If you want soft
shadows, I think you may need to have 256 transmit palette entries.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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