[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46389] trunk/blender/intern/cycles/kernel /kernel_projection.h: cycles-fisheye: fixed formula for dir to equisolid

Dalai Felinto dfelinto at gmail.com
Mon May 7 19:22:13 CEST 2012


Revision: 46389
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46389
Author:   dfelinto
Date:     2012-05-07 17:22:13 +0000 (Mon, 07 May 2012)
Log Message:
-----------
cycles-fisheye: fixed formula for dir to equisolid
second time I need a scond commit to get the equisolid formula right, shame on me ;)
the formula is:
r = 2 x focallength x sin (theta / 2)

Modified Paths:
--------------
    trunk/blender/intern/cycles/kernel/kernel_projection.h

Modified: trunk/blender/intern/cycles/kernel/kernel_projection.h
===================================================================
--- trunk/blender/intern/cycles/kernel/kernel_projection.h	2012-05-07 17:13:10 UTC (rev 46388)
+++ trunk/blender/intern/cycles/kernel/kernel_projection.h	2012-05-07 17:22:13 UTC (rev 46389)
@@ -112,7 +112,7 @@
 __device float2 direction_to_fisheye_equisolid(float3 dir, float lens, float width, float height)
 {
 	float theta = acosf(dir.x);
-	float r = 2.0f * lens * sinf(theta * 0.25f);
+	float r = 2.0f * lens * sinf(theta * 0.5f);
 	float phi = atan2f(dir.z, dir.y);
 
 	float u = r * cosf(phi) / width + 0.5f;




More information about the Bf-blender-cvs mailing list