Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-07-24 14:26:22 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-07-24 14:26:22 +0400
commitb154b5993829f92e03233a04410b3667f2976556 (patch)
treec947d163e45ef0eab6c97699e13aad8ced20f40f /source/blender/render
parentcb2423e849d03cf1d288df94401cfd8d49c8ff56 (diff)
New dilation function from Morten Mikkelsen (aka sparky).
This commit fixes very noticeable seams caused by margins calculated incorrectly. This commit changes way margin is calculated in and makes textures really seamless. Also margin limited to 32 isn't good now -- artists are baking really large textures nowadays so margin is now limited to 64px. Thank you, Morten!
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/intern/source/rendercore.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 3aca334cffe..a7e19c8db4f 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -2577,27 +2577,7 @@ void RE_bake_ibuf_filter(ImBuf *ibuf, char *mask, const int filter)
/* Margin */
if(filter) {
- char *temprect;
- int i;
-
- /* extend the mask +2 pixels from the image,
- * this is so colors dont blend in from outside */
-
- for(i=0; i< filter; i++)
- IMB_mask_filter_extend(mask, ibuf->x, ibuf->y);
-
- temprect = MEM_dupallocN(mask);
-
- /* expand twice to clear this many pixels, so they blend back in */
- IMB_mask_filter_extend(temprect, ibuf->x, ibuf->y);
- IMB_mask_filter_extend(temprect, ibuf->x, ibuf->y);
-
- /* clear all pixels in the margin */
- IMB_mask_clear(ibuf, temprect, FILTER_MASK_MARGIN);
- MEM_freeN(temprect);
-
- for(i= 0; i < filter; i++)
- IMB_filter_extend(ibuf, mask);
+ IMB_filter_extend(ibuf, mask, filter);
}
/* if the bake results in new alpha then change the image setting */