[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59797] branches/soc-2013-depsgraph_mt: Merging r59766 through r59796 from trunk into soc-2013-depsgraph_mt

Sergey Sharybin sergey.vfx at gmail.com
Wed Sep 4 13:02:09 CEST 2013


Revision: 59797
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59797
Author:   nazgul
Date:     2013-09-04 11:02:08 +0000 (Wed, 04 Sep 2013)
Log Message:
-----------
Merging r59766 through r59796 from trunk into soc-2013-depsgraph_mt

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

Modified Paths:
--------------
    branches/soc-2013-depsgraph_mt/intern/cycles/blender/blender_sync.cpp
    branches/soc-2013-depsgraph_mt/intern/cycles/kernel/closure/bsdf.h
    branches/soc-2013-depsgraph_mt/intern/cycles/kernel/closure/bssrdf.h
    branches/soc-2013-depsgraph_mt/intern/cycles/kernel/kernel_subsurface.h
    branches/soc-2013-depsgraph_mt/intern/cycles/kernel/osl/osl_bssrdf.cpp
    branches/soc-2013-depsgraph_mt/intern/cycles/kernel/osl/osl_bssrdf.h
    branches/soc-2013-depsgraph_mt/intern/cycles/kernel/osl/osl_closures.cpp
    branches/soc-2013-depsgraph_mt/intern/cycles/kernel/osl/osl_closures.h
    branches/soc-2013-depsgraph_mt/intern/cycles/kernel/osl/osl_services.cpp
    branches/soc-2013-depsgraph_mt/intern/cycles/kernel/osl/osl_shader.cpp
    branches/soc-2013-depsgraph_mt/intern/cycles/kernel/shaders/node_subsurface_scattering.osl
    branches/soc-2013-depsgraph_mt/intern/cycles/kernel/shaders/stdosl.h
    branches/soc-2013-depsgraph_mt/intern/cycles/kernel/svm/svm_closure.h
    branches/soc-2013-depsgraph_mt/intern/cycles/render/camera.cpp
    branches/soc-2013-depsgraph_mt/intern/cycles/render/mesh.cpp
    branches/soc-2013-depsgraph_mt/intern/cycles/render/nodes.cpp
    branches/soc-2013-depsgraph_mt/intern/cycles/render/nodes.h
    branches/soc-2013-depsgraph_mt/intern/cycles/render/object.cpp
    branches/soc-2013-depsgraph_mt/intern/cycles/render/scene.h
    branches/soc-2013-depsgraph_mt/intern/cycles/render/session.cpp
    branches/soc-2013-depsgraph_mt/intern/cycles/render/session.h
    branches/soc-2013-depsgraph_mt/intern/cycles/render/svm.cpp
    branches/soc-2013-depsgraph_mt/intern/cycles/render/tile.cpp
    branches/soc-2013-depsgraph_mt/intern/cycles/render/tile.h
    branches/soc-2013-depsgraph_mt/intern/cycles/util/util_task.cpp
    branches/soc-2013-depsgraph_mt/intern/ghost/intern/GHOST_EventManager.cpp
    branches/soc-2013-depsgraph_mt/release/scripts/startup/bl_ui/properties_physics_common.py
    branches/soc-2013-depsgraph_mt/release/scripts/startup/bl_ui/space_dopesheet.py
    branches/soc-2013-depsgraph_mt/source/blender/blenkernel/BKE_DerivedMesh.h
    branches/soc-2013-depsgraph_mt/source/blender/blenkernel/BKE_mesh.h
    branches/soc-2013-depsgraph_mt/source/blender/blenkernel/BKE_pointcache.h
    branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/DerivedMesh.c
    branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/collision.c
    branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/editmesh_bvh.c
    branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/mesh_validate.c
    branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/pointcache.c
    branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/sequencer.c
    branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/subsurf_ccg.c
    branches/soc-2013-depsgraph_mt/source/blender/blenlib/CMakeLists.txt
    branches/soc-2013-depsgraph_mt/source/blender/blenlib/PIL_time.h
    branches/soc-2013-depsgraph_mt/source/blender/blenloader/intern/readfile.c
    branches/soc-2013-depsgraph_mt/source/blender/bmesh/operators/bmo_beautify.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/animation/anim_channels_defines.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/animation/anim_filter.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/include/ED_screen_types.h
    branches/soc-2013-depsgraph_mt/source/blender/editors/mesh/editmesh_knife.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/render/render_internal.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/screen/area.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/screen/screen_edit.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/screen/screen_ops.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/sculpt_paint/paint_vertex.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/space_outliner/outliner_draw.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/space_outliner/outliner_tools.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/space_outliner/outliner_tree.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/space_sequencer/space_sequencer.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/space_view3d/drawvolume.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/space_view3d/view3d_fly.c
    branches/soc-2013-depsgraph_mt/source/blender/gpu/shaders/gpu_shader_material.glsl
    branches/soc-2013-depsgraph_mt/source/blender/makesrna/intern/rna_nodetree.c
    branches/soc-2013-depsgraph_mt/source/blender/makesrna/intern/rna_object_force.c
    branches/soc-2013-depsgraph_mt/source/blender/makesrna/intern/rna_scene.c
    branches/soc-2013-depsgraph_mt/source/blender/modifiers/intern/MOD_array.c
    branches/soc-2013-depsgraph_mt/source/blender/modifiers/intern/MOD_decimate.c
    branches/soc-2013-depsgraph_mt/source/blender/modifiers/intern/MOD_weightvgproximity.c
    branches/soc-2013-depsgraph_mt/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.c
    branches/soc-2013-depsgraph_mt/source/blender/render/intern/source/rendercore.c
    branches/soc-2013-depsgraph_mt/source/blender/render/intern/source/shadeoutput.c
    branches/soc-2013-depsgraph_mt/source/blender/windowmanager/WM_api.h

