[Bf-blender-cvs] [61f4c7b] temp_merge_gooseberry_hair: Some tweaking of value ranges for hair target density and removed density factor (already included in grid velocity).

Lukas Tönne noreply at git.blender.org
Mon Jan 19 20:51:09 CET 2015


Commit: 61f4c7ba81800b601a73c51947276ae996c08783
Author: Lukas Tönne
Date:   Sat Nov 15 12:40:34 2014 +0100
Branches: temp_merge_gooseberry_hair
https://developer.blender.org/rB61f4c7ba81800b601a73c51947276ae996c08783

Some tweaking of value ranges for hair target density and removed
density factor (already included in grid velocity).

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp

===================================================================

M	source/blender/makesrna/intern/rna_cloth.c
M	source/blender/physics/intern/BPH_mass_spring.cpp
M	source/blender/physics/intern/hair_volume.cpp

===================================================================

diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c
index dced2e8..4e8cfb8 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -387,13 +387,13 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
 
 	prop = RNA_def_property(srna, "density_target", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "density_target");
-	RNA_def_property_range(prop, 0.0f, 1000000.0f);
+	RNA_def_property_range(prop, 0.0f, 10000.0f);
 	RNA_def_property_ui_text(prop, "Target Density", "Maximum density of hair");
 	RNA_def_property_update(prop, 0, "rna_cloth_update");
 
 	prop = RNA_def_property(srna, "density_strength", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "density_strength");
-	RNA_def_property_range(prop, 0.0f, 1000.0f);
+	RNA_def_property_range(prop, 0.0f, 1.0f);
 	RNA_def_property_ui_text(prop, "Target Density Strength", "Influence of target density on the simulation");
 	RNA_def_property_update(prop, 0, "rna_cloth_update");
 
diff --git a/source/blender/physics/intern/BPH_mass_spring.cpp b/source/blender/physics/intern/BPH_mass_spring.cpp
index ee2b791..7a3660d 100644
--- a/source/blender/physics/intern/BPH_mass_spring.cpp
+++ b/source/blender/physics/intern/BPH_mass_spring.cpp
@@ -672,6 +672,9 @@ static void cloth_continuum_step(ClothModifierData *clmd, float dt)
 	
 	const float fluid_factor = 0.95f; /* blend between PIC and FLIP methods */
 	float smoothfac = parms->velocity_smooth;
+	/* XXX FIXME arbitrary factor!!! this should be based on some intuitive value instead,
+	 * like number of hairs per cell and time decay instead of "strength"
+	 */
 	float density_target = parms->density_target;
 	float density_strength = parms->density_strength;
 	float gmin[3], gmax[3];
diff --git a/source/blender/physics/intern/hair_volume.cpp b/source/blender/physics/intern/hair_volume.cpp
index 91198cf..b08eef0 100644
--- a/source/blender/physics/intern/hair_volume.cpp
+++ b/source/blender/physics/intern/hair_volume.cpp
@@ -598,7 +598,7 @@ static const float density_threshold = 0.001f; /* cells with density below this
 BLI_INLINE float hair_volume_density_divergence(float density, float target_density, float strength)
 {
 	if (density > density_threshold && density > target_density)
-		return strength * density * logf(target_density / density);
+		return strength * logf(target_density / density);
 	else
 		return 0.0f;
 }




More information about the Bf-blender-cvs mailing list