diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/multires_subdiv.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/subdiv_converter_mesh.c | 20 |
2 files changed, 21 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/multires_subdiv.c b/source/blender/blenkernel/intern/multires_subdiv.c index 3de007dec75..150e7192934 100644 --- a/source/blender/blenkernel/intern/multires_subdiv.c +++ b/source/blender/blenkernel/intern/multires_subdiv.c @@ -46,8 +46,8 @@ void BKE_multires_subdiv_settings_init( const MultiresModifierData *mmd) { settings->is_simple = (mmd->simple != 0); - settings->is_adaptive = !settings->is_simple; - settings->level = mmd->quality; + settings->is_adaptive = true; + settings->level = settings->is_simple ? 1 : mmd->quality; settings->vtx_boundary_interpolation = SUBDIV_VTX_BOUNDARY_EDGE_ONLY; settings->fvar_linear_interpolation = BKE_subdiv_fvar_interpolation_from_uv_smooth(mmd->uv_smooth); diff --git a/source/blender/blenkernel/intern/subdiv_converter_mesh.c b/source/blender/blenkernel/intern/subdiv_converter_mesh.c index 5941de682f4..0dad259b001 100644 --- a/source/blender/blenkernel/intern/subdiv_converter_mesh.c +++ b/source/blender/blenkernel/intern/subdiv_converter_mesh.c @@ -47,6 +47,10 @@ #include "opensubdiv_capi.h" #include "opensubdiv_converter_capi.h" +/* Enable work-around for non-working CPU evaluator when using bilinear scheme. + * This forces Catmark scheme with all edges marked as infinitely sharp. */ +#define BUGGY_SIMPLE_SCHEME_WORKAROUND 1 + typedef struct ConverterStorage { SubdivSettings settings; const Mesh *mesh; @@ -78,6 +82,10 @@ typedef struct ConverterStorage { static OpenSubdiv_SchemeType get_scheme_type( const OpenSubdiv_Converter *converter) { +#if BUGGY_SIMPLE_SCHEME_WORKAROUND + (void) converter; + return OSD_SCHEME_CATMARK; +#else ConverterStorage *storage = converter->user_data; if (storage->settings.is_simple) { return OSD_SCHEME_BILINEAR; @@ -85,6 +93,7 @@ static OpenSubdiv_SchemeType get_scheme_type( else { return OSD_SCHEME_CATMARK; } +#endif } static OpenSubdiv_VtxBoundaryInterpolation get_vtx_boundary_interpolation( @@ -161,6 +170,11 @@ static float get_edge_sharpness(const OpenSubdiv_Converter *converter, int manifold_edge_index) { ConverterStorage *storage = converter->user_data; +#if BUGGY_SIMPLE_SCHEME_WORKAROUND + if (storage->settings.is_simple) { + return 10.0f; + } +#endif const int edge_index = storage->manifold_edge_index_reverse[manifold_edge_index]; const MEdge *medge = storage->mesh->medge; @@ -168,11 +182,15 @@ static float get_edge_sharpness(const OpenSubdiv_Converter *converter, return edge_crease * edge_crease * 10.0f; } - static bool is_infinite_sharp_vertex(const OpenSubdiv_Converter *converter, int manifold_vertex_index) { ConverterStorage *storage = converter->user_data; +#if BUGGY_SIMPLE_SCHEME_WORKAROUND + if (storage->settings.is_simple) { + return true; + } +#endif const int vertex_index = storage->manifold_vertex_index_reverse[manifold_vertex_index]; return BLI_BITMAP_TEST_BOOL(storage->infinite_sharp_vertices_map, |