POV-Ray : Newsgroups : povray.advanced-users : Transparent plane with non-transparent shadows? Server Time
29 Jul 2024 20:18:08 EDT (-0400)
  Transparent plane with non-transparent shadows? (Message 6 to 15 of 15)  
<<< Previous 5 Messages Goto Initial 10 Messages
From: Mick Hazelgrove
Subject: Re: Transparent plane with non-transparent shadows?
Date: 7 Dec 2001 11:25:23
Message: <3c10ed73@news.povray.org>
Just an untried suggestion that will need some tweaking. Render the pic with
a white plane so the shadow is cast and use this as a material map,
pigment_pattern,  or image_pattern making the white part transparent and the
black whatever you want.

Mick


 "Warp" <war### [at] tagpovrayorg> wrote in message
news:3c10e814@news.povray.org...
> Anders K. <and### [at] f2scom> wrote:
> : Any other ideas, anyone?
>
>   Thinking about how the raytracing/lighting algorithms used in povray
work,
> I have the feeling that it's not possible.
>   A shadow is just a non-lit part of the pigment of a surface. This means
that
> the light source does not contribute to lightening up that part of the
surface
> pigment. That is, the pigment just gets darker.
>   If there's no pigment to show, there can't be a darkening of this
pigment
> either.
>
>   It might be possible using other methods than lighting calculations. It
may
> be possible to make a copy of the object and apply a proper
semi-transparent
> black pigment to it. Then this object is skewed and scaled properly so
that
> it looks like projected onto the plane. This way you would have an actual
> object which looks like the shadow of the original object.
>   I'm not sure yet of the exact transformations needed for this "shadow"
> object.
>
> --
> #macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
> rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
> ],13),8)-3,10>#end blob{N(array[6]{11117333955,
> 7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: bob h
Subject: Re: Transparent plane with non-transparent shadows?
Date: 7 Dec 2001 11:54:01
Message: <3c10f429@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3c10b516@news.povray.org...
> bob h <omn### [at] charternet> wrote:
> : Maybe  no_image  is all you need to put in the plane.
>
>   If you don't see the plane, you don't see the shadow cast onto it
either...

You might have misunderstood the idea, or maybe I did.  If it's about using
a transparent object to cast a shadow onto a nontransparent object then the
following should do okay.

camera {
  location  -100*z
        orthographic
  right x*image_width/image_height
  look_at   0
}

box {
  -<image_width,image_height,0>/2,<image_width,image_height,50>/2
  pigment {rgb <0,1,0>}
  finish {ambient .25 diffuse .75}
}

#declare Icons=
box {
  -<image_width,image_height,0>/2,<image_width,image_height,0>/2
  pigment {image_map {"shadows" map_type 0 once transmit 24, 1}
        translate <-.5,-.5,0> scale <image_width,image_height,1>
  }
  finish {ambient 1 diffuse 0}
  translate <0,0,-2>
}

//union {
light_source {
  0,
  1.5
  area_light <150,0,0>,<0,150,0>,4,4 jitter
  translate -1000*z
  rotate <45,45,0>
}

object {Icons no_image}

This is how I made the drop-shadow for my desktop icons which were imaged by
screen capture first then the solid background color made transparent.
I was also thinking this could be done with the "tiny scaled and near light"
trick to leave the actual object out of view.
The other way the concept could be interpreted is for the object where the
shadow falls across to be transparent yet still show that shadow on it.
Thinking maybe this is what got conveyed but having read the original
message again it sounds more like what I first thought.
--
text{ttf"arial","bob h",.1,0pigment{rgb 9}translate<-1,-.2,3>}


Post a reply to this message

From: Trevor Quayle
Subject: Re: Transparent plane with non-transparent shadows?
Date: 7 Dec 2001 12:03:30
Message: <3c10f662$1@news.povray.org>
"bob h" <omn### [at] charternet> wrote in message
news:3c10f429@news.povray.org...
> "Warp" <war### [at] tagpovrayorg> wrote in message
> news:3c10b516@news.povray.org...
> > bob h <omn### [at] charternet> wrote:
> > : Maybe  no_image  is all you need to put in the plane.
> >
> >   If you don't see the plane, you don't see the shadow cast onto it
> either...
>
> You might have misunderstood the idea, or maybe I did.  If it's about
using
> a transparent object to cast a shadow onto a nontransparent object then
the
> following should do okay.

