POV-Ray : Newsgroups : povray.newusers : Rendering ONLY the shadow falling on the object (not the object itself) Server Time
4 Nov 2024 23:19:42 EST (-0500)
  Rendering ONLY the shadow falling on the object (not the object itself) (Message 1 to 6 of 6)  
From: Frantisek Fuka
Subject: Rendering ONLY the shadow falling on the object (not the object itself)
Date: 22 Nov 2002 17:01:49
Message: <3ddea94d@news.povray.org>
I tried rendering PNG images with transparency so that I can use them as 
a sprites in the game but I encountered the problem with shadows. Let's 
say my rendered figure looks like this (this is not the actual model I'm 
using):

http://www.fuxoft.cz/tmp/pig.png

That's great, I can use this as a sprite, but because in the game the 
sprite will be always moving on the flat ground, I'd also like the 
sprite to contain the shadow that it casts on the ground (preferably as 
alpha channel, so that the game background will be partly seen through 
it). But if I add some sort of ground, I get this:

http://www.fuxoft.cz/tmp/pig2.png

There are shadows but of course there's no longer any transparency, just 
white ground. And when I try to make the ground see-thru, the shadows 
disappear too... Can I somehow render the shadows but retain the 
background transparency???

Please note that this cannot be solved with "no_image" directive. I want 
to render object X (the figure) and the shadow that object X casts on 
object Y (the ground), but not object Y itself.

Thanks


Post a reply to this message

From: Johannes Dahlstrom
Subject: Re: Rendering ONLY the shadow falling on the object (not the object itself)
Date: 22 Nov 2002 17:19:04
Message: <3ddead58@news.povray.org>
Frantisek Fuka wrote:

> There are shadows but of course there's no longer any transparency, just
> white ground. And when I try to make the ground see-thru, the shadows
> disappear too... Can I somehow render the shadows but retain the
> background transparency???
>

Hmm... try using a white plane with brilliance 0, something like this:

plane {
  y, 0
  pigment { rgb 1 }
  finish { diffuse 1 brilliance 0 }
}

It should keep the shadows but get rid of the shading, the plane should be 
pure white wherever light hits it.


Post a reply to this message

From: Frantisek Fuka
Subject: Re: Rendering ONLY the shadow falling on the object (not the object itself)
Date: 22 Nov 2002 17:43:30
Message: <3ddeb312$1@news.povray.org>
Johannes Dahlstrom wrote:
> Frantisek Fuka wrote:
> 
> 
>>There are shadows but of course there's no longer any transparency, just
>>white ground. And when I try to make the ground see-thru, the shadows
>>disappear too... Can I somehow render the shadows but retain the
>>background transparency???
>>
> 
> 
> Hmm... try using a white plane with brilliance 0, something like this:
> 
> plane {
>   y, 0
>   pigment { rgb 1 }
>   finish { diffuse 1 brilliance 0 }
> }
> 
> It should keep the shadows but get rid of the shading, the plane should be 
> pure white wherever light hits it.

Yes, exactly, now everything around the sprites is pure white and there 
is no transparency anywhere. That's something different than I wanted.


Post a reply to this message

From: Christopher James Huff
Subject: Re: Rendering ONLY the shadow falling on the object (not the object itself)
Date: 22 Nov 2002 18:43:55
Message: <chrishuff-E33E0B.18421822112002@netplex.aussie.org>
I think you have a misunderstanding of what shadows are. A shadow is not 
an object, it is a lack of illumination on an object. You can't render a 
shadow without the object or media it was cast on.
What you could do is put the object with no_image on a plane with a 
perfectly white texture and a brilliance value of 0 to eliminate 
shading, and use a camera looking down from above. This will give you a 
shadow sprite, you might be able to use it directly or you might have to 
do some additional processing to put transparency information in an 
alpha channel. This new sprite goes horizontally at the base of the main 
sprite.

If you want it part of the main sprite, you will definitely need 
postprocessing to set the alpha of the shadow to something that works. 
As far as I know, there is no way to do this autmatically with real 
shadows, but you could put a partially transparent plane with a "spot 
shadow" texture below it.

-- 
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: Mark Wagner
Subject: Re: Rendering ONLY the shadow falling on the object (not the objectitself)
Date: 23 Nov 2002 00:33:06
Message: <pan.2002.11.23.05.31.57.721480.218@gte.net>
On Fri, 22 Nov 2002 17:42:36 -0500, Frantisek Fuka quoth:

> Johannes Dahlstrom wrote:
>> Frantisek Fuka wrote:
>> 
>> 
>>>There are shadows but of course there's no longer any transparency,
>>>just white ground. And when I try to make the ground see-thru, the
>>>shadows disappear too... Can I somehow render the shadows but retain
>>>the background transparency???
>>>
>>>
>>>
>> Hmm... try using a white plane with brilliance 0, something like this:
>> 
>> plane {
>>   y, 0
>>   pigment { rgb 1 }
>>   finish { diffuse 1 brilliance 0 }
>> }
>> 
>> It should keep the shadows but get rid of the shading, the plane should
>> be pure white wherever light hits it.
> 
> Yes, exactly, now everything around the sprites is pure white and there
> is no transparency anywhere. That's something different than I wanted.
 
It should be quite easy to use an image editor to put in the transparency
manually: open the image in a good image editor (such as Photoshop or the
GIMP), select the pure white area, and tell the editor to make the
selection transparent.

-- 
Mark


Post a reply to this message

From: Peter Popov
Subject: Re: Rendering ONLY the shadow falling on the object (not the object itself)
Date: 23 Nov 2002 03:24:49
Message: <0deutugv9tvr6v0cub2upcvcq3eu8h0hur@4ax.com>
1. As suggested, put a white plane behind your object. Give your
object no_image. Render. This will render just the shadow

2. In PhotoShop, for example, select the brightness as transparency
(the easiest way is to do this in PhotoShop is to duplicate any of the
r, g or b channels and make a selection out of it). Create a
transparent layer and fill it with black using that selection or,
alternatively, with the selection still active, create a solid color
fill layer. Delete the original layer. Now you have a shadow sprite,
too. Just save the image in the appropriate format and you're
finished.

Alternatively, you can use POV-Ray's output directly, without any
post-processing, but you'll have to use multiplicative multitexturing
in your 3D engine.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

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