[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32932] trunk/blender/source/blender: [ #24593] Cloud Depth setting above 30 cause texture corruption

Campbell Barton ideasman42 at gmail.com
Sun Nov 7 23:48:51 CET 2010


Revision: 32932
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32932
Author:   campbellbarton
Date:     2010-11-07 23:48:51 +0100 (Sun, 07 Nov 2010)

Log Message:
-----------
[#24593] Cloud Depth setting above 30 cause texture corruption
disallow cloud depth over 30, it causes a lot of floating point exceptions (and nan value pixels), because of hitting the int limit with 1<<(oct+1) in BLI_gTurbulence

Modified Paths:
--------------
    trunk/blender/source/blender/makesdna/DNA_texture_types.h
    trunk/blender/source/blender/makesrna/intern/rna_texture.c

Modified: trunk/blender/source/blender/makesdna/DNA_texture_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_texture_types.h	2010-11-07 20:48:09 UTC (rev 32931)
+++ trunk/blender/source/blender/makesdna/DNA_texture_types.h	2010-11-07 22:48:51 UTC (rev 32932)
@@ -224,7 +224,7 @@
 	float vn_mexp;
 	short vn_distm, vn_coltype;
 
-	short noisedepth, noisetype;
+	short noisedepth, noisetype; /* noisedepth MUST be <= 30 else we get floating point exceptions */
 
 	/* newnoise: noisebasis type for clouds/marble/etc, noisebasis2 only used for distorted noise */
 	short noisebasis, noisebasis2;

Modified: trunk/blender/source/blender/makesrna/intern/rna_texture.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_texture.c	2010-11-07 20:48:09 UTC (rev 32931)
+++ trunk/blender/source/blender/makesrna/intern/rna_texture.c	2010-11-07 22:48:51 UTC (rev 32932)
@@ -676,7 +676,7 @@
 
 	prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "noisedepth");
-	RNA_def_property_range(prop, 0, INT_MAX);
+	RNA_def_property_range(prop, 0, 30);
 	RNA_def_property_ui_range(prop, 0, 24, 0, 2);
 	RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
 	RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
@@ -811,7 +811,7 @@
 
 	prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "noisedepth");
-	RNA_def_property_range(prop, 0, INT_MAX);
+	RNA_def_property_range(prop, 0, 30);
 	RNA_def_property_ui_range(prop, 0, 24, 0, 2);
 	RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
 	RNA_def_property_update(prop, 0, "rna_Texture_update");
@@ -866,7 +866,7 @@
 
 	prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "noisedepth");
-	RNA_def_property_range(prop, 0, INT_MAX);
+	RNA_def_property_range(prop, 0, 30);
 	RNA_def_property_ui_range(prop, 0, 24, 0, 2);
 	RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
 	RNA_def_property_update(prop, 0, "rna_Texture_update");
@@ -1520,7 +1520,7 @@
 	
 	prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "noise_depth");
-	RNA_def_property_range(prop, 0, INT_MAX);
+	RNA_def_property_range(prop, 0, 30);
 	RNA_def_property_ui_text(prop, "Depth", "Level of detail in the added turbulent noise");
 	RNA_def_property_update(prop, 0, "rna_Texture_update");
 	





More information about the Bf-blender-cvs mailing list