Added Paths:
-----------
    branches/soc-2013-depsgraph_mt/source/blender/blenlib/PIL_time_utildefines.h

Property Changed:
----------------
    branches/soc-2013-depsgraph_mt/
    branches/soc-2013-depsgraph_mt/source/blender/editors/interface/interface.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/space_outliner/


Property changes on: branches/soc-2013-depsgraph_mt
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_dev:58091-58422
/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,48089,48092,48551-48552,48679,48790,48792-48793,49076,49087,49292,49294,49466,49894,50052,50126,52854-52856,54573,58822,58989
/branches/soc-2013-dingto:57424,57487,57507,57525,57599,57670,57918-57919,57981,58091,58245,58253,58587,58772,58774-58775,58828,58835,59032,59214,59220,59251,59601
/tags/blender-2.67b-release/blender:57122
/trunk/blender:57395-59765
   + /branches/ge_dev:58091-58422
/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,48089,48092,48551-48552,48679,48790,48792-48793,49076,49087,49292,49294,49466,49894,50052,50126,52854-52856,54573,58822,58989
/branches/soc-2013-dingto:57424,57487,57507,57525,57599,57670,57918-57919,57981,58091,58245,58253,58587,58772,58774-58775,58828,58835,59032,59214,59220,59251,59601
/tags/blender-2.67b-release/blender:57122
/trunk/blender:57395-59796

Modified: branches/soc-2013-depsgraph_mt/intern/cycles/blender/blender_sync.cpp
===================================================================
--- branches/soc-2013-depsgraph_mt/intern/cycles/blender/blender_sync.cpp	2013-09-04 06:50:15 UTC (rev 59796)
+++ branches/soc-2013-depsgraph_mt/intern/cycles/blender/blender_sync.cpp	2013-09-04 11:02:08 UTC (rev 59797)
@@ -458,7 +458,7 @@
 		params.tile_size = make_int2(tile_x, tile_y);
 	}
 	
