grovesNL Posted December 8, 2015 Share Posted December 8, 2015 I am working on an interactive data visualization in which thousands of graphic elements have to be updated continuously as the user drags an endpoint connected to each node. When render times are too slow the visualization feels sluggish and breaks interactivity. A simple (non-interactive) example can be found here, which replicates my issue with render times: http://jsfiddle.net/grovesNL/vsso0gtb/ A significant amount of time is spent in garbage collection. I've considered using object pools in the Pixi library for WebGLGraphicsData.points and WebGLGraphicsData.indices (ie. stop setting both of these to [] every time WebGLGraphicsData.reset is called). This means buildLine could add points as necessary by tracking the last index. Afterwards the arrays could be trimmed before the render call to remove old data from the end. I am mostly looking for feedback to this approach, and whether it could be implemented more elegantly. I've taken some steps to implementing it already, but it requires modification of most of the graphics drawing methods. I'm also not sure if there are any straightforward methods to realize performance gains here. Perhaps Pixi already has a better, native way to handle this. Eventually I do plan to try allowing the shaders to calculate the lines based on line width instead, which should decrease the amount of time spent in buildLine. However the garbage collection problem will remain, which is why I am targeting that first. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 8, 2015 Share Posted December 8, 2015 Copy PIXI.Graphics and implement Graphics object that will work better. I can help you with it, may be we'll swap standart pixi graphics to new one Do you prefer skype or google hangouts? Quote Link to comment Share on other sites More sharing options...
grovesNL Posted December 9, 2015 Author Share Posted December 9, 2015 I'm trying to avoid re-implementing the entire Graphics object, because there are some features that probably necessitate the calculations to be performed outside of the GPU (such as use of earcut for polygon fills). Perhaps we could just begin with a fast Line Segment object (using WebGL shaders) as an extension. I don't use either of those services but you can email/add me on Google Chat at josh (at) joshgroves (dot) com. I'm also on GitHub at this username. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 9, 2015 Share Posted December 9, 2015 Google chat = hangouts Ok, sent you an invitation Quote Link to comment Share on other sites More sharing options...
K.N. Posted June 15, 2017 Share Posted June 15, 2017 What was the solution for this? Did you guys figure out how to do this? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 15, 2017 Share Posted June 15, 2017 yep, "nativeLine" in graphics Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.