Add safe_normalize to cycles, avoid checking length first
This won't give any big speedup, just avoids redundant sqrtf and may be useful in future. Differential Revision: https://developer.blender.org/D880
This commit is contained in:
@@ -117,8 +117,8 @@ void EdgeDice::stitch_triangles(Patch *patch, vector<int>& outer, vector<int>& i
|
||||
}
|
||||
else {
|
||||
/* length of diagonals */
|
||||
float len1 = len(mesh_P[inner[i]] - mesh_P[outer[j+1]]);
|
||||
float len2 = len(mesh_P[outer[j]] - mesh_P[inner[i+1]]);
|
||||
float len1 = len_squared(mesh_P[inner[i]] - mesh_P[outer[j+1]]);
|
||||
float len2 = len_squared(mesh_P[outer[j]] - mesh_P[inner[i+1]]);
|
||||
|
||||
/* use smallest diagonal */
|
||||
if(len1 < len2)
|
||||
|
Reference in New Issue
Block a user