No, I think he wants a plane (say in mid air) upon which shadows are cast
and are visible, but where there is no shdow, is completely transparent.

-tgq


Post a reply to this message

From: bob h
Subject: Re: Transparent plane with non-transparent shadows?
Date: 7 Dec 2001 12:10:16
Message: <3c10f7f8@news.povray.org>
Ooops.  Yes, having now read the other message by Anders I see how he's
wanting it to be.  Sorry.
--
text{ttf"arial","bob h",.1,0pigment{rgb 9}translate<-1,-.2,3>}

"Trevor Quayle" <Tin### [at] hotmailcom> wrote in message
news:3c10f662$1@news.povray.org...
>
> No, I think he wants a plane (say in mid air) upon which shadows are cast
> and are visible, but where there is no shdow, is completely transparent.


Post a reply to this message

From: Anders K 
Subject: Re: Transparent plane with non-transparent shadows?
Date: 7 Dec 2001 19:01:19
Message: <3c11584f$1@news.povray.org>
>   Thinking about how the raytracing/lighting algorithms used in povray
work,
> I have the feeling that it's not possible.

Yeah, I was afraid that would be the case...

Although I realized it might be possible if transmit/filter could be
included in a light's color, not just rgb. Then you could "shine" the
transparency onto the plane. Of course, this makes no sense physically, but
it could still be useful.

>   It might be possible using other methods than lighting calculations. It
may
> be possible to make a copy of the object and apply a proper
semi-transparent
> black pigment to it. Then this object is skewed and scaled properly so
that
> it looks like projected onto the plane. This way you would have an actual
> object which looks like the shadow of the original object.

This is an interesting idea -- I'll try it. Do you think that by making
several semi-transparent copies scaled in the right way, you could simulate
an area light?


Post a reply to this message

From: Warp
Subject: Re: Transparent plane with non-transparent shadows?
Date: 7 Dec 2001 19:15:22
Message: <3c115b99@news.povray.org>
Anders K. <and### [at] f2scom> wrote:
: Do you think that by making
: several semi-transparent copies scaled in the right way, you could simulate
: an area light?

  Perhaps. If you succeed in getting something, please report here. It would
be interesting to know.

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


Post a reply to this message

From: Mike Williams
Subject: Re: Transparent plane with non-transparent shadows?
Date: 8 Dec 2001 13:27:22
Message: <VIsSNCArpjE8Ew70@econym.demon.co.uk>
Wasn't it Anders K. who wrote:
>Is it possible to create a plane that is transparent in the light but
>becomes slightly non-transparent in shadow? I know this isn't physically
>accurate, but I'm basically trying to create a transparent image that casts
>a shadow on its background. I'm using version 3.5 beta.

Here's my attempt at the task. It nearly works. The process requires two
scene files to be rendered, the first one creates the shadows and the
second one puts them into the scene. I include three scenes here. 

The first one is the scene with ordinary shadows.

The second one is an orthographic view of the scene with all the objects
set no_image, and the lights turned up. Convert the output of this scene
into a GIF (or other paletted image format) and take a note of the
correspondence between palette numbers and colours.

The third scene creates the final image.

// one ---------------------------------------------------

/* This is a simple scene with normal shadows */

#version 3.5;

camera { location  <2, 4, -6> look_at <2, 1, 0>}

sky_sphere { pigment {
    function{abs(y)}
    color_map { [0.0 color blue 0.6] [1.0 color rgb 1] } 
  }
}

light_source {<-100,200,-100> colour rgb 1}

#declare Stuff = union {
  box {-1,1 translate y*3 pigment {rgb <1,1,0>}}
  sphere {<3,3,0>,1 pigment {rgb <1,0,0>}}
}

object {Stuff}

plane {y, 0 pigment {rgb 1}}

