MDP Monkey Posted March 31, 2017 Share Posted March 31, 2017 Hello! Does anyone have time to lend a hand with some optimisation please? I've been trying to get some dynamic ring shapes to look good and respond well, and performance seems OK on PC's (I've tested on 3 or 4 PC's with varying specs). On Macs (iMac, recent macbook pro and a mac mini) the CPU shoots up to 99% in Safari, so I'm obviously doing something wrong. Even with texture reflection and refraction turned off and lower detail it's still very jumpy and slow. I updated chrome on the mac, which seemed to help and gave much better performance - but it's still far from the performance of a PC. I have a feeling that Safari might just have a bad implementation of WebGL. The basic playground examples run really slowly too. I'm using a Lathe to create the ring, and I'm aware of the latheTesselation, which shouldn't be too high. The API says that the Lathe can be set to "updatable", and I've tried to use code to update it, but the 2 code examples that I tested just didn't work. I think this is because the update can only move existing points, and not replace them. Any time I want to update the ring parameters I just dispose of it and recreate it. Any tips are well appreciated - And sorry about the shoddy code!! http://tolli.co.uk/babylonjs/rings/ Quote Link to comment Share on other sites More sharing options...
jellix Posted April 1, 2017 Share Posted April 1, 2017 Hi, first you should look if the version of the safari browser really supports WebGL. Then to optimise the performance you should generally know how to - merge meshes to reduce the 'drawing calls' - use instances or clones when possible (plz learn about the differences) - clean up the scene: dispose meshes WITH their materials and also their textures. Quote Link to comment Share on other sites More sharing options...
MDP Monkey Posted April 2, 2017 Author Share Posted April 2, 2017 Great. I'll look into your recommendations. I think I'll have to create an alternative for Safari tho because even the latest version struggles to run the basic babylon playground examples. Cheers 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.