diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-05-14 06:21:50 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-05-14 06:21:50 +0400 |
commit | d2cff7307d26ada0dd34949d0a9fbb3c37c72f19 (patch) | |
tree | 08cf2ddba9ca608bbdb84de9ec2165bb998a361e /source | |
parent | 5f78efe19cdea2f508fff41a1723477489d7ac03 (diff) |
[#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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/render/intern/source/rendercore.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 5dfb509939b..2793e238dc7 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -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 */ |