jahow Posted January 29, 2015 Share Posted January 29, 2015 I'm actually updating two tube meshes with 200 points each, and it's still pretty smooth on my computer. So congrats for your function Quote Link to comment Share on other sites More sharing options...
jerome Posted January 29, 2015 Author Share Posted January 29, 2015 thank you What do you mean by "updating" ?I am rightly wondering how to dynamically deform a mesh ! [EDIT]oops didn't notice your previous post with the playgroung example !Very nice As far as I understand you recreate 2 tubes each frame. Am I right ? I would find a way to keep the existing mesh and just change dynamically its curve/radius for instance.[/EDIT] Quote Link to comment Share on other sites More sharing options...
jahow Posted January 29, 2015 Share Posted January 29, 2015 As far as I understand you recreate 2 tubes each frame. Am I right ? Absolutely. The 'createTube' function is called twice each frame. The first optimization I'd try would be to split the trail in segments, each a separate submesh. Then, I just have to add a new segment and remove the last one each frame. But this would not work with the radius variation... Vertex shader could work for that but that would result in a very complex system for a purely cosmetic feature. Another solution is to dig into the vertex buffers, like Temechon suggested in your other post. But rebuilding buffers is a costly operation, and it would be complex to do: once the tube mesh is done and its vertices buffers are set up, 'reopening' them would require knowing where to look and which vertices to modify. I'm not familiar enough with WebGL and the internals of BabylonJS to help you more on this... Also, if it was up to me and I'd have to draw a ship trail in space, I'd simply use billboarded quads jerome 1 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.