Closed CryZe closed 5 years ago
Interesting. How are those numbers currently rendered?
I'm getting the glyphs from rusttype and then triangulate them with lyon. So they are basically just normal meshes. There shouldn't be a gap there as the two adjacent triangles there don't have a gap, as they are sharing the same vertices.
euc
's vertex shader now expects [f32; 4]
as part of the return type, but I see that's not happening in your code. What happens if you emit 1.0
as the last value?
That's what I'm doing here. I didn't push the changes yet. Without a fourth f32 value, it wouldn't build.
Would it be possible to put together a setup that demonstrates the problem such that I can try to figure out what's going on? I have a few suspicions, but it's difficult for me to confirm them without a way to test them.
I'll try to replicate it in a small-ish test.
Okay, this is really odd. If I disable alpha blending, the problem goes away O.o
It seems like the color values are completely out of range.
Yeah, that's a line where the input color is NaN apparently.
I suspect that a NaN
is generated somewhere in the rasterizer for a 0-width triangle or something like that, and that this gets propagated to the blending code.
Here's the code as a gist: https://gist.github.com/CryZe/ab4544126b6e0b6660364066cc818714
It's a white line in this because I do .min(255.0) at the end.
The line is at y=362, x>=198, x<=208
The triangle that causes it seems to be this one:
let mesh = [
Vertex {
position: Vec2 {
x: 0.39804077,
y: -0.21000671,
},
texcoord: Vec2 {
x: 0.0,
y: 0.36832988,
},
},
Vertex {
position: Vec2 {
x: 0.27268982,
y: -0.21000671,
},
texcoord: Vec2 {
x: 0.0,
y: 0.36832988,
},
},
Vertex {
position: Vec2 {
x: 0.44769287,
y: -0.21000671,
},
texcoord: Vec2 {
x: 0.0,
y: 0.36832988,
},
},
];
And yeah, looks like that's a straight line as all y coordinates are the same.
Okay, I've found the bug. As suspected, it was a NaN that got propagated throughout the texture projection code. I'm pushing a fix now (I'll publish a new version too).
euc 0.4.2
now includes the patch.
Looks like that fixed it in all of my tests. Thank you for figuring this out :D
I'm seeing some weird artifacts with euc 0.4.1:
Before:
After:
The 4 of the main points meter has a weird line going through it.