[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46407] branches/meshdata_transfer: svn merge ^/trunk/blender -r46380:46390

Ove Murberg Henriksen sorayasilvermoon at hotmail.com
Tue May 8 02:12:50 CEST 2012


Revision: 46407
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46407
Author:   cyborgmuppet
Date:     2012-05-08 00:12:47 +0000 (Tue, 08 May 2012)
Log Message:
-----------
svn merge ^/trunk/blender -r46380:46390

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46380

Modified Paths:
--------------
    branches/meshdata_transfer/intern/cycles/blender/addon/properties.py
    branches/meshdata_transfer/intern/cycles/kernel/kernel_camera.h
    branches/meshdata_transfer/intern/cycles/kernel/kernel_montecarlo.h
    branches/meshdata_transfer/intern/cycles/kernel/kernel_path.h
    branches/meshdata_transfer/intern/cycles/kernel/kernel_triangle.h
    branches/meshdata_transfer/intern/cycles/kernel/kernel_types.h
    branches/meshdata_transfer/intern/cycles/kernel/svm/svm_tex_coord.h
    branches/meshdata_transfer/intern/cycles/render/camera.cpp
    branches/meshdata_transfer/intern/cycles/render/light.cpp
    branches/meshdata_transfer/intern/cycles/util/util_math.h
    branches/meshdata_transfer/intern/cycles/util/util_transform.h
    branches/meshdata_transfer/intern/ghost/intern/GHOST_SystemCocoa.h
    branches/meshdata_transfer/intern/ghost/intern/GHOST_SystemCocoa.mm
    branches/meshdata_transfer/source/blender/blenkernel/BKE_writeavi.h
    branches/meshdata_transfer/source/blender/blenkernel/BKE_writeffmpeg.h
    branches/meshdata_transfer/source/blender/blenkernel/BKE_writeframeserver.h
    branches/meshdata_transfer/source/blender/blenkernel/intern/writeavi.c
    branches/meshdata_transfer/source/blender/blenkernel/intern/writeffmpeg.c
    branches/meshdata_transfer/source/blender/blenkernel/intern/writeframeserver.c
    branches/meshdata_transfer/source/blender/editors/curve/editcurve.c
    branches/meshdata_transfer/source/blender/editors/render/render_opengl.c
    branches/meshdata_transfer/source/blender/editors/screen/screendump.c
    branches/meshdata_transfer/source/blender/editors/space_clip/clip_ops.c
    branches/meshdata_transfer/source/blender/editors/space_image/image_ops.c
    branches/meshdata_transfer/source/blender/editors/space_outliner/outliner_draw.c
    branches/meshdata_transfer/source/blender/editors/space_outliner/outliner_edit.c
    branches/meshdata_transfer/source/blender/editors/space_outliner/outliner_intern.h
    branches/meshdata_transfer/source/blender/editors/space_outliner/outliner_select.c
    branches/meshdata_transfer/source/blender/editors/space_outliner/outliner_tools.c
    branches/meshdata_transfer/source/blender/editors/space_outliner/outliner_tree.c
    branches/meshdata_transfer/source/blender/editors/space_outliner/space_outliner.c
    branches/meshdata_transfer/source/blender/editors/space_view3d/view3d_edit.c
    branches/meshdata_transfer/source/blender/makesrna/intern/rna_lamp.c
    branches/meshdata_transfer/source/blender/makesrna/intern/rna_scene.c
    branches/meshdata_transfer/source/blender/makesrna/intern/rna_scene_api.c
    branches/meshdata_transfer/source/blender/modifiers/intern/MOD_solidify.c
    branches/meshdata_transfer/source/blender/render/intern/source/pipeline.c

Property Changed:
----------------
    branches/meshdata_transfer/
    branches/meshdata_transfer/source/blender/editors/interface/interface.c
    branches/meshdata_transfer/source/blender/editors/space_outliner/


