POV-Ray : Newsgroups : povray.binaries.images : Motecarlo path tracing with MegaPov 1.2.1 : Re: Motecarlo path tracing with MegaPov 1.2.1 Server Time
2 Aug 2024 18:12:32 EDT (-0400)
  Re: Motecarlo path tracing with MegaPov 1.2.1  
From: nemesis
Date: 10 Feb 2008 14:45:00
Message: <web.47af5346dcec6a9f48af2500@news.povray.org>
hi, fidos!  I modified it a bit to work with current povray methods, radiosity
and photon mapping.  Just a couple of minutes to render.  Main difference to be
seen is the glass ball caustic on the floor, which seems to just render the
pointlight source...

If anyone is playing with it, I suggest to put FINAL off and render GI 1 and
PHOTONS 1 at separate passes.  When going to the final render, just turn FINAL
on.


#local FINAL = on;
#local GI = 0;
#local GIgather = 1;
#local PHOTONS = 0;
#local PHOTONSgather = 1;


// don't touch!
#if (FINAL)
 #declare GI = 1;
 #declare GIgather = 0;
 #declare PHOTONS = 1;
 #declare PHOTONSgather = 0;
#end

global_settings {
  assumed_gamma 1.0
  max_trace_level 10
 #if (GI)
 radiosity {
  #if (GIgather)
  save_file "pt.rad"
  brightness 2.6
  minimum_reuse .02
  count 40*6
  error_bound .6
  low_error_factor .8
  adc_bailout .01
  recursion_limit 3
  pretrace_start .08
  pretrace_end .02
  nearest_count 10
  normal off
  #else
  load_file "pt.rad"
  always_sample no
  brightness 2.6
  count 1
  error_bound .6
  pretrace_start 1//.04
  pretrace_end 1//.002
  nearest_count 1
  normal off
  #end
 }
 #end
 #if (PHOTONS)
 photons {
  #if (PHOTONSgather)
  save_file "pt.phm"
  count 20000*4
  //radius .4
  #else
  load_file "pt.phm"
  count 20000*4
  #end
 }
 #end
}

camera {
  location  <3, 5, -5>
  direction z
  right     x*image_width/image_height
  look_at   <-1, 1, 0>
}

sphere {
  0,1
  texture {
   pigment { color rgb 1 }
   finish { diffuse 0 ambient 0 }
  }
  hollow on
  no_shadow
  scale 10000
}

plane {
  y, 0
  texture
  {
    pigment {  color rgb 1 }
   finish { diffuse .5 ambient 0 }
  }
  photons { collect on }
}

sphere {
  0,1
  texture {
   pigment { color rgb <0.5,0.5,1> }
   finish { diffuse .6 ambient 0 }
  }
  translate y*1-x*3
}

//box {
//  -0.5,0.5
sphere {
  0,0.5
  texture {
    pigment { color rgbf 1 }
    finish { ambient 0 diffuse 0 }
  }
  scale <1,1,1>
  interior {
    ior 1.33
  }
  photons { target on reflection on refraction on }
  translate y*1
}

box {
  -1,1
  texture {
    pigment { color rgb <1,1,1> }
    finish { reflection {1.0} ambient 0 diffuse 0 }
  }
  photons { target on reflection on refraction off }
  scale <2,2,0.1>
  translate y*2+3*z
}

box {
  -0.5,0.5
  texture {
   pigment { color rgb <1,0.5,0.5> }
   finish { diffuse .6 ambient 0 }
  }
  translate -x+0.75*y-2*z
}

#if (0)// (!PHOTONS)
sphere {
  0,1
  texture {
   pigment { color rgb 1 }
   finish { diffuse 1 ambient 5 }
  }
  translate y*3+x*3
}
#end


#if (1) //(PHOTONS | FINAL)
light_source
{
  y*3+x*3, 1 fade_power 2 fade_distance 3
  #if (FINAL)
  area_light x,y,5,5 jitter adaptive 0 circular orient
  #end
  photons { reflection on refraction on }

  looks_like {
 sphere { 0,1
    pigment { color rgb 1 }
    finish { diffuse 0 ambient 1 }
 }
  }
}
#end


Post a reply to this message


Attachments:
Download 'pt.png' (129 KB)

Preview of image 'pt.png'
pt.png


 

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