Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/kernel_projection.h
| Show First 20 Lines • Show All 208 Lines • ▼ Show 20 Lines | case PANORAMA_FISHEYE_EQUIDISTANT: | ||||
| return direction_to_fisheye(dir, kernel_data.cam.fisheye_fov); | return direction_to_fisheye(dir, kernel_data.cam.fisheye_fov); | ||||
| case PANORAMA_FISHEYE_EQUISOLID: | case PANORAMA_FISHEYE_EQUISOLID: | ||||
| default: | default: | ||||
| return direction_to_fisheye_equisolid(dir, kernel_data.cam.fisheye_lens, | return direction_to_fisheye_equisolid(dir, kernel_data.cam.fisheye_lens, | ||||
| kernel_data.cam.sensorwidth, kernel_data.cam.sensorheight); | kernel_data.cam.sensorwidth, kernel_data.cam.sensorheight); | ||||
| } | } | ||||
| } | } | ||||
| ccl_device float3 panorama_stereo_position(KernelGlobals *kg, float3 dir, float3 pos) | |||||
| { | |||||
| float3 up, side; | |||||
dingto: I think this line is not needed. Comment beneath is sufficient. Also please start comment with… | |||||
| if(kernel_data.cam.stereo_eye == STEREO_NONE) | |||||
| return pos; | |||||
| up = make_float3(0.0f, 0.0f, 1.0f); | |||||
| side = normalize(cross(dir, up)); | |||||
| switch(kernel_data.cam.stereo_eye) { | |||||
Not Done Inline ActionsThink we don't need such switch here at all. kernel_data.cam.interocular_distance == 0 equals to STEREO_NONE Think with some good naming of variables and comments around them we can keep kernel simplier and more uniform for all the possible mappings. sergey: Think we don't need such switch here at all.
`kernel_data.cam.interocular_distance == 0`… | |||||
Not Done Inline Actionssure, I will do it dfelinto: sure, I will do it | |||||
| case STEREO_LEFT: | |||||
| return pos + (side * kernel_data.cam.interocular_distance * 0.5f); | |||||
| break; | |||||
| case STEREO_RIGHT: | |||||
| return pos - (side * kernel_data.cam.interocular_distance * 0.5f); | |||||
| break; | |||||
Not Done Inline ActionsSame as above. Upper case + Fullstop. dingto: Same as above. Upper case + Fullstop. | |||||
| } | |||||
| return pos; | |||||
| } | |||||
| ccl_device float3 panorama_stereo_direction(KernelGlobals *kg, float3 dir, float3 pos, float3 newpos) | |||||
| { | |||||
| float3 screenpos, dirnew; | |||||
| if(kernel_data.cam.stereo_eye == STEREO_NONE) | |||||
| return dir; | |||||
| screenpos = pos + (normalize(dir) * kernel_data.cam.convergence_distance); | |||||
| dirnew = screenpos - newpos; | |||||
| switch(kernel_data.cam.stereo_eye) { | |||||
sergeyUnsubmitted Not Done Inline ActionsEither there's a typo below or this switch is redundant. sergey: Either there's a typo below or this switch is redundant. | |||||
dfelintoAuthorUnsubmitted Not Done Inline ActionsI think it's a type in one of my cleanups. I'll look at it. dfelinto: I think it's a type in one of my cleanups. I'll look at it. | |||||
| case STEREO_LEFT: | |||||
| return dirnew; | |||||
| case STEREO_RIGHT: | |||||
| return dirnew; | |||||
| } | |||||
| return dir; | |||||
| } | |||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||
| #endif /* __KERNEL_PROJECTION_CL__ */ | #endif /* __KERNEL_PROJECTION_CL__ */ | ||||
I think this line is not needed. Comment beneath is sufficient. Also please start comment with uppercase Letter and fullstop at the end. That is inconsistent in Cycles atm, but I want to change this soon.