|Status:||ready to commit|
While trying to implement MipMaps (as of http://yafaray.org/node/695), I've been having difficulties with strange seams that appear sometimes at the edge of textures when they are repeated over a surface.
Obviously my first thought was to suspect my own additions to the code for MipMapping. However, after a long struggle, I've found that the original YafaRay texture interpolation was incorrect. Therefore, if I'm not mistaken, this is a problem that has been happening for a very long time in all YafaRay versions.
The problem is subtle, just a fine seam in the edge of the textures, but it's there. To replicate it and compare it with Blender Internal, I've created a small 4x4 texture and these are the results:
Blender Internal render (correct)
YafaRay render (wrong, see strange colored stripes at top and left of each repeated texture).
This problem is not trivial. To solve this, I have not only to correct the bug but also to implement an extension to the current interpolation code. For example if we have textures repeated, to determine the color to be calculated to the pixels near the texture edges, the interpolation should also take into account the colors of the texels in the next repetition of the texture. This also involves taking into account any "mirrorX, mirrorY" effect in the interpolation, so it takes into account the correct texel from the next texture "repetition".
As this is a major problem in my opinion, I'll try to fix it and integrate the texture interpolation with the Texture Clip Mode and MirrorX/Y parameters to make YafaRay texture interpolation behavior more similar to Blender.