3 hours ago, Kryzon said:
The traditional solution for bleeding problems caused by mipmapping is to add a certain amount of padding on your textures.
http://wiki.polycount.com/wiki/Edge_padding
A curiously vague article, which talks about " suggested amounts of edge padding" instead of computing a provably sufficient amount of padding. There is a simple rule: the minimum padding is the number of pixels used in the interpolation (usually 1 for linear interpolation) at the coarsest mipmap level, in order to avoid reading "out of boundaries", and 2^n times as many pixels at the larger mipmap levels, in order to use the same UV values. Example: a 1D texture mapped to [3/8, 6/8]. The coarsest texture atlas size is 8, with 3 pixels dedicated to our texture.
0 X 1/8 X 2/8 X 3/8 A 4/8 B 5/8 C 6/8 X 7/8 X 1
Padding is needed left of A and right of C, usually duplicating the adjacent texture pixels:
X X A' A B C C' X
Note that a smaller texture (color Z) could fit in the unused space in range [0, 1/8] and its padding (with wrapping) in the rest of the range:
Z Z' A' A B C C' Z'
At the next mipmap level each texture pixel splits into two and padding pixels split into a padding pixel and an unused pixel
Z1 Z2 Z2' X X A1' A1 A2 B1 B2 C1 C2 C2' X X Z1'
Now, for example, 3/8 is in the crack between A1' and A1.