// two ----------------------------------------------------
/* This scene file observes the shadow orthograpically

The significant changes are:-

   The scene is viewed from an orhtographic camera
   placed vertically above the ground plane.
   
   The light is made much brighter,
   so all points on the plande are fully white or black

   The objects cating the shadows are no_image
*/   

#version 3.5;

camera { location y*10 look_at 0 orthographic}

light_source {<-100,200,-100> colour rgb 10}

#declare Stuff = union {
  box {-1,1 translate y*3 pigment {rgb <1,1,0>}}
  sphere {<3,3,0>,1 pigment {rgb <1,0,0>}}
}

object {Stuff   no_image}

plane {y, 0 pigment {rgb 1}}

// three ----------------------------------------------------
/* This is the final scene

The changes from the first scene are

   The objects are now no_shadow
   
   The plane is now painted (once) with the image_map

   The image from the second scene file has been converted
   into a GIF, so that it has a palette, since only
   paletted images work with image_map transmit
   
*/   

#version 3.5;

camera { location  <2, 4, -6> look_at <2, 1, 0>}

sky_sphere { pigment {
    function{abs(y)}
    color_map { [0.0 color blue 0.6] [1.0 color rgb 1] } 
  }
}

light_source {<-100,200,-100> colour rgb 1}

#declare Stuff = union {
  box {-1,1 translate y*3 pigment {rgb <1,1,0>}}
  sphere {<3,3,0>,1 pigment {rgb <1,0,0>}}
}

object {Stuff no_shadow}

plane {y,0
   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 scale <11,10,10>
     translate <-5,0,-5>
     }
   }
/*
-- 
Mike Williams
Gentleman of Leisure*/


Post a reply to this message

From: Anders K 
Subject: Re: Transparent plane with non-transparent shadows?
Date: 8 Dec 2001 16:54:39
Message: <3c128c1f@news.povray.org>
Thanks; my solution was similar to this, although instead of turning up the
light, I added finish { diffuse 1 ambient 0 brilliance 0 } to the plane, so
that the shadows of an area light would still be smooth. Although, it would
still be nice to be able to do it with only one rendering.


Post a reply to this message

From: Batronyx
Subject: Re: Transparent plane with non-transparent shadows?
Date: 8 Dec 2001 18:53:38
Message: <3c12a802@news.povray.org>
"Anders K." <and### [at] f2scom> wrote in message news:3c128c1f@news.povray.org...
> Thanks; my solution was similar to this, although instead of turning up the
> light, I added finish { diffuse 1 ambient 0 brilliance 0 } to the plane, so
> that the shadows of an area light would still be smooth. Although, it would
> still be nice to be able to do it with only one rendering.

Check here for another possibility of doing it in a single render. It is very
similar to Warp's idea of using an actual object but uses an object pattern
instead:

http://news.povray.org/povray.binaries.images/19443/

The transformations become simpler as well, especially if you rotate your light
source into place and save that rotation as a transform{}. You can then use it
and some warp statements to make the texture. If you want, I can post an image
and some code later, but not right now: My family is hollering for me to come
help decorate the tree :)

Batronyx ^"^


Post a reply to this message

From: Anders K 
Subject: Re: Transparent plane with non-transparent shadows?
Date: 21 Dec 2001 21:03:33
Message: <3c23e9f5$1@news.povray.org>
Fascinating. This code gives me a transparent plane with an opaque *white*
shadow. I can even make it red, green, blue. Unfortunately, I can't figure
out how to make it black!

// +ft +ua
global_settings { assumed_gamma 1.0 }
camera { location -4*z look_at 0 }
light_source { <-2, 2, -5> color rgb 1 area_light x, y, 4, 4 }
sphere { -z, 1 pigment { red 1 } }
plane {
  z, 0
  texture { pigment { rgb 1 transmit .999 } finish { ambient 0 diffuse 1000
brilliance 0 } }
  texture { pigment { rgb .5 transmit -1 } finish { ambient 1 diffuse 0 } }
}

Anders


Post a reply to this message

<<< Previous 5 Messages Goto Initial 10 Messages

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