Property changes on: branches/meshdata_transfer
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037
/trunk/blender:44563-46200,46301-46380
   + /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037
/trunk/blender:44563-46200,46301-46390

Modified: branches/meshdata_transfer/intern/cycles/blender/addon/properties.py
===================================================================
--- branches/meshdata_transfer/intern/cycles/blender/addon/properties.py	2012-05-08 00:09:00 UTC (rev 46406)
+++ branches/meshdata_transfer/intern/cycles/blender/addon/properties.py	2012-05-08 00:12:47 UTC (rev 46407)
@@ -278,6 +278,25 @@
                 subtype='ANGLE',
                 default=0,
                 )
+        cls.panorama_type = EnumProperty(
+                name="Panorama Type",
+                description="Distortion to use for the calculation",
+                items=enums.panorama_types,
+                default='FISHEYE_EQUISOLID',
+                )
+        cls.fisheye_fov = FloatProperty(
+                name="Field of View",
+                description="Field of view for the fisheye lens",
+                min=0.1745, soft_max=2*math.pi, max=10.0*math.pi,
+                subtype='ANGLE',
+                default=math.pi,
+                )
+        cls.fisheye_lens = FloatProperty(
+                name="Fisheye Lens",
+                description="Lens focal length (mm)",
+                min=0.01, soft_max=15.0, max=100.0,
+                default=10.5,
+                )
 
     @classmethod
     def unregister(cls):

Modified: branches/meshdata_transfer/intern/cycles/kernel/kernel_camera.h
===================================================================
--- branches/meshdata_transfer/intern/cycles/kernel/kernel_camera.h	2012-05-08 00:09:00 UTC (rev 46406)
+++ branches/meshdata_transfer/intern/cycles/kernel/kernel_camera.h	2012-05-08 00:12:47 UTC (rev 46407)
@@ -134,19 +134,6 @@
 
 /* Environment Camera */
 
-__device float3 panorama_to_direction(KernelGlobals *kg, float u, float v)
-{
-	switch(kernel_data.cam.panorama_type) {
-		case PANORAMA_EQUIRECTANGULAR:
-			return equirectangular_to_direction(u, v);
-		case PANORAMA_FISHEYE_EQUIDISTANT:
-			return fisheye_to_direction(u, v, kernel_data.cam.fisheye_fov);
-		case PANORAMA_FISHEYE_EQUISOLID:
-		default:
-			return fisheye_equisolid_to_direction(u, v, kernel_data.cam.fisheye_lens, kernel_data.cam.fisheye_fov, kernel_data.cam.sensorwidth, kernel_data.cam.sensorheight);
-	}
-}
-
 __device void camera_sample_panorama(KernelGlobals *kg, float raster_x, float raster_y, Ray *ray)
 {
 	Transform rastertocamera = kernel_data.cam.rastertocamera;

Modified: branches/meshdata_transfer/intern/cycles/kernel/kernel_montecarlo.h
===================================================================
--- branches/meshdata_transfer/intern/cycles/kernel/kernel_montecarlo.h	2012-05-08 00:09:00 UTC (rev 46406)
+++ branches/meshdata_transfer/intern/cycles/kernel/kernel_montecarlo.h	2012-05-08 00:12:47 UTC (rev 46407)
@@ -185,124 +185,6 @@
 	return make_float2(cr*p.x - sr*p.y, sr*p.x + cr*p.y);
 }
 
