POV-Ray : Newsgroups : povray.general : Shadows without Objects : Re: Shadows without Objects Server Time
12 Aug 2024 11:21:43 EDT (-0400)
  Re: Shadows without Objects  
From: Thorsten Froehlich
Date: 15 Feb 1999 19:33:52
Message: <36c8bcf0.0@news.povray.org>
In article <36C87745.5713B049@snafu.de> , "Lars W." <lar### [at] snafude>
wrote:

> I am trying to combine real Images, and POV-Images, and for that i need
> to know
> how to create Objects, that make shadows, but are not seen, i mean they
> must be
> 100 % transparent, but the shadows must be dark.
>
> Does anybody know if such things are possible with POV-Ray ?
> or maybe knows some alternatives ?

Yes, there is a trick. Combining the filter and transmit color components
will do it. Then make sure you render _with_ alpha channel to a format that
supports alpha channels (e.g. PNG). All you need now is a program that can
use this alpha channel to mix the two images (Photoshop and some shareware
programs can do it).
Now here is the sample:

// *****************

camera
{
  location  <0.0, 0.5, -4.0>
  direction 1.5*z
  right     4/3*x
  look_at   <0.0, 0.0,  0.0>
}

// you need skysphere not background
sky_sphere
{
  pigment
  {
    color blue 1.0
  }
}

// some light
light_source
{
  <-30, 30, -30>
  color rgb 1.0
}

plane { y, -1 pigment { color green 1.0 } }

// the object
sphere { 0.0, 1 texture { pigment { color rgb 1.0 } } }

// the "hole", just a bit larger than the original object
sphere { 0.0, 1.0001 texture { pigment { color filter 0.0 transmit 1.0 } } }

// *****************

So all you need to do is to create the object twice. Make one (the second
one in the example above) of them a bit larger and set its texture to
"texture { pigment { color filter 0.0 transmit 1.0 } }". Note that just
"color filter 0.0 transmit 1.0" (the direct color option) won't work, you
need a complete texture. The filter makes the object invisible and the
transmit make the "hole" in the alpha channel.
In the example the first object creates the shadow and when you render with
preview you won't see a difference (except on Macs where you can see the
alpha channle during rendering).


    Thorsten


Post a reply to this message

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