[Bf-codereview] Fisheye Panorama for Cycles (issue 6111052)

brechtvanlommel at gmail.com brechtvanlommel at gmail.com
Thu May 3 17:46:12 CEST 2012


Some quick comments on the code, don't have an opinion on the FOV/sensor
yet.


http://codereview.appspot.com/6111052/diff/25001/intern/cycles/kernel/kernel_camera.h
File intern/cycles/kernel/kernel_camera.h (right):

http://codereview.appspot.com/6111052/diff/25001/intern/cycles/kernel/kernel_camera.h#newcode147
intern/cycles/kernel/kernel_camera.h:147: ray->D =
equirectangular_to_direction(Pcamera.x, Pcamera.y);
At this point it might be good to create a panorama_to_direction
function, that takes the panorama type as argument and does the switch()
there, instead of duplicating it 3x.

http://codereview.appspot.com/6111052/diff/25001/intern/cycles/kernel/kernel_montecarlo.h
File intern/cycles/kernel/kernel_montecarlo.h (right):

http://codereview.appspot.com/6111052/diff/25001/intern/cycles/kernel/kernel_montecarlo.h#newcode256
intern/cycles/kernel/kernel_montecarlo.h:256: return make_float3(0.f);
Is it white or NaN? In any case, the proper solution would be to change
this in kernel_path.h, at the line:
float4 L = kernel_path_integrate(kg, &rng, sample, ray, buffer);

Set it and then check ray.t == 0, and just set L to make_float4(0.0f,
0.0f, 0.0f, 0.0f);

http://codereview.appspot.com/6111052/diff/25001/intern/cycles/kernel/kernel_montecarlo.h#newcode256
intern/cycles/kernel/kernel_montecarlo.h:256: return make_float3(0.f);
Also, don't use return make_float3(0.f);, it works only on the CPU
actually, probably need to make that more clear. It needs to be
make_float3(0.0f, 0.0f, 0.0f);

http://codereview.appspot.com/6111052/


More information about the Bf-codereview mailing list