[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56503] branches/vgroup_modifiers: svn merge -r 56442:56502 https://svn.blender.org/svnroot/bf-blender/trunk/ blender

Bastien Montagne montagne29 at wanadoo.fr
Sun May 5 17:45:52 CEST 2013


Revision: 56503
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56503
Author:   mont29
Date:     2013-05-05 15:45:52 +0000 (Sun, 05 May 2013)
Log Message:
-----------
svn merge -r 56442:56502 https://svn.blender.org/svnroot/bf-blender/trunk/blender

Modified Paths:
--------------
    branches/vgroup_modifiers/doc/python_api/rst/include__bmesh.rst
    branches/vgroup_modifiers/doc/python_api/rst/info_quickstart.rst
    branches/vgroup_modifiers/intern/cycles/blender/blender_mesh.cpp
    branches/vgroup_modifiers/intern/cycles/blender/blender_python.cpp
    branches/vgroup_modifiers/intern/cycles/blender/blender_util.h
    branches/vgroup_modifiers/intern/cycles/kernel/closure/bsdf_microfacet.h
    branches/vgroup_modifiers/intern/cycles/kernel/kernel_camera.h
    branches/vgroup_modifiers/intern/cycles/kernel/kernel_differential.h
    branches/vgroup_modifiers/intern/cycles/kernel/kernel_displace.h
    branches/vgroup_modifiers/intern/cycles/kernel/kernel_emission.h
    branches/vgroup_modifiers/intern/cycles/kernel/kernel_path.h
    branches/vgroup_modifiers/intern/cycles/kernel/kernel_shader.h
    branches/vgroup_modifiers/intern/cycles/kernel/kernel_subsurface.h
    branches/vgroup_modifiers/intern/locale/boost_locale_wrapper.cpp
    branches/vgroup_modifiers/release/datafiles/preview_cycles.blend
    branches/vgroup_modifiers/release/scripts/freestyle/style_modules/shaders.py
    branches/vgroup_modifiers/release/scripts/modules/nodeitems_utils.py
    branches/vgroup_modifiers/release/scripts/startup/bl_ui/properties_paint_common.py
    branches/vgroup_modifiers/release/scripts/startup/bl_ui/space_image.py
    branches/vgroup_modifiers/release/scripts/startup/bl_ui/space_view3d.py
    branches/vgroup_modifiers/release/scripts/startup/bl_ui/space_view3d_toolbar.py
    branches/vgroup_modifiers/release/scripts/templates_py/operator_uv.py
    branches/vgroup_modifiers/source/blender/blenkernel/BKE_DerivedMesh.h
    branches/vgroup_modifiers/source/blender/blenkernel/BKE_modifier.h
    branches/vgroup_modifiers/source/blender/blenkernel/intern/DerivedMesh.c
    branches/vgroup_modifiers/source/blender/blenkernel/intern/brush.c
    branches/vgroup_modifiers/source/blender/blenkernel/intern/displist.c
    branches/vgroup_modifiers/source/blender/blenkernel/intern/mesh.c
    branches/vgroup_modifiers/source/blender/blenkernel/intern/object.c
    branches/vgroup_modifiers/source/blender/blenlib/BLI_utildefines.h
    branches/vgroup_modifiers/source/blender/blenlib/intern/fileops.c
    branches/vgroup_modifiers/source/blender/blenlib/intern/math_geom.c
    branches/vgroup_modifiers/source/blender/collada/collada_utils.cpp
    branches/vgroup_modifiers/source/blender/editors/include/ED_view3d.h
    branches/vgroup_modifiers/source/blender/editors/include/UI_interface.h
    branches/vgroup_modifiers/source/blender/editors/interface/interface_handlers.c
    branches/vgroup_modifiers/source/blender/editors/interface/interface_intern.h
    branches/vgroup_modifiers/source/blender/editors/interface/interface_layout.c
    branches/vgroup_modifiers/source/blender/editors/interface/interface_regions.c
    branches/vgroup_modifiers/source/blender/editors/interface/interface_templates.c
    branches/vgroup_modifiers/source/blender/editors/mesh/editmesh_knife.c
    branches/vgroup_modifiers/source/blender/editors/mesh/editmesh_knife_project.c
    branches/vgroup_modifiers/source/blender/editors/mesh/editmesh_loopcut.c
    branches/vgroup_modifiers/source/blender/editors/object/object_add.c
    branches/vgroup_modifiers/source/blender/editors/object/object_modifier.c
    branches/vgroup_modifiers/source/blender/editors/object/object_relations.c
    branches/vgroup_modifiers/source/blender/editors/render/render_opengl.c
    branches/vgroup_modifiers/source/blender/editors/sculpt_paint/paint_cursor.c
    branches/vgroup_modifiers/source/blender/editors/sculpt_paint/paint_ops.c
    branches/vgroup_modifiers/source/blender/editors/sculpt_paint/paint_stroke.c
    branches/vgroup_modifiers/source/blender/editors/sculpt_paint/paint_vertex.c
    branches/vgroup_modifiers/source/blender/editors/space_node/drawnode.c
    branches/vgroup_modifiers/source/blender/editors/space_view3d/view3d_draw.c
    branches/vgroup_modifiers/source/blender/editors/space_view3d/view3d_edit.c
    branches/vgroup_modifiers/source/blender/editors/space_view3d/view3d_fly.c
    branches/vgroup_modifiers/source/blender/editors/space_view3d/view3d_select.c
    branches/vgroup_modifiers/source/blender/editors/uvedit/uvedit_unwrap_ops.c
    branches/vgroup_modifiers/source/blender/freestyle/intern/application/AppCanvas.cpp
    branches/vgroup_modifiers/source/blender/freestyle/intern/application/AppConfig.cpp
    branches/vgroup_modifiers/source/blender/freestyle/intern/application/Controller.cpp
    branches/vgroup_modifiers/source/blender/freestyle/intern/blender_interface/BlenderTextureManager.cpp
    branches/vgroup_modifiers/source/blender/freestyle/intern/system/PythonInterpreter.h
    branches/vgroup_modifiers/source/blender/freestyle/intern/system/StringUtils.cpp
    branches/vgroup_modifiers/source/blender/freestyle/intern/system/StringUtils.h
    branches/vgroup_modifiers/source/blender/gpu/intern/gpu_buffers.c
    branches/vgroup_modifiers/source/blender/gpu/intern/gpu_material.c
    branches/vgroup_modifiers/source/blender/imbuf/intern/jpeg.c
    branches/vgroup_modifiers/source/blender/imbuf/intern/openexr/openexr_api.cpp
    branches/vgroup_modifiers/source/blender/makesrna/RNA_access.h
    branches/vgroup_modifiers/source/blender/makesrna/intern/rna_access.c
    branches/vgroup_modifiers/source/blender/makesrna/intern/rna_internal.h
    branches/vgroup_modifiers/source/blender/makesrna/intern/rna_key.c
    branches/vgroup_modifiers/source/blender/makesrna/intern/rna_main_api.c
    branches/vgroup_modifiers/source/blender/makesrna/intern/rna_mesh.c
    branches/vgroup_modifiers/source/blender/makesrna/intern/rna_modifier.c
    branches/vgroup_modifiers/source/blender/makesrna/intern/rna_object_api.c
    branches/vgroup_modifiers/source/blender/makesrna/intern/rna_sequencer.c
    branches/vgroup_modifiers/source/blender/makesrna/intern/rna_texture.c
    branches/vgroup_modifiers/source/blender/makesrna/intern/rna_wm.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_array.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_bevel.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_boolean_util.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_dynamicpaint.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_edgesplit.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_mirror.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_ocean.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_particleinstance.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_screw.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_skin.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_solidify.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_subsurf.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_triangulate.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_uvproject.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_uvwarp.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_weightvgedit.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_weightvgmix.c
    branches/vgroup_modifiers/source/blender/modifiers/intern/MOD_weightvgproximity.c
    branches/vgroup_modifiers/source/blender/python/bmesh/bmesh_py_ops_call.c
    branches/vgroup_modifiers/source/blender/python/bmesh/bmesh_py_types.c
    branches/vgroup_modifiers/source/blender/quicktime/apple/qtkit_export.m
    branches/vgroup_modifiers/source/blender/windowmanager/intern/wm_event_system.c
    branches/vgroup_modifiers/source/gameengine/Converter/BL_BlenderDataConversion.cpp
    branches/vgroup_modifiers/source/gameengine/Expressions/ListValue.cpp
    branches/vgroup_modifiers/source/gameengine/Expressions/Value.cpp
    branches/vgroup_modifiers/source/gameengine/Expressions/Value.h
    branches/vgroup_modifiers/source/gameengine/Ketsji/KX_GameObject.cpp
    branches/vgroup_modifiers/source/gameengine/Ketsji/KX_PolyProxy.cpp
    branches/vgroup_modifiers/source/gameengine/Rasterizer/RAS_Polygon.cpp
    branches/vgroup_modifiers/source/gameengine/Rasterizer/RAS_Polygon.h

