I am trying to create a scene in PovRay where I have a Gaussian beam (tilted by 45°) passing through a lens with a focal point of 500mm, then reflecting off a flat surface. Rendering without the lens is no problem but at the point when I included the lens, the rendering no longer finishes.
When reducing the photon count to 100K, the scene can be rendered but the quality is not good. When I use photon spacing instead, it doesn't finish the render at any given value. I have tried rendering on Windows and Linux. In the render message, the first photon count is always a different value but after that, every photon count is 0. It then looks like this:
==== [Rendering...] ========================================================
Photon count 608402
Photon count 0
Photon count 0
Photon count 0
Photon count 0
Photon count 0
Photon count 0
...
Here is my code, I currently have:
// adding a photon{} block to global_settings activates photon mapping.
// photons also need to be adjusted for light sources and objects.
global_settings {
photons {
//spacing 0.01 // specify the density of photons (0.001) for quite good quality
count 100000 // alternatively use a total number of photons
//gather min, max // amount of photons gathered during render [20, 100]
media 20 // media photons
jitter 1 // jitter phor photon rays
max_trace_level 5 // optional separate max_trace_level
adc_bailout 1/255 // see global adc_bailout
//save_file "filename" // save photons to file
//load_file "filename" // load photons from file
autostop 0 // photon autostop option
radius 10 // manually specified search radius
//steps 20
expand_thresholds 0.2, 40
}
}
#declare surface_radius = 200; // radius of surface
#declare incident_angle = 45; // angle for lightreflection
#declare beam_intensity = 10000; // intensity of beam
#declare lense_distance = 524;
#declare radius_lense = 400;
#declare lense = intersection{
sphere{ <0,0,0>, radius_lense scale<1,1,1> rotate<0,0,0> translate<0,radius_lense-0.01,0>
}
sphere{ <0,0,0>, radius_lense scale<1,1,1> rotate<0,0,0> translate<0,-radius_lense+0.01,0>
}
material{
texture { pigment{ rgbf <0.98, 0.98, 0.98, 0.9> }
finish { diffuse 0.1 reflection 0.2 specular 0.8 roughness 0.0003 phong 1 phong_size 400}
}
interior{ ior 1.5 caustics 0
}
}
translate<0,lense_distance,0> rotate<0,0,incident_angle>
photons {
target
refraction on
reflection off
collect off
}
}
camera {
location <-40,40,-70> // position
look_at <0, 0, 0> // view
right x*1920/1080 // aspect
angle 40
}
// Gaussian
light_source {
<0,0,0> // light's position (translated below)
color rgb <0,beam_intensity,0> // light's color and intensity
//spotlight
cylinder
translate <0,2*lense_distance, 0> // <x y z> position of light
parallel
point_at <0, 0, 0> // direction of spotlight
radius 5 // hotspot (inner, in degrees)
tightness 5 // tightness of falloff (1...100) lower is softer, higher is tighter
falloff 5 // intensity falloff radius (outer, in degrees)
rotate <0,0,incident_angle>
}
object{lense}
// flat surface
union{
merge{
cylinder { <0,-1,0>,<0,0,0>, surface_radius}
}
texture{ pigment { color rgb<1,1,1> }
normal { spotted 0.1 scale -0.005 }
finish { specular 1 phong 1 reflection{ 1.00 metallic 1.00} }
}
scale <1,1,1> rotate <0,0,0> translate<0,0,0>
photons {
target
refraction off
reflection on
collect on
}
}