-/* Spherical coordinates <-> Cartesian direction  */
-
-__device float2 direction_to_spherical(float3 dir)
-{
-	float theta = acosf(dir.z);
-	float phi = atan2f(dir.x, dir.y);
-
-	return make_float2(theta, phi);
-}
-
-__device float3 spherical_to_direction(float theta, float phi)
-{
-	return make_float3(
-		sinf(theta)*cosf(phi),
-		sinf(theta)*sinf(phi),
-		cosf(theta));
-}
-
-/* Equirectangular coordinates <-> Cartesian direction */
-
-__device float2 direction_to_equirectangular(float3 dir)
-{
-	float u = -atan2f(dir.y, dir.x)/(2.0f*M_PI_F) + 0.5f;
-	float v = atan2f(dir.z, hypotf(dir.x, dir.y))/M_PI_F + 0.5f;
-
-	return make_float2(u, v);
-}
-
-__device float3 equirectangular_to_direction(float u, float v)
-{
-	float phi = M_PI_F*(1.0f - 2.0f*u);
-	float theta = M_PI_F*(1.0f - v);
-
-	return make_float3(
-		sin(theta)*cos(phi),
-		sin(theta)*sin(phi),
-		cos(theta));
-}
-
-/* Fisheye <- Cartesian direction */
-
-__device float3 fisheye_to_direction(float u, float v, float fov)
-{
-	u = (u - 0.5f) * 2.0f;
-	v = (v - 0.5f) * 2.0f;
-
-	float r = sqrt(u*u + v*v);
-
-	if(r > 1.0f)
-		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);
-
-	if(v < 0.0f) phi = -phi;
-
-	return make_float3(
-		 cosf(theta),
-		 -cosf(phi)*sinf(theta),
-		 sinf(phi)*sinf(theta)
-	);
-}
-
-__device float3 fisheye_equisolid_to_direction(float u, float v, float lens, float fov, float width, float height)
-{
-	u = (u - 0.5f) * width;
-	v = (v - 0.5f) * height;
-
-	float rmax = 2.0f * lens * sinf(fov * 0.25f);
-	float r = sqrt(u*u + v*v);
-
-	if(r > rmax)
-		return make_float3(0.0f, 0.0f, 0.0f);
-
-	float phi = acosf((r != 0.0f)? u/r: 0.0f);
-	float theta = 2.0f * asinf(r/(2.0f * lens));
-
-	if(v < 0.0f) phi = -phi;
-
-	return make_float3(
-		 cosf(theta),
-		 -cosf(phi)*sinf(theta),
-		 sinf(phi)*sinf(theta)
-	);
-}
-
-/* Mirror Ball <-> Cartesion direction */
-
-__device float3 mirrorball_to_direction(float u, float v)
-{
-	/* point on sphere */
-	float3 dir;
-
-	dir.x = 2.0f*u - 1.0f;
-	dir.z = 2.0f*v - 1.0f;
-	dir.y = -sqrt(max(1.0f - dir.x*dir.x - dir.z*dir.z, 0.0f));
-
-	/* reflection */
-	float3 I = make_float3(0.0f, -1.0f, 0.0f);
-
-	return 2.0f*dot(dir, I)*dir - I;
-}
-
-__device float2 direction_to_mirrorball(float3 dir)
-{
-	/* inverse of mirrorball_to_direction */
-	dir.y -= 1.0f;
-
-	float div = 2.0f*sqrt(max(-0.5f*dir.y, 0.0f));
-	if(div > 0.0f)
-		dir /= div;
-
-	float u = 0.5f*(dir.x + 1.0f);
-	float v = 0.5f*(dir.z + 1.0f);
-
-	return make_float2(u, v);
-}
-
 CCL_NAMESPACE_END
 
 #endif /* __KERNEL_MONTECARLO_CL__ */

Modified: branches/meshdata_transfer/intern/cycles/kernel/kernel_path.h
===================================================================
--- branches/meshdata_transfer/intern/cycles/kernel/kernel_path.h	2012-05-08 00:09:00 UTC (rev 46406)
+++ branches/meshdata_transfer/intern/cycles/kernel/kernel_path.h	2012-05-08 00:12:47 UTC (rev 46407)
@@ -18,6 +18,7 @@
 
 #include "kernel_differential.h"
 #include "kernel_montecarlo.h"
