| 
  | 
//  Demonstration scene for a bright area light (soft shadows)
//  Mark Slone October 16, 2004
//  Using a light with color values greater than one to
//  'blow out' the lighting on parts of an image, I noticed
//  some odd effects from the bright area light, so I produced
//  this scene to isolate and examine the effects.
//  This file produces a close-up view of the soft shadow of
//  a light source that represents the Sun. It demonstrates
//  how a bright light source (with colors greater than '1')
//  will "blow out" the soft shadow on light pigmented surfaces.
//  This is not bug, but simply a result of scaling colors
//  greater than one down to equal one.
//  I've used the brick pattern to alternate the surface between
//  white and dark grey parts. The soft shadow appears correct
//  on the grey surface because the resulting color is fully
//  represented, while the white surface shows a 'scaled color'
//  soft shadow, appearing to truncate the soft shadow.
//  If the light source has a color, the soft shadow
//  will be tinged with the brighter components when it hits
//  a surface that produces an image with a color greater than '1'
//  I think this is because the brighter colors scale to '1' for
//  a good part of the soft shadow, while the darker colors scale
//  lower as the soft shadow lowers the amount of light hitting
//  the surface.
//  Set the Flag WhiteYellow = 1 to see the color tinge.
//  It appears the brightest part of the image is scaled to
//  equal '1' and the other colors are scaled proportionately.
//  Thus, my sunlight color <1.00, 0.65, 0.35>*4 will result
//  in a <1.00, 0.65, 0.35> color when lighting a <1,1,1> surface.
//  Side note: Shadows fool my eye. The contrast between
//  light and dark areas often gives the impression the unshadowed
//  part near the shadow is actually brighter than the rest of
//  the unshadowed area. In fact, to my eye, the first part of
//  the soft shadow appears slightly brighter than the totally
//  unshadowed part. (This is true in reality as well as images
//  produced by POV-Ray.)
global_settings { ambient_light rgb <0,0,0> }  //  Black shadows
//  Flags
#local WhiteYellow = 0; //  0 for white light
        //  1 for yellow sunlight
#local SoftShadow = 1;  //  0 for sharp shadows
        //  1 for soft shadows
//  Camera
camera {
  location  <0, 0, -20>
  look_at   <0, 0,   0>
  angle 10
  right x*image_width/image_height
    }
//  Light
light_source {
    <10000, 10000, -50000>
#if ( WhiteYellow )
    color rgb <1.00, 0.65, 0.35>*4  //  Yellow Sun
#else
    color rgb <1.00, 1.00, 1.00>*4  //  White light
#end
    media_interaction off
//  Real Sun Distance (average) = 149,597,871 km
//  Real Sun Radius (approximate) = 696,000 km
//  149,597,871/696,000 = 215 distance/radius ratio
//
//  Sun distance is 51962 units
//  Sun radius = 51962/215 = 242 units
#if ( SoftShadow )
     area_light <-242, -242, 0>, <242, 242, 0>, 9, 9
  adaptive 1
  jitter
  circular
  orient
  parallel
  point_at <0,0,0>
#end
             }  //  end of light_source
//  Wall with shadow cast on it, either a bright
//  or dark pigment using the brick pattern
box { <-10, -10, 0>, <10, 10, 1>
 texture {
  pigment {
   brick
   color rgb <1.0, 1.0, 1.0>,  // white mortar
   color rgb <0.2, 0.2, 0.2>  // grey brick
   brick_size <1,1,1>   // size of brick    (optional)
   mortar     0.2       // width of mortar  (optional)
    }  }
     }
//  Shadow wall ~30 units away from wall with shadow
difference {
 box { <-10, 0, -30.01>, <7, 7, -30> }
   plane { <-0.707, -0.707, 0.0>, 0  translate <7, 6.5, 0.> }
 texture { pigment { color rgb <0,0,0> } }
 translate <-0.6, -0.6, 0>
      }
 Post a reply to this message 
 | 
  |