Added Paths:
-----------
    branches/vgroup_modifiers/release/scripts/templates_osl/ramp_closure.osl
    branches/vgroup_modifiers/release/scripts/templates_osl/temperature_to_rgb.osl
    branches/vgroup_modifiers/release/scripts/templates_osl/toon_closure.osl
    branches/vgroup_modifiers/release/scripts/templates_osl/wavelength_to_rgb.osl

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


Property changes on: branches/vgroup_modifiers
___________________________________________________________________
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,48089,48092,48551-48552,48679,48790,48792-48793,49076,49087,49292,49294,49466,49894,50052,50126,52854-52856,54573
/trunk/blender:38694-38739,38741-39198,39200-39651,39653-39988,39990-43541,43543-56442
   + /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
/trunk/blender:38694-38739,38741-39198,39200-39651,39653-39988,39990-43541,43543-56502

Modified: branches/vgroup_modifiers/doc/python_api/rst/include__bmesh.rst
===================================================================
--- branches/vgroup_modifiers/doc/python_api/rst/include__bmesh.rst	2013-05-05 15:39:37 UTC (rev 56502)
+++ branches/vgroup_modifiers/doc/python_api/rst/include__bmesh.rst	2013-05-05 15:45:52 UTC (rev 56503)
@@ -47,7 +47,7 @@
 Example Script
 --------------
 
