| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -71,7 +71,10 @@ void main() { | |||
| 71 | 71 | // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181) | |
| 72 | 72 | // t = +- normalize( (q.xy*p.w - p.xy*q.w) * viewport.zw ) | |
| 73 | 73 | ||
| 74 | - vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * viewport.zw); | ||
| 74 | + vec2 tangent = (q.xy*p.w - p.xy*q.w) * viewport.zw; | ||
| 75 | + | ||
| 76 | + // don't normalize zero vector (line join triangles and lines perpendicular to the eye plane) | ||
| 77 | + tangent = length(tangent) == 0.0 ? vec2(0.0, 0.0) : normalize(tangent); | ||
| 75 | 78 | ||
| 76 | 79 | // flip tangent to normal (it's already normalized) | |
| 77 | 80 | vec2 normal = vec2(-tangent.y, tangent.x); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments