From 8fec90e220e3120d944ef2e385de0b0da615102f Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 25 Apr 2011 06:27:32 +0000 Subject: 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 --- source/blender/modifiers/intern/MOD_displace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/modifiers/intern/MOD_displace.c') 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; -- cgit v1.2.3