[Bf-blender-cvs] [692c60e] fluid-mantaflow: set wavelet noise value ranges, now using inverse posScale factor and fixed octaves issue when upres == 1

Sebastián Barschkis noreply at git.blender.org
Fri Feb 26 18:49:04 CET 2016


Commit: 692c60eeb86cc269dcde59383075037a346913b8
Author: Sebastián Barschkis
Date:   Fri Feb 26 18:48:46 2016 +0100
Branches: fluid-mantaflow
https://developer.blender.org/rB692c60eeb86cc269dcde59383075037a346913b8

set wavelet noise value ranges, now using inverse posScale factor and fixed octaves issue when upres == 1

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

M	intern/smoke/intern/MANTA.cpp
M	intern/smoke/intern/scenarios/smoke.h
M	source/blender/makesrna/intern/rna_smoke.c

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

diff --git a/intern/smoke/intern/MANTA.cpp b/intern/smoke/intern/MANTA.cpp
index bb9a4ed..a38d3ee 100644
--- a/intern/smoke/intern/MANTA.cpp
+++ b/intern/smoke/intern/MANTA.cpp
@@ -32,7 +32,7 @@ std::string Manta_API::get_real_value( const std::string& varName, SmokeModifier
 	if (varName == "UVS_CNT")
 		ss << smd->domain->manta_uvs_num ;
 	else if (varName == "UPRES")
-		ss << smd->domain->amplify; //ss << smd->domain->amplify+1;
+		ss << smd->domain->amplify;
 	else if (varName == "WLT_STR")
 		ss << smd->domain->strength ;
 	else if (varName == "RES")
diff --git a/intern/smoke/intern/scenarios/smoke.h b/intern/smoke/intern/scenarios/smoke.h
index 96b862b..238ad60 100644
--- a/intern/smoke/intern/scenarios/smoke.h
+++ b/intern/smoke/intern/scenarios/smoke.h
@@ -89,7 +89,9 @@ xl = Solver(name = 'larger', gridSize = xl_gs)\n\
 xl.timestep = $XL_TIMESTEP$\n\
 wltStrength = $WLT_STR$\n\
 octaves = 0\n\
-if(upres>0):\n\
+if upres == 1:\n\
+  octaves = int(math.log(upres+1)/ math.log(2.0) + 0.5)\n\
+elif upres > 1:\n\
   octaves = int(math.log(upres)/ math.log(2.0) + 0.5)\n";
 
 const string alloc_base_grids_high = "\n\
@@ -112,7 +114,7 @@ if doOpen:\n\
 const string wavelet_turbulence_noise = "\n\
 # wavelet turbulence noise field\n\
 xl_wltnoise = s.create(NoiseField, loadFromFile=True)\n\
-xl_wltnoise.posScale = vec3(int(1.0*gs.x)) * $NOISE_POSSCALE$\n\
+xl_wltnoise.posScale = vec3(int(1.0*gs.x)) / $NOISE_POSSCALE$\n\
 xl_wltnoise.timeAnim = $NOISE_TIMEANIM$\n\
 if(upres>0):\n\
   xl_wltnoise.posScale = xl_wltnoise.posScale * (1./upres)\n\
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index c0cd79a..36bdbaf 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -635,14 +635,14 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
 
 	prop = RNA_def_property(srna, "noise_pos_scale", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "noise_pos_scale");
-	RNA_def_property_range(prop, 0.0, 2.0);
-	RNA_def_property_ui_range(prop, 0.0, 2.0, 1, 2);
-	RNA_def_property_ui_text(prop, "Scale", "Scale of noise");
+	RNA_def_property_range(prop, 0.0, 10.0);
+	RNA_def_property_ui_range(prop, 0.1, 2.0, 1, 2);
+	RNA_def_property_ui_text(prop, "Scale", "Scale of noise (higher value results in larger vortices)");
 	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
 	
 	prop = RNA_def_property(srna, "noise_time_anim", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "noise_time_anim");
-	RNA_def_property_range(prop, 0.0, 2.0);
+	RNA_def_property_range(prop, 0.0, 10.0);
 	RNA_def_property_ui_range(prop, 0.0, 2.0, 1, 2);
 	RNA_def_property_ui_text(prop, "Time", "Animation time of noise");
 	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");




More information about the Bf-blender-cvs mailing list