Fix nan / black dots in image textures in some corner cases.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 16 Mar 2011 01:16:43 +0000 (01:16 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 16 Mar 2011 01:16:43 +0000 (01:16 +0000)
source/blender/render/intern/source/imagetexture.c

index f7926700abbecdac79ec2c174725b7b44ea4b274..daf9ea74978433146b269e3fc17e25e0caae8f91 100644 (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));