-	params.tile_order = RNA_enum_get(&cscene, "tile_order");
+	params.tile_order = (TileOrder)RNA_enum_get(&cscene, "tile_order");
 
 	params.start_resolution = get_int(cscene, "preview_start_resolution");
 

Modified: branches/soc-2013-depsgraph_mt/intern/cycles/kernel/closure/bsdf.h
===================================================================
--- branches/soc-2013-depsgraph_mt/intern/cycles/kernel/closure/bsdf.h	2013-09-04 06:50:15 UTC (rev 59796)
+++ branches/soc-2013-depsgraph_mt/intern/cycles/kernel/closure/bsdf.h	2013-09-04 11:02:08 UTC (rev 59797)
@@ -28,7 +28,9 @@
 #endif
 #include "../closure/bsdf_westin.h"
 #include "../closure/bsdf_toon.h"
+#ifdef __SUBSURFACE__
 #include "../closure/bssrdf.h"
+#endif
 
 CCL_NAMESPACE_BEGIN
 

Modified: branches/soc-2013-depsgraph_mt/intern/cycles/kernel/closure/bssrdf.h
===================================================================
--- branches/soc-2013-depsgraph_mt/intern/cycles/kernel/closure/bssrdf.h	2013-09-04 06:50:15 UTC (rev 59796)
+++ branches/soc-2013-depsgraph_mt/intern/cycles/kernel/closure/bssrdf.h	2013-09-04 11:02:08 UTC (rev 59797)
@@ -31,6 +31,7 @@
 	}
 	else {
 		sc->data1 = clamp(sc->data1, 0.0f, 1.0f); /* texture blur */
+		sc->T.x = clamp(sc->T.x, 0.0f, 1.0f); /* sharpness */
 		sc->type = type;
 
 		return SD_BSDF|SD_BSDF_HAS_EVAL|SD_BSSRDF;
@@ -95,17 +96,49 @@
 
 __device float bssrdf_cubic_eval(ShaderClosure *sc, float r)
 {
-	const float Rm = sc->data0;
+	const float sharpness = sc->T.x;
 
-	if(r >= Rm)
-		return 0.0f;
-	
-	/* integrate (2*pi*r * 10*(R - r)^3)/(pi * R^5) from 0 to R = 1 */
-	const float Rm5 = (Rm*Rm) * (Rm*Rm) * Rm;
-	const float f = Rm - min(r, Rm);
-	const float f3 = f*f*f;
+	if(sharpness == 0.0f) {
+		const float Rm = sc->data0;
 
-	return (f3 * 10.0f) / (Rm5 * M_PI_F);
+		if(r >= Rm)
+			return 0.0f;
+
+		/* integrate (2*pi*r * 10*(R - r)^3)/(pi * R^5) from 0 to R = 1 */
+		const float Rm5 = (Rm*Rm) * (Rm*Rm) * Rm;
+		const float f = Rm - r;
+		const float num = f*f*f;
+
+		return (10.0f * num) / (Rm5 * M_PI_F);
+
+	}
+	else {
+		float Rm = sc->data0*(1.0f + sharpness);
+
+		if(r >= Rm)
+			return 0.0f;
+
+		/* custom variation with extra sharpness, to match the previous code */
+		const float y = 1.0f/(1.0f + sharpness);
+		float Rmy, ry, ryinv;
+
+		if(sharpness == 1.0f) {
+			Rmy = sqrtf(Rm);
+			ry = sqrtf(r);
+			ryinv = (ry > 0.0f)? 1.0f/ry: 0.0f;
+		}
+		else {
+			Rmy = powf(Rm, y);
+			ry = powf(r, y);
+			ryinv = (r > 0.0f)? powf(r, 2.0f*y - 2.0f): 0.0f;
+		}
+
+		const float Rmy5 = (Rmy*Rmy) * (Rmy*Rmy) * Rmy;
+		const float f = Rmy - ry;
+		const float num = f*(f*f)*(y*ryinv);
+
+		return (10.0f * num) / (Rmy5 * M_PI_F);
+	}
 }
 
 __device float bssrdf_cubic_pdf(ShaderClosure *sc, float r)
@@ -143,9 +176,16 @@
 
 __device void bssrdf_cubic_sample(ShaderClosure *sc, float xi, float *r, float *h)
 {
-	const float Rm = sc->data0;
-	const float r_ = bssrdf_cubic_quintic_root_find(xi) * Rm;
+	float Rm = sc->data0;
+	float r_ = bssrdf_cubic_quintic_root_find(xi);
 
+	const float sharpness = sc->T.x;
+	if(sharpness != 0.0f) {
+		r_ = powf(r_, 1.0f + sharpness);
+		Rm *= (1.0f + sharpness);
+	}
+	
+	r_ *= Rm;
 	*r = r_;
 
 	/* h^2 + r^2 = Rm^2 */

Modified: branches/soc-2013-depsgraph_mt/intern/cycles/kernel/kernel_subsurface.h
===================================================================
--- branches/soc-2013-depsgraph_mt/intern/cycles/kernel/kernel_subsurface.h	2013-09-04 06:50:15 UTC (rev 59796)
+++ branches/soc-2013-depsgraph_mt/intern/cycles/kernel/kernel_subsurface.h	2013-09-04 11:02:08 UTC (rev 59797)
@@ -16,15 +16,11 @@
 
 CCL_NAMESPACE_BEGIN
 
-#include "closure/bssrdf.h"
-
 /* NEW BSSRDF: See "BSSRDF Importance Sampling", SIGGRAPH 2013 */
 
 /* TODO:
  * - test using power heuristic for combing bssrdfs
  * - try to reduce one sample model variance
- * - possible shade all hits for progressive integrator
- * - cubic and gaussian scale difference tweak
  */
 
 #define BSSRDF_MULTI_EVAL

Modified: branches/soc-2013-depsgraph_mt/intern/cycles/kernel/osl/osl_bssrdf.cpp
===================================================================
--- branches/soc-2013-depsgraph_mt/intern/cycles/kernel/osl/osl_bssrdf.cpp	2013-09-04 06:50:15 UTC (rev 59796)
+++ branches/soc-2013-depsgraph_mt/intern/cycles/kernel/osl/osl_bssrdf.cpp	2013-09-04 11:02:08 UTC (rev 59797)
@@ -56,10 +56,8 @@
 
 	void setup()
 	{
-		sc.type = CLOSURE_BSSRDF_COMPATIBLE_ID;
-		sc.prim = NULL;
+		sc.type = CLOSURE_BSSRDF_CUBIC_ID;
 		sc.data0 = fabsf(average(radius));
-		sc.data1 = 0.0f; // XXX texture blur
 	}
 
 	bool mergeable(const ClosurePrimitive *other) const
@@ -85,6 +83,19 @@
 	return params;
 }
 
+ClosureParam *closure_bssrdf_cubic_extended_params()
+{
+	static ClosureParam params[] = {
+		CLOSURE_FLOAT3_PARAM(CubicBSSRDFClosure, sc.N),
+		CLOSURE_FLOAT3_PARAM(CubicBSSRDFClosure, radius),
+		CLOSURE_FLOAT_PARAM(CubicBSSRDFClosure, sc.data1),
+		CLOSURE_FLOAT_PARAM(CubicBSSRDFClosure, sc.T.x),
+	    CLOSURE_STRING_KEYPARAM("label"),
+	    CLOSURE_FINISH_PARAM(CubicBSSRDFClosure)
+	};
+	return params;
+}
+
 CLOSURE_PREPARE(closure_bssrdf_cubic_prepare, CubicBSSRDFClosure)
 
 /* Gaussian */
@@ -97,9 +108,7 @@
 	void setup()
 	{
 		sc.type = CLOSURE_BSSRDF_GAUSSIAN_ID;
-		sc.prim = NULL;
 		sc.data0 = fabsf(average(radius));
-		sc.data1 = 0.0f; // XXX texture blurring!
 	}
 
 	bool mergeable(const ClosurePrimitive *other) const
@@ -125,6 +134,18 @@
 	return params;
 }
 
