[Bf-blender-cvs] [200212079db] blender2.8: Subsurf: Better crease which represents sharp edges

Sergey Sharybin noreply at git.blender.org
Thu Aug 2 12:25:04 CEST 2018


Commit: 200212079dbadacbe9ddab6a2b5b5ee6824bf76c
Author: Sergey Sharybin
Date:   Thu Aug 2 12:22:55 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB200212079dbadacbe9ddab6a2b5b5ee6824bf76c

Subsurf: Better crease which represents sharp edges

Enabled infinite sharp patches for topology refiner and evaluator,
which allows to have sharp edge at first subdivision level.

Also tweaked crease export from Blender to OpenSubdiv to have more
artistic control over the whole 0..1 range.

===================================================================

M	intern/opensubdiv/internal/opensubdiv_evaluator_internal.cc
M	source/blender/blenkernel/intern/subdiv_converter_mesh.c

===================================================================

diff --git a/intern/opensubdiv/internal/opensubdiv_evaluator_internal.cc b/intern/opensubdiv/internal/opensubdiv_evaluator_internal.cc
index 31e68492587..33df7a45e39 100644
--- a/intern/opensubdiv/internal/opensubdiv_evaluator_internal.cc
+++ b/intern/opensubdiv/internal/opensubdiv_evaluator_internal.cc
@@ -713,7 +713,7 @@ OpenSubdiv_EvaluatorInternal* openSubdiv_createEvaluatorInternal(
   if (is_adaptive) {
     TopologyRefiner::AdaptiveOptions options(level);
     options.considerFVarChannels = has_face_varying_data;
-    options.useInfSharpPatch = false;
+    options.useInfSharpPatch = true;
     refiner->RefineAdaptive(options);
   } else {
     TopologyRefiner::UniformOptions options(level);
@@ -763,7 +763,7 @@ vector<const StencilTable*> all_face_varying_stencils;
   // subsurf code.
   PatchTableFactory::Options patch_options(level);
   patch_options.SetEndCapType(PatchTableFactory::Options::ENDCAP_BSPLINE_BASIS);
-  patch_options.useInfSharpPatch = false;
+  patch_options.useInfSharpPatch = true;
   patch_options.generateFVarTables = has_face_varying_data;
   patch_options.generateFVarLegacyLinearPatches = false;
   const PatchTable* patch_table = PatchTableFactory::Create(
diff --git a/source/blender/blenkernel/intern/subdiv_converter_mesh.c b/source/blender/blenkernel/intern/subdiv_converter_mesh.c
index 963f403e8d3..c5fb8afb6cd 100644
--- a/source/blender/blenkernel/intern/subdiv_converter_mesh.c
+++ b/source/blender/blenkernel/intern/subdiv_converter_mesh.c
@@ -157,7 +157,7 @@ static float get_edge_sharpness(const OpenSubdiv_Converter *converter,
 	        storage->manifold_edge_index_reverse[manifold_edge_index];
 	const MEdge *medge = storage->mesh->medge;
 	const float edge_crease =  (float)medge[edge_index].crease / 255.0f;
-	return edge_crease * storage->settings.level * 10;
+	return edge_crease * edge_crease * 10.0f;
 }



More information about the Bf-blender-cvs mailing list