-.. literalinclude:: ../../../release/scripts/templates/bmesh_simple.py
+.. literalinclude:: ../../../release/scripts/templates_py/bmesh_simple.py
 
 
 Stand-Alone Module

Modified: branches/vgroup_modifiers/doc/python_api/rst/info_quickstart.rst
===================================================================
--- branches/vgroup_modifiers/doc/python_api/rst/info_quickstart.rst	2013-05-05 15:39:37 UTC (rev 56502)
+++ branches/vgroup_modifiers/doc/python_api/rst/info_quickstart.rst	2013-05-05 15:45:52 UTC (rev 56503)
@@ -285,7 +285,7 @@
 Example Operator
 ----------------
 
-.. literalinclude:: ../../../release/scripts/templates/operator_simple.py
+.. literalinclude:: ../../../release/scripts/templates_py/operator_simple.py
 
 Once this script runs, ``SimpleOperator`` is registered with Blender and can be called from the operator search popup or added to the toolbar.
 
@@ -318,7 +318,7 @@
 
 Panels register themselves as a class, like an operator. Notice the extra **bl_** variables used to set the context they display in.
 
-.. literalinclude:: ../../../release/scripts/templates/ui_panel_simple.py
+.. literalinclude:: ../../../release/scripts/templates_py/ui_panel_simple.py
 
 To run the script:
 

Modified: branches/vgroup_modifiers/intern/cycles/blender/blender_mesh.cpp
===================================================================
--- branches/vgroup_modifiers/intern/cycles/blender/blender_mesh.cpp	2013-05-05 15:39:37 UTC (rev 56502)
+++ branches/vgroup_modifiers/intern/cycles/blender/blender_mesh.cpp	2013-05-05 15:45:52 UTC (rev 56503)
@@ -336,7 +336,7 @@
 		size_t i = 0;
 
 		for(b_mesh.vertices.begin(v); v != b_mesh.vertices.end(); ++v)
-			generated[i++] = get_float3(v->co())*size - loc;
+			generated[i++] = get_float3(v->undeformed_co())*size - loc;
 	}
 }
 
@@ -435,7 +435,8 @@
 	mesh_synced.insert(mesh);
 
 	/* create derived mesh */
