diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-08 01:48:51 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-08 01:48:51 +0300 |
commit | 8b27e83e5c9a2b34c5ff65169a47508730f287f7 (patch) | |
tree | 744ce45b6329e1bb2110ab4dadca478031bb993c /source/blender | |
parent | 6de12ac8530655c771c5c62c74f2b26a79d50a00 (diff) |
[#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
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/makesdna/DNA_texture_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_texture.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index 19aacaa8108..9df596666a7 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -224,7 +224,7 @@ typedef struct Tex { 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; diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index fc822e5a804..c020ceb2c0f 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -676,7 +676,7 @@ static void rna_def_texture_clouds(BlenderRNA *brna) 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 @@ static void rna_def_texture_marble(BlenderRNA *brna) 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 @@ static void rna_def_texture_magic(BlenderRNA *brna) 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 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) 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"); |