Commit f2b3e75a authored by amandaghassaei's avatar amandaghassaei
Browse files

fix acos instability

parent d170663b
......@@ -250,8 +250,8 @@
vec3 normal2 = texture2D(u_normals, normal2Index).xyz;
float dotNormals = dot(normal1, normal2);//normals are already normalized, no need to divide by length
//if (dotNormals < -0.999) dotNormals = -0.999;
//else if (dotNormals > 0.999) dotNormals = 0.999;
if (dotNormals < -0.999) dotNormals = -0.999;
else if (dotNormals > 0.999) dotNormals = 0.999;
float theta = acos(dotNormals);
vec3 creaseVector = texture2D(u_creaseVectors, scaledFragCoord).xyz;
float sign = dot(cross(normal1, normal2), creaseVector);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment