diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-04-25 10:27:32 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-04-25 10:27:32 +0400 |
commit | 8fec90e220e3120d944ef2e385de0b0da615102f (patch) | |
tree | afa442b5f4b5004cac7ec6436a24bf2eca8fc835 /source/blender/modifiers/intern/MOD_displace.c | |
parent | bdbf0abe600b6e2608d93b6c27ec7ff9d474b743 (diff) |
Displace Modifier - Optimisation Tweaks for jpbouza and ZanQdo
- When strength is 0, there's no need to perform any of the
calculations at all
- When the vertexgroup weight for a vert is set to 0, skip evaluating
the modifier for that vertex as it should result in no-change to the
final result
Diffstat (limited to 'source/blender/modifiers/intern/MOD_displace.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_displace.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c index d303f3d2516..7f887eb162a 100644 --- a/source/blender/modifiers/intern/MOD_displace.c +++ b/source/blender/modifiers/intern/MOD_displace.c @@ -260,6 +260,7 @@ static void displaceModifier_do( float (*tex_co)[3]; if(!dmd->texture) return; + if(dmd->strength == 0.0f) return; defgrp_index = defgroup_name_index(ob, dmd->defgrp_name); @@ -284,7 +285,7 @@ static void displaceModifier_do( break; } } - if(!def_weight) continue; + if(!def_weight || def_weight->weight==0.0f) continue; } texres.nor = NULL; |