Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-08-01 16:13:24 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-08-01 19:42:59 +0300
commitebbeddd2f4617505bb2e13b6d773a3da6bd327c4 (patch)
tree1cfc5c7747e4d37ba279e0ebc87a16c5b3946cb5 /intern/opensubdiv
parent08e6bccdf4a2114847194fbe8adcb1fc83a1746f (diff)
Subsurf: Use edge sharpness directly from converter
Seems it's behaving correct now, surely more tests needed, but this is required for now to move forward.
Diffstat (limited to 'intern/opensubdiv')
-rw-r--r--intern/opensubdiv/internal/opensubdiv_converter_factory.cc2
-rw-r--r--intern/opensubdiv/internal/opensubdiv_converter_internal.cc9
-rw-r--r--intern/opensubdiv/internal/opensubdiv_converter_internal.h4
-rw-r--r--intern/opensubdiv/internal/opensubdiv_topology_refiner.cc2
4 files changed, 2 insertions, 15 deletions
diff --git a/intern/opensubdiv/internal/opensubdiv_converter_factory.cc b/intern/opensubdiv/internal/opensubdiv_converter_factory.cc
index 06707cbf418..02b6e93a1ae 100644
--- a/intern/opensubdiv/internal/opensubdiv_converter_factory.cc
+++ b/intern/opensubdiv/internal/opensubdiv_converter_factory.cc
@@ -336,7 +336,7 @@ inline bool TopologyRefinerFactory<TopologyRefinerData>::assignComponentTags(
const int num_edges = converter->getNumEdges(converter);
for (int edge_index = 0; edge_index < num_edges; ++edge_index) {
const float sharpness =
- opensubdiv_capi::getCompatibleEdgeSharpness(converter, edge_index);
+ converter->getEdgeSharpness(converter, edge_index);
setBaseEdgeSharpness(refiner, edge_index, sharpness);
}
// OpenSubdiv expects non-manifold vertices to be sharp but at the time it
diff --git a/intern/opensubdiv/internal/opensubdiv_converter_internal.cc b/intern/opensubdiv/internal/opensubdiv_converter_internal.cc
index 32815dc34dc..2f7a7109ea1 100644
--- a/intern/opensubdiv/internal/opensubdiv_converter_internal.cc
+++ b/intern/opensubdiv/internal/opensubdiv_converter_internal.cc
@@ -84,13 +84,4 @@ getCAPIFVarLinearInterpolationFromOSD(
return OSD_FVAR_LINEAR_INTERPOLATION_NONE;
}
-float getCompatibleEdgeSharpness(const OpenSubdiv_Converter* converter,
- int edge_index) {
- if (converter->getNumEdgeFaces(converter, edge_index) == 2) {
- return converter->getEdgeSharpness(converter, edge_index);
- } else {
- return OpenSubdiv::Sdc::Crease::SHARPNESS_INFINITE;
- }
-}
-
} // namespace opensubdiv_capi
diff --git a/intern/opensubdiv/internal/opensubdiv_converter_internal.h b/intern/opensubdiv/internal/opensubdiv_converter_internal.h
index c47cdd1004d..411514c45dc 100644
--- a/intern/opensubdiv/internal/opensubdiv_converter_internal.h
+++ b/intern/opensubdiv/internal/opensubdiv_converter_internal.h
@@ -46,10 +46,6 @@ OpenSubdiv_FVarLinearInterpolation
getCAPIFVarLinearInterpolationFromOSD(
OpenSubdiv::Sdc::Options::FVarLinearInterpolation linear_interpolation);
-// Get edge sharpness in a way which makes OpenSubdiv happy.
-float getCompatibleEdgeSharpness(const OpenSubdiv_Converter* converter,
- int edge_index);
-
} // namespace opensubdiv_capi
#endif // OPENSUBDIV_CONVERTER_INTERNAL_H_
diff --git a/intern/opensubdiv/internal/opensubdiv_topology_refiner.cc b/intern/opensubdiv/internal/opensubdiv_topology_refiner.cc
index 93f6fdc14a1..5e1e0bd86b3 100644
--- a/intern/opensubdiv/internal/opensubdiv_topology_refiner.cc
+++ b/intern/opensubdiv/internal/opensubdiv_topology_refiner.cc
@@ -340,7 +340,7 @@ bool checkEdgeSharpnessMatch(
for (int edge_index = 0; edge_index < num_edges; ++edge_index) {
const float sharpness = base_level.GetEdgeSharpness(edge_index);
const float conv_sharpness =
- opensubdiv_capi::getCompatibleEdgeSharpness(converter, edge_index);
+ converter->getEdgeSharpness(converter, edge_index);
if (sharpness != conv_sharpness) {
return false;
}