By using the extension to define the first vertex as the provoking vertex, we get the same result as with WebGPU:
This extension is fairly recent (upgraded to “community approved” in January 2023), so I don’t think you can really rely on it…
In your case, the best solution is probably to create a new attribute (or use an existing attribute if you still have room for a float) that would contain the vertex index. This way, you don’t depend on how the triangle is rasterized under the hood.
Ok, just realized that it won’t work with lines added to an a previous instance, because the dash counter is relative to the line not to the mesh created from several lines… So the new attribute is needed.
My kid is in hospital, I can’t do anything meaningful now. I’ll get back to GreasedLine in a few days, when he gets out of the worst… Sorry.
Thanks for caring! You won’t believe how bad is this year for our family already and it’s just June, bad luck on every step… Damned! And you won’t believe how big idiots the teenagers can be, he burnt his body while ‘playing’ with fire with his friends. He will be ok, he is young and he is healing pretty quickly. I promised him to break his arms if I catch him with matches or a lighter ever again! The funny thing is that the same shit happened to me when I was 8, but I just burnt my legs And my father promised me the same (he owns the copyright). I never ever played with fire again…
Ok, back to the GreasedLine. @Evgeni_Popov I have added grlColorPointers (I think I wil rename it to grlColorIndexes). But the current implementation is vasting resource, because I was using vertexId which values were automatically incremented by the shader I had to create a texture like this:
From now I am creating the colorIndexes so I can just create a color palette (so the color texture for this line will contain only 4 colors) and point the indexes to the color I want to use. This is quite a big change, I will need keep the colors in the palette unique (even when adding new lines to an existing instance) and recalculate the colorIndexes everytime I add a line. Please be patient I am already working on it.
I am in trouble I spent quite a moment for making the unique color palette with proper color indexes but I’ve introduced a new option called colorsSampling today so you can draw lines with texture sampling of your choice:
I think this is pretty cool to have however if I switch to a unique color palette it will kill this functionality. I think if I just don’t make the palette unique but always append the colors to the palette the colorIndexes interpolation will work. So it requires another round of coding… This will never end