POV-Ray : Newsgroups : povray.advanced-users : Transparent plane with non-transparent shadows? Server Time
29 Jul 2024 20:26:17 EDT (-0400)
  Transparent plane with non-transparent shadows? (Message 11 to 15 of 15)  
<<< Previous 10 Messages Goto Initial 10 Messages
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 10 Messages Goto Initial 10 Messages

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