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-14 13:17:10 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-08-14 13:17:47 +0300
commit5e696fdcd646ca8643f617046a22da0a825f56d4 (patch)
treee35f9363ced71639bd1a910f4d1d5314e761972b /source/blender/modifiers/intern/MOD_subsurf.c
parentd7ae76fa35e6dbc3aefdd0d4c431591f84982171 (diff)
Multires: Begin hooking it up to the new subdiv code
Currently behaves same as subsurf, support of displacement is the next task in the line to tackle!
Diffstat (limited to 'source/blender/modifiers/intern/MOD_subsurf.c')
-rw-r--r--source/blender/modifiers/intern/MOD_subsurf.c42
1 files changed, 9 insertions, 33 deletions
diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c
index 4cf830f9787..38683cff42a 100644
--- a/source/blender/modifiers/intern/MOD_subsurf.c
+++ b/source/blender/modifiers/intern/MOD_subsurf.c
@@ -150,13 +150,13 @@ static DerivedMesh *applyModifierEM(
static int subdiv_levels_for_modifier_get(const SubsurfModifierData *smd,
const ModifierEvalContext *ctx)
{
- Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
- const bool use_render_params = (ctx->flag & MOD_APPLY_RENDER);
- const int requested_levels = (use_render_params) ? smd->renderLevels
- : smd->levels;
- return get_render_subsurf_level(&scene->r,
- requested_levels,
- use_render_params);
+ Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
+ const bool use_render_params = (ctx->flag & MOD_APPLY_RENDER);
+ const int requested_levels = (use_render_params) ? smd->renderLevels
+ : smd->levels;
+ return get_render_subsurf_level(&scene->r,
+ requested_levels,
+ use_render_params);
}
static void subdiv_settings_init(SubdivSettings *settings,
@@ -165,32 +165,8 @@ static void subdiv_settings_init(SubdivSettings *settings,
settings->is_simple = (smd->subdivType == SUBSURF_TYPE_SIMPLE);
settings->is_adaptive = !settings->is_simple;
settings->level = smd->quality;
- switch (smd->uv_smooth) {
- case SUBSURF_UV_SMOOTH_NONE:
- settings->fvar_linear_interpolation =
- SUBDIV_FVAR_LINEAR_INTERPOLATION_ALL;
- break;
- case SUBSURF_UV_SMOOTH_PRESERVE_CORNERS:
- settings->fvar_linear_interpolation =
- SUBDIV_FVAR_LINEAR_INTERPOLATION_CORNERS_ONLY;
- break;
- case SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_AND_JUNCTIONS:
- settings->fvar_linear_interpolation =
- SUBDIV_FVAR_LINEAR_INTERPOLATION_CORNERS_AND_JUNCTIONS;
- break;
- case SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_JUNCTIONS_AND_CONCAVE:
- settings->fvar_linear_interpolation =
- SUBDIV_FVAR_LINEAR_INTERPOLATION_CORNERS_JUNCTIONS_AND_CONCAVE;
- break;
- case SUBSURF_UV_SMOOTH_PRESERVE_BOUNDARIES:
- settings->fvar_linear_interpolation =
- SUBDIV_FVAR_LINEAR_INTERPOLATION_BOUNDARIES;
- break;
- case SUBSURF_UV_SMOOTH_ALL:
- settings->fvar_linear_interpolation =
- SUBDIV_FVAR_LINEAR_INTERPOLATION_NONE;
- break;
- }
+ settings->fvar_linear_interpolation =
+ BKE_subdiv_fvar_interpolation_from_uv_smooth(smd->uv_smooth);
}
static void subdiv_mesh_settings_init(SubdivToMeshSettings *settings,