POV-Ray : Newsgroups : povray.advanced-users : shadow on transparent background Server Time
29 Jul 2024 06:24:08 EDT (-0400)
  shadow on transparent background (Message 1 to 8 of 8)  
From: Alex Kluchikov
Subject: shadow on transparent background
Date: 21 Dec 2002 18:41:24
Message: <1103_1040514049@news.povray.org>
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?

Alex Kluchikov
mailto:klk### [at] ukrnet


Post a reply to this message

From: Slime
Subject: Re: shadow on transparent background
Date: 21 Dec 2002 22:31:21
Message: <3e053209@news.povray.org>
This would be easily solved if POV-Ray supported a "shadow function" of some
sort.

Hmm... maybe if I ever get back to working on Slime-POV...

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: Mike Williams
Subject: Re: shadow on transparent background
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

From: klk
Subject: Re: shadow on transparent background
Date: 22 Dec 2002 10:10:10
Message: <web.3e05d4e2bffd917455d8c1ab0@news.povray.org>
Mike Williams wrote:
--skip--
>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.
--skip--
>Mike Williams
>Gentleman of Leisure

 Ok. My method is almost the same. But DO we need two stages of rendering?
I'm not too lazy, but I'd like to render scene once... But maybe two-staged
render os the only possible way. :(

Bye.
Yours KLK aka Alex Kluchikov


Post a reply to this message

From: Warp
Subject: Re: shadow on transparent background
Date: 27 Dec 2002 14:58:57
Message: <3e0cb100@news.povray.org>
Alex Kluchikov <klk### [at] ukrnet> wrote:
>  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 thought about this same thing myself as well: How to create
a semi-transparent shadow of an object, which is projected onto the surface
of an invisible object (eg. a plane)?
  There doesn't seem to be any viable and easy solution currently.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Christopher James Huff
Subject: Re: shadow on transparent background
Date: 27 Dec 2002 18:26:27
Message: <chrishuff-F870B5.18215127122002@netplex.aussie.org>
In article <3e0cb100@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   I have thought about this same thing myself as well: How to create
> a semi-transparent shadow of an object, which is projected onto the surface
> of an invisible object (eg. a plane)?
>   There doesn't seem to be any viable and easy solution currently.

Well, the problem is that a shadow is the absence of light on a surface, 
not a "thing".
You could do something like an object whose transparency at a point is 
dependant on how brightly lit that point is. You might want to ignore 
any intersections with it after the first one. I don't think this would 
be very useful...

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Warp
Subject: Re: shadow on transparent background
Date: 28 Dec 2002 04:26:20
Message: <3e0d6e3b@news.povray.org>
Christopher James Huff <chr### [at] maccom> wrote:
> Well, the problem is that a shadow is the absence of light on a surface, 
> not a "thing".

  Perhaps a patch could be made for this purpose. It wouldn't be realistic,
but it could be used for this special effect. It certainly has its uses.
It would be like an advanced drop shadow effect (like the one in most
image manipulation programs, but a lot more advanced in the sense that
the shadow can be "dropped" onto any (invisible) surface, not just
a plane facing the camera, like in the image manipulation programs).
This in conjunction with area lights would make very good effects for
transparent pngs.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Mike Williams
Subject: Re: shadow on transparent background
Date: 2 Jan 2003 15:35:12
Message: <0R6KrHA0JKF+EwuV@econym.demon.co.uk>
Wasn't it Warp who wrote:
>  I have thought about this same thing myself as well: How to create
>a semi-transparent shadow of an object, which is projected onto the surface
>of an invisible object (eg. a plane)?
>  There doesn't seem to be any viable and easy solution currently.

It's not all that difficult to do with the official version of POV. 
It just needs two passes.

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

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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