Syncing Orange branch with bf-blender
[blender.git] / source / blender / render / intern / source / rendercore.c
index 73d57e453b83eeb932857f0754babc2c520570ca..98c82019fa4f1f1f4958b783b0c9a0928cacdd2a 100644 (file)
@@ -2006,7 +2006,20 @@ void shade_input_set_coords(ShadeInput *shi, float u, float v, int i1, int i2, i
                                        shi->dyuv[0]= 2.0*(dl*uv3[0]-duv[0]*uv1[0]-duv[1]*uv2[0]);
                                        shi->dyuv[1]= 2.0*(dl*uv3[1]-duv[0]*uv1[1]-duv[1]*uv2[1]);
                                }
-                               
+#if 0
+                               {       /* tangent derived from UV, comes back later! (ton) */
+                                       //float s1= uv2[0] - uv1[0];
+                                       //float s2= uv3[0] - uv1[0];
+                                       float t1= uv2[1] - uv1[1];
+                                       float t2= uv3[1] - uv1[1];
+                                       
+                                       shi->vn[0]= (t2 * (v2->co[0]-v1->co[0]) - t1 * (v3->co[0]-v1->co[0])); 
+                                       shi->vn[1]= (t2 * (v2->co[1]-v1->co[1]) - t1 * (v3->co[1]-v1->co[1]));
+                                       shi->vn[2]= (t2 * (v2->co[2]-v1->co[2]) - t1 * (v3->co[2]-v1->co[2]));
+                                       Normalise(shi->vn);
+                                       vlr->flag |= R_TANGENT;
+                               }                                       
+#endif
                                if(mode & MA_FACETEXTURE) {
                                        if((mode & (MA_VERTEXCOL|MA_VERTEXCOLP))==0) {
                                                shi->vcol[0]= 1.0;