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-07-23 19:40:04 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-07-23 20:14:36 +0300
commitf6eccd367cf7ef504ebeef332b62a86d928f5542 (patch)
tree4210a5db20bc55ca4dd1b2e7c02c3d5dcdd6c83c /source/blender/blenkernel/intern/subdiv.c
parenta50e23ba791d3a3489c65321d85e567684e89b31 (diff)
Subsurf: Subdivide polygons to the same resolution
Previously it was ptex faces which were subdividing to the same resolution. This was looking like more details for non-quad faces, but was also causing discontinuity in the edge where quad touches non-quad polygon. Now ptex faces which are coming from non-quad faces are subdivided at a half of resolution, matching old behavior and solving discontinuity problem.
Diffstat (limited to 'source/blender/blenkernel/intern/subdiv.c')
-rw-r--r--source/blender/blenkernel/intern/subdiv.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/source/blender/blenkernel/intern/subdiv.c b/source/blender/blenkernel/intern/subdiv.c
index 794da2d3477..0bf969b7de2 100644
--- a/source/blender/blenkernel/intern/subdiv.c
+++ b/source/blender/blenkernel/intern/subdiv.c
@@ -42,23 +42,6 @@
# include "opensubdiv_topology_refiner_capi.h"
#endif
-#ifdef WITH_OPENSUBDIV
-static void update_subdiv_after_topology_change(Subdiv *subdiv)
-{
- /* Count ptex faces. */
- subdiv->num_ptex_faces = subdiv->topology_refiner->getNumPtexFaces(
- subdiv->topology_refiner);
- /* Initialize offset of base faces in ptex indices. */
- MEM_SAFE_FREE(subdiv->face_ptex_offset);
- subdiv->face_ptex_offset = MEM_malloc_arrayN(subdiv->num_ptex_faces,
- sizeof(int),
- "subdiv ptex offset");
- subdiv->topology_refiner->fillFacePtexIndexOffset(
- subdiv->topology_refiner,
- subdiv->face_ptex_offset);
-}
-#endif
-
Subdiv *BKE_subdiv_new_from_converter(const SubdivSettings *settings,
struct OpenSubdiv_Converter *converter)
{
@@ -79,7 +62,6 @@ Subdiv *BKE_subdiv_new_from_converter(const SubdivSettings *settings,
subdiv->settings = *settings;
subdiv->topology_refiner = osd_topology_refiner;
subdiv->evaluator = NULL;
- update_subdiv_after_topology_change(subdiv);
BKE_subdiv_stats_end(&stats, SUBDIV_STATS_TOPOLOGY_REFINER_CREATION_TIME);
subdiv->stats = stats;
return subdiv;
@@ -113,7 +95,6 @@ void BKE_subdiv_free(Subdiv *subdiv)
if (subdiv->topology_refiner != NULL) {
openSubdiv_deleteTopologyRefiner(subdiv->topology_refiner);
}
- MEM_SAFE_FREE(subdiv->face_ptex_offset);
MEM_freeN(subdiv);
#endif
}