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:
authorLukas Tönne <lukas.toenne@gmail.com>2014-09-18 11:06:25 +0400
committerLukas Tönne <lukas.toenne@gmail.com>2015-01-20 11:30:01 +0300
commit226beb986690046adfdf10a3ed72034fa322ccdb (patch)
treea9dfd0f16c58d70566368cb9b0c3e695e06e44d9 /source/blender/physics/intern/BPH_mass_spring.cpp
parentbbae8f88b8f305a8ed85cab718d2a66b476da3c1 (diff)
Added basic filtering feature for velocity smoothing.
This is part of the original method from "Volumetric Methods for Simulation and Rendering of Hair". The current filter is a simple box filter. Other energy-preserving filters such as gaussian filtering can be implemented later. The filter size is currently given as a cell count. This is not ideal, rather it should use a geometrical length value, but this is too abstract for proper artistical use. Eventually defining the whole grid in terms of spatial size might work better (possibly using an external object).
Diffstat (limited to 'source/blender/physics/intern/BPH_mass_spring.cpp')
-rw-r--r--source/blender/physics/intern/BPH_mass_spring.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/physics/intern/BPH_mass_spring.cpp b/source/blender/physics/intern/BPH_mass_spring.cpp
index 0fa14fa4eab..4d8f853a16b 100644
--- a/source/blender/physics/intern/BPH_mass_spring.cpp
+++ b/source/blender/physics/intern/BPH_mass_spring.cpp
@@ -431,6 +431,9 @@ static void cloth_calc_volume_force(ClothModifierData *clmd)
}
BPH_hair_volume_normalize_vertex_grid(vertex_grid);
+ /* apply velocity filter */
+ BPH_hair_volume_vertex_grid_filter_box(vertex_grid, clmd->sim_parms->voxel_filter_size);
+
for (i = 0; i < numverts; i++) {
float x[3], v[3], f[3], dfdx[3][3], dfdv[3][3];