-	BL::Mesh b_mesh = object_to_mesh(b_data, b_ob, b_scene, true, !preview);
+	bool need_undeformed = mesh->need_attribute(scene, ATTR_STD_GENERATED);
+	BL::Mesh b_mesh = object_to_mesh(b_data, b_ob, b_scene, true, !preview, need_undeformed);
 	PointerRNA cmesh = RNA_pointer_get(&b_ob_data.ptr, "cycles");
 
 	vector<Mesh::Triangle> oldtriangle = mesh->triangles;
@@ -507,7 +508,7 @@
 		return;
 
 	/* get derived mesh */
-	BL::Mesh b_mesh = object_to_mesh(b_data, b_ob, b_scene, true, !preview);
+	BL::Mesh b_mesh = object_to_mesh(b_data, b_ob, b_scene, true, !preview, false);
 
 	if(b_mesh) {
 		BL::Mesh::vertices_iterator v;

Modified: branches/vgroup_modifiers/intern/cycles/blender/blender_python.cpp
===================================================================
--- branches/vgroup_modifiers/intern/cycles/blender/blender_python.cpp	2013-05-05 15:39:37 UTC (rev 56502)
+++ branches/vgroup_modifiers/intern/cycles/blender/blender_python.cpp	2013-05-05 15:45:52 UTC (rev 56503)
@@ -258,6 +258,7 @@
 		
 		if(param->isclosure) {
 			socket_type = "NodeSocketShader";
+			data_type = BL::NodeSocket::type_SHADER;
 		}
 		else if(param->type.vecsemantics == TypeDesc::COLOR) {
 			socket_type = "NodeSocketColor";

Modified: branches/vgroup_modifiers/intern/cycles/blender/blender_util.h
===================================================================
--- branches/vgroup_modifiers/intern/cycles/blender/blender_util.h	2013-05-05 15:39:37 UTC (rev 56502)
+++ branches/vgroup_modifiers/intern/cycles/blender/blender_util.h	2013-05-05 15:45:52 UTC (rev 56503)
@@ -39,9 +39,9 @@
 
 CCL_NAMESPACE_BEGIN
 
-static inline BL::Mesh object_to_mesh(BL::BlendData data, BL::Object object, BL::Scene scene, bool apply_modifiers, bool render)
+static inline BL::Mesh object_to_mesh(BL::BlendData data, BL::Object object, BL::Scene scene, bool apply_modifiers, bool render, bool calc_undeformed)
 {
-	return data.meshes.new_from_object(scene, object, apply_modifiers, (render)? 2: 1, true);
+	return data.meshes.new_from_object(scene, object, apply_modifiers, (render)? 2: 1, true, calc_undeformed);
 }
 
 static inline void colorramp_to_array(BL::ColorRamp ramp, float4 *data, int size)

Modified: branches/vgroup_modifiers/intern/cycles/kernel/closure/bsdf_microfacet.h
===================================================================
--- branches/vgroup_modifiers/intern/cycles/kernel/closure/bsdf_microfacet.h	2013-05-05 15:39:37 UTC (rev 56502)
+++ branches/vgroup_modifiers/intern/cycles/kernel/closure/bsdf_microfacet.h	2013-05-05 15:45:52 UTC (rev 56503)
@@ -46,7 +46,7 @@
 {
 	float ag = sc->data0;
 
-	float m_ag = clamp(ag, 1e-3f, 1.0f);
+	float m_ag = clamp(ag, 0.0f, 1.0f);
 
 	sc->data0 = m_ag;
 	sc->type = CLOSURE_BSDF_MICROFACET_GGX_ID;
@@ -59,7 +59,7 @@
 	float ag = sc->data0;
 	float eta = sc->data1;
 
-	float m_ag = clamp(ag, 1e-3f, 1.0f);
+	float m_ag = clamp(ag, 0.0f, 1.0f);
 	float m_eta = eta;
 
 	sc->data0 = m_ag;
@@ -78,11 +78,12 @@
 
 __device float3 bsdf_microfacet_ggx_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf)
 {
-	float m_ag = sc->data0;
+	float m_ag = max(sc->data0, 1e-4f);
 	int m_refractive = sc->type == CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID;
 	float3 N = sc->N;
 
-	if(m_refractive) return make_float3 (0, 0, 0);
+	if(m_refractive || m_ag <= 1e-4f)
+		return make_float3 (0, 0, 0);
 	float cosNO = dot(N, I);
 	float cosNI = dot(N, omega_in);
 	if(cosNI > 0 && cosNO > 0) {
@@ -114,12 +115,13 @@
 
 __device float3 bsdf_microfacet_ggx_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf)
 {
-	float m_ag = sc->data0;
+	float m_ag = max(sc->data0, 1e-4f);
 	float m_eta = sc->data1;
 	int m_refractive = sc->type == CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID;
 	float3 N = sc->N;
 
-	if(!m_refractive) return make_float3 (0, 0, 0);
+	if(!m_refractive || m_ag <= 1e-4f)
+		return make_float3 (0, 0, 0);
 	float cosNO = dot(N, I);
 	float cosNI = dot(N, omega_in);
 	if(cosNO <= 0 || cosNI >= 0)
@@ -176,26 +178,34 @@
 				// eq. 39 - compute actual reflected direction
 				*omega_in = 2 * cosMO * m - I;
 				if(dot(Ng, *omega_in) > 0) {
-					// microfacet normal is visible to this ray
-					// eq. 33
-					float cosThetaM2 = cosThetaM * cosThetaM;
-					float cosThetaM4 = cosThetaM2 * cosThetaM2;
-					float D = alpha2 / (M_PI_F * cosThetaM4 * (alpha2 + tanThetaM2) * (alpha2 + tanThetaM2));
-					// eq. 24
-					float pm = D * cosThetaM;
-					// convert into pdf of the sampled direction
-					// eq. 38 - but see also:
-					// eq. 17 in http://www.graphics.cornell.edu/~bjw/wardnotes.pdf
-					*pdf = pm * 0.25f / cosMO;
-					// eval BRDF*cosNI
-					float cosNI = dot(N, *omega_in);
-					// eq. 34: now calculate G1(i,m) and G1(o,m)
-					float G1o = 2 / (1 + safe_sqrtf(1 + alpha2 * (1 - cosNO * cosNO) / (cosNO * cosNO)));
-					float G1i = 2 / (1 + safe_sqrtf(1 + alpha2 * (1 - cosNI * cosNI) / (cosNI * cosNI))); 
-					float G = G1o * G1i;
-					// eq. 20: (F*G*D)/(4*in*on)
-					float out = (G * D) * 0.25f / cosNO;
-					*eval = make_float3(out, out, out);
+					if (m_ag <= 1e-4f) {
+						// some high number for MIS
+						*pdf = 1e6f;
+						*eval = make_float3(1e6f, 1e6f, 1e6f);
+					}
+					else {
+						// microfacet normal is visible to this ray
+						// eq. 33
+						float cosThetaM2 = cosThetaM * cosThetaM;
+						float cosThetaM4 = cosThetaM2 * cosThetaM2;
+						float D = alpha2 / (M_PI_F * cosThetaM4 * (alpha2 + tanThetaM2) * (alpha2 + tanThetaM2));
+						// eq. 24
+						float pm = D * cosThetaM;
+						// convert into pdf of the sampled direction
+						// eq. 38 - but see also:
+						// eq. 17 in http://www.graphics.cornell.edu/~bjw/wardnotes.pdf
+						*pdf = pm * 0.25f / cosMO;
+						// eval BRDF*cosNI
+						float cosNI = dot(N, *omega_in);
+						// eq. 34: now calculate G1(i,m) and G1(o,m)
+						float G1o = 2 / (1 + safe_sqrtf(1 + alpha2 * (1 - cosNO * cosNO) / (cosNO * cosNO)));
+						float G1i = 2 / (1 + safe_sqrtf(1 + alpha2 * (1 - cosNI * cosNI) / (cosNI * cosNI))); 
+						float G = G1o * G1i;
+						// eq. 20: (F*G*D)/(4*in*on)
+						float out = (G * D) * 0.25f / cosNO;
+						*eval = make_float3(out, out, out);
+					}
+
 #ifdef __RAY_DIFFERENTIALS__
 					*domega_in_dx = (2 * dot(m, dIdx)) * m - dIdx;
 					*domega_in_dy = (2 * dot(m, dIdy)) * m - dIdy;
@@ -224,27 +234,35 @@
 				*domega_in_dx = dTdx;
 				*domega_in_dy = dTdy;
 #endif
-				// eq. 33
-				float cosThetaM2 = cosThetaM * cosThetaM;

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list