Ok, so after a long… long… night, I think I have the solution working.
I will likely put my
MotionStreakBatchNode on GitHub soon and share in another thread.
Basically… I created a new Node that you add MotionStreak instances to, similar to how Sprites can be added to SpriteBatchNode. It has the same asserts for class type and texture validations.
For the actual rendering, I overrode the visit and draw methods in the new batch node to not propagate to the MotionStreaks themselves. Instead, I let them calculate their vertex array attributes as normal, and then combine all the triangle strips in one
glDrawArrays call. A huge issue I ran through and didn’t figure out for a few hours was the ‘degenerate triangle’ use case to where you can separate triangle strips with 0 area triangles in-between the strips. This way, now, many MotionStreak instances using the same texture, can all be doing their own thing in different places, but are drawn as one
Hard work pays off for the mini win …
Figure 8-6 in the guideline shows how I made it work with degenerate triangles, for anyone looking to dig deeper into batching more of the misc/custom nodes that are out there…