[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37911] branches/soc-2011-salad: Merging r37894 through r37910 from trunk into soc-2011-salad
Sergey Sharybin
g.ulairi at gmail.com
Tue Jun 28 17:47:46 CEST 2011
Revision: 37911
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37911
Author: nazgul
Date: 2011-06-28 15:47:45 +0000 (Tue, 28 Jun 2011)
Log Message:
-----------
Merging r37894 through r37910 from trunk into soc-2011-salad
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37894
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37910
Modified Paths:
--------------
branches/soc-2011-salad/CMakeLists.txt
branches/soc-2011-salad/source/blender/render/intern/source/imagetexture.c
Property Changed:
----------------
branches/soc-2011-salad/
Property changes on: branches/soc-2011-salad
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/branches/soc-2011-cucumber:36829-36994
/branches/soc-2011-onion:36833-37529
/branches/soc-2011-pepper:36830-37151
/branches/soc-2011-tomato:36831-37894
/trunk/blender:36834-37893
+ /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/branches/soc-2011-cucumber:36829-36994
/branches/soc-2011-onion:36833-37529
/branches/soc-2011-pepper:36830-37151
/branches/soc-2011-tomato:36831-37894
/trunk/blender:36834-37910
Modified: branches/soc-2011-salad/CMakeLists.txt
===================================================================
--- branches/soc-2011-salad/CMakeLists.txt 2011-06-28 15:46:38 UTC (rev 37910)
+++ branches/soc-2011-salad/CMakeLists.txt 2011-06-28 15:47:45 UTC (rev 37911)
@@ -53,7 +53,6 @@
set(FIRST_RUN "TRUE")
endif()
-
# this starts out unset
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/Modules")
Modified: branches/soc-2011-salad/source/blender/render/intern/source/imagetexture.c
===================================================================
--- branches/soc-2011-salad/source/blender/render/intern/source/imagetexture.c 2011-06-28 15:46:38 UTC (rev 37910)
+++ branches/soc-2011-salad/source/blender/render/intern/source/imagetexture.c 2011-06-28 15:47:45 UTC (rev 37911)
@@ -76,7 +76,7 @@
extern struct Render R;
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-static void boxsample(ImBuf *ibuf, float minx, float miny, float maxx, float maxy, TexResult *texres, int imaprepeat, int imapextend);
+static void boxsample(ImBuf *ibuf, float minx, float miny, float maxx, float maxy, TexResult *texres, const short imaprepeat, const short imapextend);
/* *********** IMAGEWRAPPING ****************** */
@@ -115,6 +115,7 @@
{
float fx, fy, val1, val2, val3;
int x, y, retval;
+ int xi, yi; /* original values */
texres->tin= texres->ta= texres->tr= texres->tg= texres->tb= 0.0f;
@@ -166,8 +167,8 @@
}
}
- x = (int)floorf(fx*ibuf->x);
- y = (int)floorf(fy*ibuf->y);
+ x= xi= (int)floorf(fx*ibuf->x);
+ y= yi= (int)floorf(fy*ibuf->y);
if(tex->extend == TEX_CLIPCUBE) {
if(x<0 || y<0 || x>=ibuf->x || y>=ibuf->y || texvec[2]<-1.0f || texvec[2]>1.0f) {
@@ -209,10 +210,17 @@
filterx = (0.5f * tex->filtersize) / ibuf->x;
filtery = (0.5f * tex->filtersize) / ibuf->y;
+ /* important that this value is wrapped [#27782]
+ * this applies the modifications made by the checks above,
+ * back to the floating point values */
+ fx -= (float)(xi - x) / (float)ibuf->x;
+ fy -= (float)(yi - y) / (float)ibuf->y;
+
boxsample(ibuf, fx-filterx, fy-filtery, fx+filterx, fy+filtery, texres, (tex->extend==TEX_REPEAT), (tex->extend==TEX_EXTEND));
}
- else /* no filtering */
+ else { /* no filtering */
ibuf_get_color(&texres->tr, ibuf, x, y);
+ }
if( (R.flag & R_SEC_FIELD) && (ibuf->flags & IB_fields) ) {
ibuf->rect-= (ibuf->x*ibuf->y);
@@ -524,15 +532,17 @@
}
}
-static void boxsample(ImBuf *ibuf, float minx, float miny, float maxx, float maxy, TexResult *texres, int imaprepeat, int imapextend)
+static void boxsample(ImBuf *ibuf, float minx, float miny, float maxx, float maxy, TexResult *texres, const short imaprepeat, const short imapextend)
{
/* Sample box, performs clip. minx etc are in range 0.0 - 1.0 .
- * Enlarge with antialiased edges of pixels.
- * If variable 'imaprepeat' has been set, the
- * clipped-away parts are sampled as well.
- */
+ * Enlarge with antialiased edges of pixels.
+ * If variable 'imaprepeat' has been set, the
+ * clipped-away parts are sampled as well.
+ */
/* note: actually minx etc isnt in the proper range... this due to filter size and offset vectors for bump */
/* note: talpha must be initialized */
+ /* note: even when 'imaprepeat' is set, this can only repeate once in any direction.
+ * the point which min/max is derived from is assumed to be wrapped */
TexResult texr;
rctf *rf, stack[8];
float opp, tot, alphaclip= 1.0;
More information about the Bf-blender-cvs
mailing list