Index: source/blender/blenkernel/BKE_node.h =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/blenkernel/BKE_node.h,v retrieving revision 1.20 diff -u -r1.20 BKE_node.h --- source/blender/blenkernel/BKE_node.h 14 Sep 2006 12:21:18 -0000 1.20 +++ source/blender/blenkernel/BKE_node.h 9 Oct 2006 23:49:25 -0000 @@ -181,6 +181,7 @@ #define SH_NODE_MATH 115 #define SH_NODE_VECT_MATH 116 #define SH_NODE_SQUEEZE 117 +#define SH_NODE_CLOUDS2 118 /* custom defines: options for Material node */ #define SH_NODE_MAT_DIFF 1 #define SH_NODE_MAT_SPEC 2 Index: source/blender/blenkernel/intern/ipo.c =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/blenkernel/intern/ipo.c,v retrieving revision 1.41 diff -u -r1.41 ipo.c --- source/blender/blenkernel/intern/ipo.c 4 Aug 2006 14:08:20 -0000 1.41 +++ source/blender/blenkernel/intern/ipo.c 12 Oct 2006 06:18:09 -0000 @@ -130,7 +130,9 @@ TE_N_BAS1, TE_N_BAS2, - TE_COL_R, TE_COL_G, TE_COL_B, TE_BRIGHT, TE_CONTRA + TE_COL_R, TE_COL_G, TE_COL_B, TE_BRIGHT, TE_CONTRA, + + TE_CL2_OFFSET, TE_CL2_FALLOFF }; int seq_ar[SEQ_TOTIPO]= { @@ -1101,7 +1103,10 @@ poin= &(tex->bright); break; case TE_CONTRA: poin= &(tex->contrast); break; - + case TE_CL2_OFFSET: + poin= &(tex->cl2_offset); break; + case TE_CL2_FALLOFF: + poin= &(tex->cl2_falloff); break; } return poin; Index: source/blender/makesdna/DNA_ipo_types.h =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/makesdna/DNA_ipo_types.h,v retrieving revision 1.20 diff -u -r1.20 DNA_ipo_types.h --- source/blender/makesdna/DNA_ipo_types.h 4 Aug 2006 14:08:21 -0000 1.20 +++ source/blender/makesdna/DNA_ipo_types.h 12 Oct 2006 06:28:11 -0000 @@ -206,6 +206,9 @@ #define TE_BRIGHT 25 #define TE_CONTRA 26 +#define TE_CL2_OFFSET 27 +#define TE_CL2_FALLOFF 28 + /* ******************** */ #define SEQ_TOTIPO 1 Index: source/blender/makesdna/DNA_texture_types.h =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/makesdna/DNA_texture_types.h,v retrieving revision 1.28 diff -u -r1.28 DNA_texture_types.h --- source/blender/makesdna/DNA_texture_types.h 18 Sep 2006 15:32:11 -0000 1.28 +++ source/blender/makesdna/DNA_texture_types.h 11 Oct 2006 03:41:03 -0000 @@ -130,6 +130,9 @@ float bright, contrast, rfac, gfac, bfac; float filtersize; + /* clouds parameters */ + float cl2_offset, cl2_falloff; + /* newnoise: musgrave parameters */ float mg_H, mg_lacunarity, mg_octaves, mg_offset, mg_gain; @@ -200,6 +203,7 @@ #define TEX_MUSGRAVE 11 #define TEX_VORONOI 12 #define TEX_DISTNOISE 13 +#define TEX_CLOUDS2 14 /* musgrave stype */ #define TEX_MFRACTAL 0 Index: source/blender/render/intern/source/texture.c =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/render/intern/source/texture.c,v retrieving revision 1.74 diff -u -r1.74 texture.c --- source/blender/render/intern/source/texture.c 18 Sep 2006 12:53:52 -0000 1.74 +++ source/blender/render/intern/source/texture.c 12 Oct 2006 06:53:39 -0000 @@ -332,6 +332,84 @@ } +/* based on the GPLed texture plugin clouds2 + * http://www-users.cs.umn.edu/~mein/blender/plugins/texture/clouds2/index.html + * integrated into the main source tree for plumiferos + */ + +static int clouds2(Tex *tex, float *texvec, TexResult *texres) +{ + float val = 0.0; + float a = 1.0; + float p[3]; + float tv[3]; + float tmp1, tmp2; + int i; + int rv = TEX_INT; /* return value, default is intensity */ + + tv[0]=(texvec[0]+1.0)/2.0; + tv[1]=(texvec[1]+1.0)/2.0; + tv[2]=(texvec[2]+1.0)/2.0; + + p[0] = tex->noisesize * tv[0]; + p[1] = tex->noisesize * tv[1]; + p[2] = tex->noisesize * tv[2]; + + for (i=0; i < tex->noisedepth; i++) { + val += a * BLI_hnoise(1.0, p[0], p[1], p[2]); + + p[0] *= 2.0; + p[1] *= 2.0; + p[2] *= 2.0; + a *= 0.5; + } + + /* always calculate intensity */ + + tmp1 = pow(fabs( sqrt(tv[0]*tv[0]+tv[1]*tv[1]+tv[2]*tv[2]) ), tex->cl2_falloff); + + tmp2 = (val+tex->cl2_offset); + + if (tmp2>1.0) + tmp2 = 1.0; + else if (tmp2<0.0) + tmp2 = 0.0; + + + texres->tin = tmp1*tmp2; + + + /* noise affects bump is selected + * + * This value is the displacement of the actual normal in + * the Material calculation. + */ + if (texres->nor!=NULL) { + texres->nor[0] += val; + texres->nor[1] += 1.0 - val; + texres->nor[2] = 0.0; + + tex_normal_derivate(tex, texres); + rv |= TEX_NOR; + } + + /* noise affects color is selected */ + if(tex->stype == 1) { + /* color? then return 1; + * + * this is r, g, b, a: + */ + texres->tr= 0.5*(texres->tin); + texres->tg= 1.0-val; + texres->tb= sqrt(fabs(texres->tin)); /*was fsqrt in original so check to ensure doesn't cause errors... */ + texres->ta= 1.0; + rv |= TEX_RGB; + } + + return rv; +} + + /* creates a sine wave */ static float tex_sin(float a) { @@ -1169,6 +1247,9 @@ case TEX_CLOUDS: retval= clouds(tex, texvec, texres); break; + case TEX_CLOUDS2: + retval= clouds2(tex, texvec, texres); + break; case TEX_WOOD: retval= wood(tex, texvec, texres); break; Index: source/blender/src/butspace.c =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/src/butspace.c,v retrieving revision 1.46 diff -u -r1.46 butspace.c --- source/blender/src/butspace.c 3 Sep 2006 12:16:13 -0000 1.46 +++ source/blender/src/butspace.c 11 Oct 2006 06:55:52 -0000 @@ -94,7 +94,7 @@ char texstr[20][12]= {"None" , "Clouds" , "Wood", "Marble", "Magic" , "Blend", "Stucci", "Noise" , "Image", "Plugin", "EnvMap" , "Musgrave", - "Voronoi", "DistNoise", "", "", "", "", "", ""}; + "Voronoi", "DistNoise", "Clouds2", "", "", "", "", ""}; /* ---------------------------------------------------------------------- */ void test_idbutton_cb(void *namev, void *arg2) Index: source/blender/src/buttons_shading.c =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/src/buttons_shading.c,v retrieving revision 1.210 diff -u -r1.210 buttons_shading.c --- source/blender/src/buttons_shading.c 5 Sep 2006 13:28:59 -0000 1.210 +++ source/blender/src/buttons_shading.c 12 Oct 2006 03:42:02 -0000 @@ -742,6 +742,27 @@ } +static void texture_panel_clouds2(Tex *tex) +{ + uiBlock *block; + + block= uiNewBlock(&curarea->uiblocks, "texture_panel_clouds2", UI_EMBOSS, UI_HELV, curarea->win); + if(uiNewPanel(curarea, block, "Clouds2", "Texture", 640, 0, 318, 204)==0) return; + uiSetButLock(tex->id.lib!=0, "Can't edit library data"); + + uiBlockBeginAlign(block); + uiDefButS(block, ROW, B_TEXPRV, "Intens", 10, 180, 100, 18, &tex->stype, 1.0, 0.0, 0, 0, "noise affects color intensity"); + uiDefButS(block, ROW, B_TEXPRV, "Color", 110, 180, 100, 18, &tex->stype, 1.0, 1.0, 0, 0, "noise affects color"); + uiBlockBeginAlign(block); + + uiDefButF(block, NUM, B_TEXPRV, "Scale :", 10, 110, 150, 19, &tex->noisesize, -20.0, 20.0, 100, 0, "Sets scaling for noise input"); + uiDefButS(block, NUM, B_TEXPRV, "NoiseDepth:", 10, 90, 150, 19, &tex->noisedepth, 1.0, 12.0, 1000, 0, "Sets the depth of the texture calculation"); + uiDefButF(block, NUM, B_TEXPRV, "Offset:", 10, 70, 150, 19, &tex->cl2_offset, -20.0, 20.0, 100, 0, "Sets the offset"); + uiDefButF(block, NUM, B_TEXPRV, "Falloff:", 10, 50, 150, 19, &tex->cl2_falloff, -20.0, 20.0, 100, 0, "Sets the falloff"); + + uiBlockEndAlign(block); +} + /*****************************************/ /* newnoise: panel(s) for musgrave types */ /*****************************************/ @@ -1308,7 +1329,7 @@ /* newnoise: all texture types as menu, not enough room for more buttons. * Can widen panel, but looks ugly when other panels overlap it */ - sprintf(textypes, "Texture Type %%t|None %%x%d|Image %%x%d|EnvMap %%x%d|Clouds %%x%d|Marble %%x%d|Stucci %%x%d|Wood %%x%d|Magic %%x%d|Blend %%x%d|Noise %%x%d|Plugin %%x%d|Musgrave %%x%d|Voronoi %%x%d|DistortedNoise %%x%d", 0, TEX_IMAGE, TEX_ENVMAP, TEX_CLOUDS, TEX_MARBLE, TEX_STUCCI, TEX_WOOD, TEX_MAGIC, TEX_BLEND, TEX_NOISE, TEX_PLUGIN, TEX_MUSGRAVE, TEX_VORONOI, TEX_DISTNOISE); + sprintf(textypes, "Texture Type %%t|None %%x%d|Image %%x%d|EnvMap %%x%d|Clouds %%x%d|Marble %%x%d|Stucci %%x%d|Wood %%x%d|Magic %%x%d|Blend %%x%d|Noise %%x%d|Plugin %%x%d|Musgrave %%x%d|Voronoi %%x%d|DistortedNoise %%x%d|Clouds2 %%x%d", 0, TEX_IMAGE, TEX_ENVMAP, TEX_CLOUDS, TEX_MARBLE, TEX_STUCCI, TEX_WOOD, TEX_MAGIC, TEX_BLEND, TEX_NOISE, TEX_PLUGIN, TEX_MUSGRAVE, TEX_VORONOI, TEX_DISTNOISE, TEX_CLOUDS2); uiDefBut(block, LABEL, 0, "Texture Type", 160, 150, 140, 20, 0, 0.0, 0.0, 0, 0, ""); uiDefButS(block, MENU, B_TEXTYPE, textypes, 160, 125, 140, 25, &tex->type, 0,0,0,0, "Select texture type"); @@ -3502,6 +3523,9 @@ break; case TEX_CLOUDS: texture_panel_clouds(tex); + break; + case TEX_CLOUDS2: + texture_panel_clouds2(tex); break; case TEX_MARBLE: texture_panel_marble(tex); Index: source/blender/src/editipo.c =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/src/editipo.c,v retrieving revision 1.105 diff -u -r1.105 editipo.c --- source/blender/src/editipo.c 1 Oct 2006 19:45:37 -0000 1.105 +++ source/blender/src/editipo.c 12 Oct 2006 06:40:33 -0000 @@ -2348,7 +2348,7 @@ id= G.buts->lockpoin; te= G.buts->lockpoin; if(id) { - event= pupmenu("Insert Key %t|Cloud%x0|Marble%x1|Stucci%x2|Wood%x3|Magic%x4|Blend%x5|Musgrave%x6|Voronoi%x7|Distnoise%x8|ColourFilter%x9"); + event= pupmenu("Insert Key %t|Cloud%x0|Marble%x1|Stucci%x2|Wood%x3|Magic%x4|Blend%x5|Musgrave%x6|Voronoi%x7|Distnoise%x8|ColourFilter%x9|Clouds2%x10"); if(event== -1) return; if(event==0) { @@ -2420,6 +2420,12 @@ insertkey(id, ID_TE, NULL, NULL, TE_COL_B); insertkey(id, ID_TE, NULL, NULL, TE_BRIGHT); insertkey(id, ID_TE, NULL, NULL, TE_CONTRA); + } + if(event==10) { + insertkey(id, ID_TE, NULL, NULL, TE_NSIZE); + insertkey(id, ID_TE, NULL, NULL, TE_NDEPTH); + insertkey(id, ID_TE, NULL, NULL, TE_CL2_OFFSET); + insertkey(id, ID_TE, NULL, NULL, TE_CL2_FALLOFF); } } }