+ClosureParam *closure_bssrdf_gaussian_extended_params()
+{
+	static ClosureParam params[] = {
+		CLOSURE_FLOAT3_PARAM(GaussianBSSRDFClosure, sc.N),
+		CLOSURE_FLOAT3_PARAM(GaussianBSSRDFClosure, radius),
+		CLOSURE_FLOAT_PARAM(GaussianBSSRDFClosure, sc.data1),
+	    CLOSURE_STRING_KEYPARAM("label"),
+	    CLOSURE_FINISH_PARAM(GaussianBSSRDFClosure)
+	};
+	return params;
+}
+
 CLOSURE_PREPARE(closure_bssrdf_gaussian_prepare, GaussianBSSRDFClosure)
 
 CCL_NAMESPACE_END

Modified: branches/soc-2013-depsgraph_mt/intern/cycles/kernel/osl/osl_bssrdf.h
===================================================================
--- branches/soc-2013-depsgraph_mt/intern/cycles/kernel/osl/osl_bssrdf.h	2013-09-04 06:50:15 UTC (rev 59796)
+++ branches/soc-2013-depsgraph_mt/intern/cycles/kernel/osl/osl_bssrdf.h	2013-09-04 11:02:08 UTC (rev 59797)
@@ -48,7 +48,7 @@
 	ShaderClosure sc;
 	float3 radius;
 
