Bugfix 26578
[blender.git] / source / blender / render / intern / source / render_texture.c
index acc69680487eaa5a68f5b842591d1832bcb54578..2b98e7a3f96d4444508344be51e8f5d5c8201546 100644 (file)
@@ -2339,9 +2339,16 @@ void do_material_tex(ShadeInput *shi)
                                }
                                // warping, local space
                                if(mtex->mapto & MAP_WARP) {
-                                       warpvec[0]= mtex->warpfac*texres.nor[0];
-                                       warpvec[1]= mtex->warpfac*texres.nor[1];
-                                       warpvec[2]= mtex->warpfac*texres.nor[2];
+                                       float *warpnor= texres.nor, warpnor_[3];
+                                       
+                                       if(use_ntap_bump) {
+                                               VECCOPY(warpnor_, texres.nor);
+                                               warpnor= warpnor_;
+                                               normalize_v3(warpnor_);
+                                       }
+                                       warpvec[0]= mtex->warpfac*warpnor[0];
+                                       warpvec[1]= mtex->warpfac*warpnor[1];
+                                       warpvec[2]= mtex->warpfac*warpnor[2];
                                        warpdone= 1;
                                }
 #if 0