[#18685] dark pixels created when during texture "full baking"

fix/workaround - offset by a 500th of a pixel to avoid baking missing pixels that are between 2 faces, its still possible pixels could be between faces but much less likely then it is currently with pixel aligned UVs.
This commit is contained in:
2009-05-14 02:21:50 +00:00
parent 5f78efe19c
commit d2cff7307d

View File

@@ -2542,8 +2542,12 @@ static void shade_tface(BakeShade *bs)
/* get pixel level vertex coordinates */
for(a=0; a<4; a++) {
vec[a][0]= tface->uv[a][0]*(float)bs->rectx - 0.5f;
vec[a][1]= tface->uv[a][1]*(float)bs->recty - 0.5f;
/* Note, workaround for pixel aligned UVs which are common and can screw up our intersection tests
* where a pixel gets inbetween 2 faces or the middle of a quad,
* camera aligned quads also have this problem but they are less common.
* Add a small offset to the UVs, fixes bug #18685 - Campbell */
vec[a][0]= tface->uv[a][0]*(float)bs->rectx - (0.5f + 0.001);
vec[a][1]= tface->uv[a][1]*(float)bs->recty - (0.5f + 0.002);
}
/* UV indices have to be corrected for possible quad->tria splits */