+#include "kernel_projection.h"
 #include "kernel_object.h"
 #include "kernel_triangle.h"
 #ifdef __QBVH__

Modified: branches/meshdata_transfer/intern/cycles/kernel/kernel_triangle.h
===================================================================
--- branches/meshdata_transfer/intern/cycles/kernel/kernel_triangle.h	2012-05-08 00:09:00 UTC (rev 46406)
+++ branches/meshdata_transfer/intern/cycles/kernel/kernel_triangle.h	2012-05-08 00:12:47 UTC (rev 46407)
@@ -217,16 +217,43 @@
 	tfm = object_fetch_transform(kg, sd->object, TIME_INVALID, OBJECT_TRANSFORM_MOTION_POST);
 	motion_post = transform_point(&tfm, motion_post);
 
-	/* camera motion */
-	tfm = kernel_data.cam.worldtoraster;
-	float3 P = transform_perspective(&tfm, sd->P);
+	float3 P;
 
-	tfm = kernel_data.cam.motion.pre;
-	motion_pre = transform_perspective(&tfm, motion_pre) - P;
+	/* camera motion, for perspective/orthographic motion.pre/post will be a
+	   world-to-raster matrix, for panorama it's world-to-camera */
+	if (kernel_data.cam.type != CAMERA_PANORAMA) {
+		tfm = kernel_data.cam.worldtoraster;
+		P = transform_perspective(&tfm, sd->P);
 
-	tfm = kernel_data.cam.motion.post;
-	motion_post = P - transform_perspective(&tfm, motion_post);
+		tfm = kernel_data.cam.motion.pre;
+		motion_pre = transform_perspective(&tfm, motion_pre);
 
+		tfm = kernel_data.cam.motion.post;
+		motion_post = transform_perspective(&tfm, motion_post);
+	}
+	else {
+		tfm = kernel_data.cam.worldtocamera;
+		P = normalize(transform_point(&tfm, sd->P));
+		P = float2_to_float3(direction_to_panorama(kg, P));
+		P.x *= kernel_data.cam.width;
+		P.y *= kernel_data.cam.height;
+
+		tfm = kernel_data.cam.motion.pre;
+		motion_pre = normalize(transform_point(&tfm, motion_pre));
+		motion_pre = float2_to_float3(direction_to_panorama(kg, motion_pre));
+		motion_pre.x *= kernel_data.cam.width;
+		motion_pre.y *= kernel_data.cam.height;
+
+		tfm = kernel_data.cam.motion.post;
+		motion_post = normalize(transform_point(&tfm, motion_post));
+		motion_post = float2_to_float3(direction_to_panorama(kg, motion_post));
+		motion_post.x *= kernel_data.cam.width;
+		motion_post.y *= kernel_data.cam.height;
+	}
+
+	motion_pre = motion_pre - P;
+	motion_post = P - motion_post;
+
 	return make_float4(motion_pre.x, motion_pre.y, motion_post.x, motion_post.y);
 }
 

Modified: branches/meshdata_transfer/intern/cycles/kernel/kernel_types.h
===================================================================
--- branches/meshdata_transfer/intern/cycles/kernel/kernel_types.h	2012-05-08 00:09:00 UTC (rev 46406)
+++ branches/meshdata_transfer/intern/cycles/kernel/kernel_types.h	2012-05-08 00:12:47 UTC (rev 46407)
@@ -476,6 +476,13 @@
 	float nearclip;
 	float cliplength;
 
+	/* sensor size */
+	float sensorwidth;
+	float sensorheight;
+
+	/* render size */
+	float width, height;
+
 	/* more matrices */
 	Transform screentoworld;
 	Transform rastertoworld;

Modified: branches/meshdata_transfer/intern/cycles/kernel/svm/svm_tex_coord.h
===================================================================
--- branches/meshdata_transfer/intern/cycles/kernel/svm/svm_tex_coord.h	2012-05-08 00:09:00 UTC (rev 46406)

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list