Fix nan / black dots in image textures in some corner cases.

This commit is contained in:
Brecht Van Lommel
2011-03-16 01:16:43 +00:00
parent 6588bcbbe0
commit 934c2a06fe

View File

@@ -1188,10 +1188,8 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec,
// brecht: added stupid clamping here, large dx/dy can give very large
// filter sizes which take ages to render, it may be better to do this
// more intelligently later in the code .. probably it's not noticeable
if(AFD.dxt[0]*AFD.dxt[0] + AFD.dxt[1]*AFD.dxt[1] > 2.0f*2.0f) {
if(AFD.dxt[0]*AFD.dxt[0] + AFD.dxt[1]*AFD.dxt[1] > 2.0f*2.0f)
mul_v2_fl(AFD.dxt, 2.0f/len_v2(AFD.dxt));
mul_v2_fl(AFD.dyt, 2.0f/len_v2(AFD.dyt));
}
if(AFD.dyt[0]*AFD.dyt[0] + AFD.dyt[1]*AFD.dyt[1] > 2.0f*2.0f)
mul_v2_fl(AFD.dyt, 2.0f/len_v2(AFD.dyt));