From 03cc3b94c94c38767802bccac4e9384ab704065a Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 9 Nov 2012 09:11:24 +0000 Subject: [PATCH] Fisheye Equidistant Lens algorith bugfix r = lens * theta Thanks for Adriano Oliveira for reporting this and chasing down the right formula. Now fulldome works no longer need to use equisolid + a specific lens+sensor size. And happy birthday to me. And yes, that's how I celebrate it ;) --- intern/cycles/blender/addon/enums.py | 5 ++--- intern/cycles/kernel/kernel_projection.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/intern/cycles/blender/addon/enums.py b/intern/cycles/blender/addon/enums.py index a98a6aab4c4..82b48973ca1 100644 --- a/intern/cycles/blender/addon/enums.py +++ b/intern/cycles/blender/addon/enums.py @@ -57,8 +57,7 @@ aperture_types = ( panorama_types = ( ('EQUIRECTANGULAR', "Equirectangular", "Render the scene with a spherical camera, also known as Lat Long panorama"), - ('FISHEYE_EQUIDISTANT', "Fisheye Equidistant", "Ignore the sensor dimensions"), + ('FISHEYE_EQUIDISTANT', "Fisheye Equidistant", "Ideal for fulldomes, ignore the sensor dimensions"), ('FISHEYE_EQUISOLID', "Fisheye Equisolid", - "Similar to most fisheye modern lens, takes sensor dimensions into consideration " - "(for fulldomes use it with a square sensor ratio)"), + "Similar to most fisheye modern lens, takes sensor dimensions into consideration"), ) diff --git a/intern/cycles/kernel/kernel_projection.h b/intern/cycles/kernel/kernel_projection.h index 64747bcb42e..6516b9e4d82 100644 --- a/intern/cycles/kernel/kernel_projection.h +++ b/intern/cycles/kernel/kernel_projection.h @@ -98,7 +98,7 @@ __device float3 fisheye_to_direction(float u, float v, float fov) return make_float3(0.0f, 0.0f, 0.0f); float phi = acosf((r != 0.0f)? u/r: 0.0f); - float theta = asinf(r) * (fov / M_PI_F); + float theta = r * fov * 0.5f; if(v < 0.0f) phi = -phi;