diff options
Diffstat (limited to 'intern/cycles/blender/blender_mesh.cpp')
-rw-r--r-- | intern/cycles/blender/blender_mesh.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index e42af60c27b..0e46903a50c 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -365,7 +365,7 @@ static void create_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, const vector< } } -static void create_subd_mesh(Mesh *mesh, BL::Mesh b_mesh, PointerRNA *cmesh, const vector<uint>& used_shaders) +static void create_subd_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, PointerRNA *cmesh, const vector<uint>& used_shaders) { /* create subd mesh */ SubdMesh sdmesh; @@ -386,21 +386,25 @@ static void create_subd_mesh(Mesh *mesh, BL::Mesh b_mesh, PointerRNA *cmesh, con if(n == 4) sdmesh.add_face(vi[0], vi[1], vi[2], vi[3]); -#if 0 else sdmesh.add_face(vi[0], vi[1], vi[2]); -#endif } /* finalize subd mesh */ - sdmesh.link_boundary(); + sdmesh.finish(); - /* subdivide */ - DiagSplit dsplit; - dsplit.camera = NULL; - dsplit.dicing_rate = RNA_float_get(cmesh, "dicing_rate"); + /* parameters */ + bool need_ptex = mesh->need_attribute(scene, ATTR_STD_PTEX_FACE_ID) || + mesh->need_attribute(scene, ATTR_STD_PTEX_UV); - sdmesh.tessellate(&dsplit, false, mesh, used_shaders[0], true); + SubdParams sdparams(mesh, used_shaders[0], true, need_ptex); + sdparams.dicing_rate = RNA_float_get(cmesh, "dicing_rate"); + //scene->camera->update(); + //sdparams.camera = scene->camera; + + /* tesselate */ + DiagSplit dsplit(sdparams);; + sdmesh.tessellate(&dsplit); } /* Sync */ @@ -482,7 +486,7 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated, bool hide_tri if(b_mesh) { if(render_layer.use_surfaces && !hide_tris) { if(cmesh.data && experimental && RNA_boolean_get(&cmesh, "use_subdivision")) - create_subd_mesh(mesh, b_mesh, &cmesh, used_shaders); + create_subd_mesh(scene, mesh, b_mesh, &cmesh, used_shaders); else create_mesh(scene, mesh, b_mesh, used_shaders); } |