4 ms·
Slightly off topic, I was messing around with the triangulated lines demo, and I get this rendering glitch: https://imgur.com/FPEaVTC https://imgur.com/FPEaVTC
by eshyong 12y ago
Slightly off topic, I was messing around with the triangulated lines demo, and I get this rendering glitch:
https://imgur.com/FPEaVTC https://imgur.com/FPEaVTC
Anyone know the reason behind this? I'm guessing it's sort of triangle bounding error where something is being divided by a tiny divisor. It happens when I draw the snake in an arc, then retrace the arc from the same angle but in the opposite direction.
- delluminatus 12y agoHe actually mentions it in the article: Note: a drawback that comes with miter-joined lines is sharp edges. When the angle connecting two segments is very sharp, the miter length grows exponentially toward infinity, and causes huge artifacts in rendering. In some applications this may not be a problem, in others you might want to limit the miter or fall back to another join (i.e. bevel) when the angle is too sharp.
- eshyong 12y agoAwesome, thanks! I knew I should have read the article more closely.
- jheriko 12y agothere is a solution to this called 'mitre limiting' its quite simple really. beyond a certain angle (dot product) threshold between adjacent segments you don't mitre the corner, but you 'cap' it, either with a simple triangle filling the gap, or with a fan to create a nice, rounded appearance.
- 0x0 12y agoYeah, I get that a lot if I just wiggle left and right by a few pixels.