diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-03-11 19:58:47 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-03-12 13:01:20 +0300 |
commit | d652833a1767500653fcfea5e83ad4e31a0a1c14 (patch) | |
tree | 72b2a57b698c29a747ad4f0f69fd220e5c39ccb9 /intern/cycles/kernel | |
parent | 7d82de9e849e66e0e3f85445beb61fae1eecbcce (diff) |
Cycles: Support parallel convergence mode for spherical stereo
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r-- | intern/cycles/kernel/kernel_projection.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/intern/cycles/kernel/kernel_projection.h b/intern/cycles/kernel/kernel_projection.h index e561cfaebe0..d042acc76b3 100644 --- a/intern/cycles/kernel/kernel_projection.h +++ b/intern/cycles/kernel/kernel_projection.h @@ -247,15 +247,20 @@ ccl_device float3 spherical_stereo_direction(KernelGlobals *kg, float3 pos, float3 newpos) { + const float convergence_distance = kernel_data.cam.convergence_distance; const float3 normalized_dir = normalize(dir); /* Interocular offset of zero means either no stereo, or stereo without * spherical stereo. + * Convergence distance is FLT_MAX in the case of parallel convergence mode, + * no need to mdify direction in this case either. */ - if(kernel_data.cam.interocular_offset == 0.0f) { + if(kernel_data.cam.interocular_offset == 0.0f || + convergence_distance == FLT_MAX) + { return normalized_dir; } - float3 screenpos = pos + (normalized_dir * kernel_data.cam.convergence_distance); + float3 screenpos = pos + (normalized_dir * convergence_distance); return normalize(screenpos - newpos); } |