-	CBSSRDFClosure() : OSL::ClosurePrimitive(BSSRDF) { }
+	CBSSRDFClosure() : OSL::ClosurePrimitive(BSSRDF) { memset(&sc, 0, sizeof(sc)); }
 	~CBSSRDFClosure() { }
 
 	int scattering() const { return LABEL_DIFFUSE; }

Modified: branches/soc-2013-depsgraph_mt/intern/cycles/kernel/osl/osl_closures.cpp
===================================================================
--- branches/soc-2013-depsgraph_mt/intern/cycles/kernel/osl/osl_closures.cpp	2013-09-04 06:50:15 UTC (rev 59796)
+++ branches/soc-2013-depsgraph_mt/intern/cycles/kernel/osl/osl_closures.cpp	2013-09-04 11:02:08 UTC (rev 59797)
@@ -221,6 +221,10 @@
 		closure_bssrdf_cubic_params(), closure_bssrdf_cubic_prepare);
 	register_closure(ss, "bssrdf_gaussian", id++,
 		closure_bssrdf_gaussian_params(), closure_bssrdf_gaussian_prepare);
+	register_closure(ss, "bssrdf_cubic", id++,
+		closure_bssrdf_cubic_extended_params(), closure_bssrdf_cubic_prepare);
+	register_closure(ss, "bssrdf_gaussian", id++,
+		closure_bssrdf_gaussian_extended_params(), closure_bssrdf_gaussian_prepare);
 }
 
 CCL_NAMESPACE_END

Modified: branches/soc-2013-depsgraph_mt/intern/cycles/kernel/osl/osl_closures.h
===================================================================
--- branches/soc-2013-depsgraph_mt/intern/cycles/kernel/osl/osl_closures.h	2013-09-04 06:50:15 UTC (rev 59796)
+++ branches/soc-2013-depsgraph_mt/intern/cycles/kernel/osl/osl_closures.h	2013-09-04 11:02:08 UTC (rev 59797)
@@ -52,6 +52,8 @@
 OSL::ClosureParam *closure_westin_sheen_params();
 OSL::ClosureParam *closure_bssrdf_cubic_params();
 OSL::ClosureParam *closure_bssrdf_gaussian_params();

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list