我正在尝试在 PovRay 中创建一个场景,其中高斯光束(倾斜 45°)穿过焦点为 500 毫米的镜头,然后从平面反射。没有镜头的渲染没有问题,但是当我加入镜头时,渲染不再完成。
将光子数减少到 100K 时,可以渲染场景但质量不佳。当我改用光子间距时,它不会以任何给定值完成渲染。我试过在 Windows 和 Linux 上渲染。在渲染消息中,第一个光子计数始终是不同的值,但之后,每个光子计数都是 0。然后看起来像这样:
==== [Rendering...] ========================================================
Photon count 608402
Photon count 0
Photon count 0
Photon count 0
Photon count 0
Photon count 0
Photon count 0
...
这是我的代码,我目前有:
// 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
}
}