POV-Ray : Newsgroups : povray.newusers : Re: Howto create a light fading completely dark at distance? Scene attached : Re: Howto create a light fading completely dark at distance? Scene attached Server Time
30 Jul 2024 06:19:29 EDT (-0400)
  Re: Howto create a light fading completely dark at distance? Scene attached  
From: sprocket
Date: 8 Sep 2004 13:55:01
Message: <web.413f464378966cd148cbffb00@news.povray.org>
I had a look at your code,
Im only new to pov but had a quick stint with lightwave a few yrs ago.
heres what i did.
First the global ambiant settings need to be set at 0 or just under .01 etc.
then the diffuse and ambiet levels of the scene objects need to be set at
about 6 or 7 .
next set the light under the camera close to the ground  and make it an area
light.
now take a cone or similar object add a filtered gradient to it ,make it
hollow and stick the light inside it.
move the camera and light on the same path abd you have a moving light
source.
the floor texture was too dark to really use so i changed it and made the
coloums cleaner to speed the render.
this is an example of what you can do with this light.
the shadows all fall away from the camera.
this is just a really messy work around using your code.
cleaned up a bit,
Im rendering an animation now so it will be inthe binary animation section,
called darkwood flight.

sprocket.(need a good povtag?)

source for dark forrest.(no animation values)

[START]
global_settings { //  sets an overall brightness/ambient light level in the
scene
  ambient_light color rgb -.001}
 // user settings
here!!!!!!!-------------------------------------------------------------
 #declare ld=5; //lantern distance   higher is shorter distance. lower is
further away  [1....15]
 //   !17 does weird things!!!!!!!!!
 #declare dt= 4; // array size for k i settings later. num trees   [10]
 #declare vect1 =  <27.0, 1.5, -1.0>;
 #declare vect2 =  <27.0, 0.0, -3.0>;
#include "colors.inc"
#include "stones.inc"
#include "textures.inc"
 background { color Black }
// ----------------------------------------
#declare texbot=texture{T_Stone18 scale 4};
#declare texcols=texture {PinkAlabaster scale 0.2};
#declare DragonEggHolder=
 union {
  difference {      // Steg
   cylinder { <-1.0,-0.2,0.0>, <0.0,-0.2,0.0>, 0.1 }
   sphere { <0,0,0>, 0.43 scale <1.0,1.3,1.0>}
  }

  intersection {    // spherical holder
   difference {
    sphere { <0,0,0>, 0.50 }
    sphere { <0,0,0>, 0.43 }
   }
   box{ <-0.5,-0.5,-0.5>, <0.5,0,0.5> }
   scale <1.0,1.3,1.0>
  }

  translate <1.0,0.5,0.0>
  texture {texcols}
 }

#declare DragonPillar=
 union {
  #local maxy=60;
  #local yh=1;
  #local ystep=1.0;
  #local w=0;
  object { cylinder { <0,0,0>, <0,maxy,0>, 0.4 } texture{texcols} }
  #while ( yh < maxy )
   object { DragonEggHolder rotate w*y translate yh*y }
   #local yh=yh+ystep;
   #local w=w+75;
   #if ( w >=360 )
    #local w=w-360;
   #end
  #end
 };

#declare DragonPillarWood=
 union {
  #local i=0;
  #local k=0;
  #while (k < (1*dt))
   #while ( i < (1*dt) )
    object { DragonPillar
    translate <i*8, 0, k*7+sin(i*k)> }
    #local i=i+1;
   #end
   #local k=k+1;
   #local i=0;
  #end
 } ;


 plane { y,0 texture{pigment {
 marble  color_map{[0  rgb<0,.7,.2>][1 rgb<0,.3,.1>]}turbulence .9 scale 3}
}
 finish{ambient .5 diffuse .5 reflection .23}normal{bumps .5 scale .1}}
 object {DragonPillarWood finish {ambient .13 diffuse .1}}


#declare man=union{      // lantern and area spotlight
// WARNING: This special light can significantly slow down rendering times!
light_source {
  0*y                 // light's position (translated below)
  color rgb <.5,.5,.3>
  //spotlight
   // radius 33
   // falloff 180
   // tightness 100
   // light's color
  area_light
  <1, 0, 0> <0, 0, 1> // lights spread
  2, 2                // total number of lights
  adaptive 1
  jitter
  circular
  orient
  translate vect1 translate<0,-0.84,-0.0>
 //  point_at vect2
fade_power ld/1.2 fade_distance 17-ld

}};
object{ man}
camera {
  location vect1
  look_at   <-22.0, 5.0,  66.0>
  right     x*image_width/image_height
translate<0,.2,0> angle 90}
//shade for lamp stops litegoing up trees.
difference {
    sphere { <0,0,0>, 0.50hollow }
    sphere { <0,0,0>, 0.3 hollow }    scale <.9,.5,.9>*2
    no_reflection       //no_shadow
   translate vect1 translate <0,.2,0>pigment {
    gradient x  scale .5
    color_map {
      [0.00 color rgbt .9]
      [0.1 color rgbt.8]
      [0.2 color rgbt .7]
      [0.3 color rgbt .6]
      [0.4 color rgbt .5]
      [0.5 color rgbt .4]
      [0.6 color rgbt .3]
      [0.7 color rgbt .20]
      [0.8 color rgbt .0]
      [0.9 color rgbt .0]
      [1.00 color rgbt .0]
    } rotate <0,0,90>
  }
translate<0,-.8,0>}
[END]


Post a reply to this message

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