POV-Ray : Newsgroups : povray.text.scene-files : the 3 media of MegaPOV in scene file : the 3 media of MegaPOV in scene file Server Time
28 Jul 2024 16:15:48 EDT (-0400)
  the 3 media of MegaPOV in scene file  
From: omniVERSE
Date: 9 Jan 2000 19:01:01
Message: <3879213d@news.povray.org>
/*
  Here's a quick example animation of a spotlight shone upon a rotating box
while the camera rotates to face the pointing direction around to the light
source  (into shadow of box) direction.  Each of the 3 media methods is used in
succession.  The camera just jumps back to the start each time the method is
changed.  The media scattering uses type 5 Henyey-Greenstein eccentric haze (of
0.25) for all with the settings of media all the same so as to see the
differences only of the method.
  Starting with 1, the granular and most dusty, is the usual official POV-Ray
media.  Method 2 only shows this same dust when looking back at the spotlight
through the box shadow and otherwise has noticeable color banding like a
highcolor (16bit or lower) display screen does.  3 is smoothed yet still has
almost imperceptable banding.
  The final frame image of each had a ratio of 1:1, 0.83:1, and 1.7:1 (if I
figured this right); based on the official unchanged media type.  They were 58s
for type 1, 48s for type 2, and 99s for type 3 (ratio is more to the point
though).
  I'll post the small text file of this at p.t.s-f. too so you can see the
setup.

Bob
*/

//  the 3 media methods of MegaPOV patch shown to compare each in succession
// not at once but could be done that way too, I just didn't think of it until
now

#declare LH= // spotlight housing shape
merge {
sphere {0,1}
cylinder {0,+x,1}
}

union { // spotlight object
difference {
object {LH}
object {LH scale .95 translate .075*x}
}
sphere {0,1 scale <.2,.96,.96> translate +x pigment {rgbf .85} finish {ambient
6}}
 pigment {rgb .15} finish {specular .5 roughness .1}
  scale .2 translate -1.85*x
}

light_source {  // spotlight itself
  0*x
  color rgb 1.5
  spotlight
  translate <-2, 0, 0>
  point_at <0, 0, 0>
  radius 15
  tightness 1
  falloff 30
  fade_distance 1.5 fade_power 1
  media_interaction on
   media_attenuation off // with this off render speeds up considerably
}

// method switching float and clock resetting
#if (clock<.33333) #declare MT=1; #declare CM=3*clock; #end
#if (clock>.33333) #declare MT=2; #declare CM=3*(clock-.33333); #end
#if (clock>.66667) #declare MT=3; #declare CM=3*(clock-.66667); #end

camera {
  location  <-3, 0,-9>
  direction 3*z
  rotate 77.5*y rotate -192.5*CM*y
  look_at   <0, 0, 0>
}

media {
 method MT
 intervals 5 // if more than 1 light, increase integer
 samples 5,15
  confidence 0.9
  variance 1/100
// ratio lower than 1 increases graininess at light/dark boundaries of spot
lights
   ratio 1
 // emission rgb .1
 // absorption rgb .1
 scattering {5,rgb 1.25 // increase rgb value for brighter lit "air", darker
unlit
  extinction .125 // zero if using sky_sphere
  eccentricity .25 // lower is brighter
  }
 density {rgb .125} // increase rgb value for brighter lit "air", darker unlit
}

// control object
box {-.5,.5 pigment {rgb 1} finish {ambient .125}
 rotate <30,30,30> rotate 360*CM*z translate 1*x hollow off}

// non-interacting light
light_source {<-5,-2.5,-5> color rgb .25 media_interaction off media_attenuation
off}

// comment out to see with sky_sphere instead
sphere {0,15 pigment {rgb<.3,.6,.9>} finish {ambient .5} hollow}

sky_sphere { // daytime
  pigment
  {
    gradient y
    color_map { [0.0 color rgb<0.8,0.9,1.0>] [1.0 color rgb<0.6,0.7,0.9>] }
  }
}

// omniVERSE
// http://users.aol.com/inversez/


Post a reply to this message

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