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-10 15:36:04 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-07-10 15:40:45 +0300
commitc17cb50ae282f0f04d399ac4f9fa2f3c5eb548bb (patch)
tree1ee3e015cca69398d7597823fb58383889cbd075 /source/blender
parent80373bc4d2b4b22d21088957163c19b537f64c7e (diff)
OpenSubdiv: Make more flexible C-API to specify FVar interpolation
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c
index f1f82f458aa..8c1ba0c3782 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c
@@ -84,11 +84,14 @@ static OpenSubdiv_SchemeType conv_dm_get_type(
return OSD_SCHEME_CATMARK;
}
-static bool conv_dm_get_subdiv_uvs(
+static OpenSubdiv_FVarLinearInterpolation conv_dm_get_fvar_linear_interpolation(
const OpenSubdiv_Converter *converter)
{
ConvDMStorage *storage = converter->user_data;
- return (storage->ss->osd_subdiv_uvs);
+ if (storage->ss->osd_subdiv_uvs) {
+ return OSD_FVAR_LINEAR_INTERPOLATION_CORNERS_ONLY;
+ }
+ return OSD_FVAR_LINEAR_INTERPOLATION_ALL;
}
static int conv_dm_get_num_faces(const OpenSubdiv_Converter *converter)
@@ -429,9 +432,10 @@ void ccgSubSurf_converter_setup_from_derivedmesh(
{
ConvDMStorage *user_data;
- converter->get_type = conv_dm_get_type;
+ converter->get_scheme_type = conv_dm_get_type;
- converter->get_subdiv_uvs = conv_dm_get_subdiv_uvs;
+ converter->get_fvar_linear_interpolation =
+ conv_dm_get_fvar_linear_interpolation;
converter->get_num_faces = conv_dm_get_num_faces;
converter->get_num_edges = conv_dm_get_num_edges;
@@ -526,11 +530,14 @@ static OpenSubdiv_SchemeType conv_ccg_get_bilinear_type(
}
}
-static bool conv_ccg_get_subdiv_uvs(
- const OpenSubdiv_Converter *converter)
+static OpenSubdiv_FVarLinearInterpolation
+conv_ccg_get_fvar_linear_interpolation(const OpenSubdiv_Converter *converter)
{
CCGSubSurf *ss = converter->user_data;
- return (ss->osd_subdiv_uvs);
+ if (ss->osd_subdiv_uvs) {
+ return OSD_FVAR_LINEAR_INTERPOLATION_CORNERS_ONLY;
+ }
+ return OSD_FVAR_LINEAR_INTERPOLATION_ALL;
}
static int conv_ccg_get_num_faces(const OpenSubdiv_Converter *converter)
@@ -710,9 +717,10 @@ static int conv_ccg_get_face_corner_uv_index(const OpenSubdiv_Converter *UNUSED(
void ccgSubSurf_converter_setup_from_ccg(CCGSubSurf *ss,
OpenSubdiv_Converter *converter)
{
- converter->get_type = conv_ccg_get_bilinear_type;
+ converter->get_scheme_type = conv_ccg_get_bilinear_type;
- converter->get_subdiv_uvs = conv_ccg_get_subdiv_uvs;
+ converter->get_fvar_linear_interpolation =
+ conv_ccg_get_fvar_linear_interpolation;
converter->get_num_faces = conv_ccg_get_num_faces;
converter->get_num_edges = conv_ccg_get_num_edges;