Issue: After a few seconds, the end of the trail seems to be stuck to the center of the object.
Here’s a third party mod on the trail renderer. From the video, you can see that it used to work, but it’s not working in the latest version of the engine.
I haven’t had an issue with our wip game, using Unity WebGL here. This is way more complex of a project than the trail renderer, and it seems to handle the graphics end of things well.
I’m using Windows 10, GTX 1070 ( latest drivers ), Microsoft Edge. It also happens on Chrome.
Performance optimization. Preparing the vertex data loop can be shortened, because the vertices array (depending on the vertex life time), may be much larger than the resulting typed array, so we can break the loop early.
The issue is in the variable size of the vertices array, which then dictates the number of indices that the mesh should consume. Depending on the frame’s delta time, the vertices array can grow, and as a result the vertex buffer will use invalid indices in the last part of the buffer. That part will depend on the indices overflow size - this is the erroneous part of the ribbon on the screenshot. I changed it so that the amount of indices is limited to either the vertices array length (double of it actually, since it contains vertex pairs) or the constant max vertices, whichever is smaller.