[Bf-blender-cvs] [ff3f7c52918] functions: invert Mesh Distance Falloff
Jacques Lucke
noreply at git.blender.org
Tue Sep 10 15:59:35 CEST 2019
Commit: ff3f7c52918dfb3c2a3936fceb28862e8c0d15b6
Author: Jacques Lucke
Date: Tue Sep 10 15:59:20 2019 +0200
Branches: functions
https://developer.blender.org/rBff3f7c52918dfb3c2a3936fceb28862e8c0d15b6
invert Mesh Distance Falloff
===================================================================
M source/blender/blenkernel/intern/falloff.cpp
===================================================================
diff --git a/source/blender/blenkernel/intern/falloff.cpp b/source/blender/blenkernel/intern/falloff.cpp
index 800bebfd2b6..731750b7eda 100644
--- a/source/blender/blenkernel/intern/falloff.cpp
+++ b/source/blender/blenkernel/intern/falloff.cpp
@@ -84,7 +84,7 @@ void MeshDistanceFalloff::compute(AttributesRef attributes,
float3 nearest_position = m_local_to_world.transform_position(nearest.co);
float distance = float3::distance(position, nearest_position);
- float weight = (distance - m_inner_distance) / distance_diff;
+ float weight = 1.0f - (distance - m_inner_distance) / distance_diff;
CLAMP(weight, 0.0f, 1.0f);
r_weights[index] = weight;
}
More information about the Bf-blender-cvs
mailing list