diff options
-rw-r--r-- | source/blender/blenkernel/BKE_blender.h | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 11 | ||||
-rw-r--r-- | source/blender/render/intern/source/texture.c | 17 | ||||
-rw-r--r-- | source/blender/src/buttons_shading.c | 6 |
4 files changed, 34 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index f392d57521c..db6d4762b17 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -41,7 +41,7 @@ struct ListBase; struct MemFile; #define BLENDER_VERSION 248 -#define BLENDER_SUBVERSION 1 +#define BLENDER_SUBVERSION 3 #define BLENDER_MINVERSION 245 #define BLENDER_MINSUBVERSION 15 diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 8347920319a..35e4c8b915c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7975,7 +7975,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) tex->vd->int_multiplier = 1.0; } } - } /* set the curve radius interpolation to 2.47 default - easy */ @@ -8074,6 +8073,16 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 3)) { + Tex *tex; + + /* blend texture extrapolation */ + for(tex=main->tex.first; tex; tex= tex->id.next) { + if (tex->type == TEX_BLEND) + tex->extend = TEX_EXTEND; + } + } + /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index d7b41d7cc2c..e5e8a285f28 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -197,6 +197,23 @@ static int blend(Tex *tex, float *texvec, TexResult *texres) y= texvec[1]; } + if (tex->extend == TEX_REPEAT) { + if (x < -1.0 || x > 1.0) { + const float x2 = (x + 1.0)* 0.5; /* to 0.0, 1.0 */ + x = (x2 - floor(x2) - 0.5) * 2.0; /* to -1.0, 1.0 */ + } + if (y < -1.0 || y > 1.0) { + const float y2 = (y + 1.0)* 0.5; /* to 0.0, 1.0 */ + y = (y2 - floor(y2) - 0.5) * 2.0; /* to -1.0, 1.0 */ + } + } else if (tex->extend == TEX_CLIP) { + if (x < -1.0 || x > 1.0 || y < -1.0 || y > 1.0) { + texres->tin = 0.f; + BRICONT; + return TEX_INT; + } + } + if(tex->stype==TEX_LIN) { /* lin */ texres->tin= (1.0+x)/2.0; } diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 6e69414fbe0..4f6a25058c3 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -644,7 +644,13 @@ static void texture_panel_blend(Tex *tex) uiDefButS(block, ROW, B_TEXPRV, "Sphere", 85, 160, 75, 19, &tex->stype, 2.0, (float)TEX_SPHERE, 0, 0, "Use progression with the shape of a sphere"); uiDefButS(block, ROW, B_TEXPRV, "Halo", 160, 160, 75, 19, &tex->stype, 2.0, (float)TEX_HALO, 0, 0, "Use a quadratic progression with the shape of a sphere"); uiDefButS(block, ROW, B_TEXPRV, "Radial", 235, 160, 75, 19, &tex->stype, 2.0, (float)TEX_RAD, 0, 0, "Use a polar progression"); + uiBlockEndAlign(block); + uiBlockBeginAlign(block); + uiDefButS(block, ROW, B_TEXREDR_PRV, "Extend", 10,120,63,19, &tex->extend, 4.0, 1.0, 0, 0, "Extends the color of the edge pixels"); + uiDefButS(block, ROW, B_TEXREDR_PRV, "Clip", 73,120,48,19, &tex->extend, 4.0, 2.0, 0, 0, "Sets alpha 0.0 outside Image edges"); + uiDefButS(block, ROW, B_TEXREDR_PRV, "Repeat", 121,120,63,19, &tex->extend, 4.0, 3.0, 0, 0, "Causes Image to repeat horizontally and vertically"); + uiBlockEndAlign(block); } /* newnoise: noisebasis menu string */ |