GrosSacASacs Posted May 2, 2016 Share Posted May 2, 2016 How could BabylonJs possibly be faster ? or Why is BabylonJs slower than what it could be ? What needs to be done. Any area we can help to make this engine faster ? Give us concrete directions so that we can help. I know BabelJs itself is not slow. It does nothing by itself. However, I would like also to know: what are the best practices to take full advantage of BabylonJs speed. This demo is really slow : http://flightarcade.com/missions/tin/play Why is it so slow, and what can we learn from it ? Quote Link to comment Share on other sites More sharing options...
WombatTurkey Posted May 2, 2016 Share Posted May 2, 2016 Not slow for me? What are your specs? Btw, the controls on that game are absolutely horrid Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 2, 2016 Share Posted May 2, 2016 Fast or Slow it is not depend for BABYLONJS or any other Engine ! BABYLONJS Like Tools For Make WebGl So Your last Buffer and Shaders and Texture and 3D Sytems (collision ray cast shadow reflect dynamic postprocess) and Game system (physics SPS .. ) Client Resource (GPU CPU RAM ) can make your result fast or slow you need make this stuffs for make fast 1. Buffers : make it any low buffer you can have stable scene (texture size + vertex,faces,alpha mode ) 2. Shaders: you need make it low data communication (less dynamic - less calculate ) 3. Texture : try use in small than 1024 x 1024 (compress or uncompressed is not matter ) try use (DDS format) and try Use smart Array For Loading (less Ram ) 4. 3D Systems (collision ,ray cast ,shadow reflect dynamic postprocess) : you need research that all a lot of way to make faster 5 . Game system (physics SPS .. ) BJS have wonderful Game System just learn how to use it standard way. 6. Client Resource (GPU CPU RAM ) look your customers clients and choose best (resolution +polygons +(on or off) your unnecessary ) (hd or sd ) and mobile 7. learn about octree and lod system 8. move all you can to GPU side jerome, Dal and ozRocker 3 Quote Link to comment Share on other sites More sharing options...
adam Posted May 2, 2016 Share Posted May 2, 2016 NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
Dal Posted May 2, 2016 Share Posted May 2, 2016 When working with WebGL you have to keep in mind a few things: Javascript is a dynamic language and isn't precompiled to machine code. That means it runs a lot slower than native C++ code as there's more work to do to get it into something the CPU can run and some of the optimizations that C++ compilers can do are not possible. On the other hand, there's no "compile time" involved when working with JS. You can make changes and see them reflected on the screen right away. There's no need to install and compile loads of libraries or dependencies to get it working, it just works in any modern browser. WebGL itself is limited - a lot of the more advanced features of OpenGL and DirectX 11 are not available to us yet in WebGL, so we can't always do everything the full-blown libraries can and we can't always get all their optimizations either. The benefits though really outweigh that in my opinion. What we lose in runtime speed we gain in development speed and productivity. You can instantly see your results and quickly iterate your changes without waiting for things to rebuild. You don't have to waste time dealing with memory addresses and craziness. You don't need to worry too much about different platforms at all and you certainly don't have to port the code to a bunch of different systems or maintain multiple projects for different targets. You don't have to worry about different audio drivers or write all your shaders differently for different targets. If raw speed is all you care about, WebGL will never be as fast as some C++ engines. But if you only have a small team or are working on your own and you want to build something that can run everywhere, its worth it. That said - I am sure there are ways Babylon can still be optimized. There's always room for improvement in any system jerome and NasimiAsl 2 Quote Link to comment Share on other sites More sharing options...
davrous Posted May 2, 2016 Share Posted May 2, 2016 10 hours ago, GrosSacASacs said: How could BabylonJs possibly be faster ? or Why is BabylonJs slower than what it could be ? What needs to be done. Any area we can help to make this engine faster ? Give us concrete directions so that we can help. I know BabelJs itself is not slow. It does nothing by itself. However, I would like also to know: what are the best practices to take full advantage of BabylonJs speed. This demo is really slow : http://flightarcade.com/missions/tin/play Why is it so slow, and what can we learn from it ? Is this question simply a pure troll? There is absolutely no fact about any performance issues we may have. You just can't say "why is it so (???) slow" without any pointers or performance benchmarks you may have done. We've been spending a lot of time optimizing performances and memory resources usage on all platforms. We're probably the best WebGL engine to run on all platforms thanks to a specific architecture in our shader pipeline. WebGL is very limited compared to DirectX 11 or OpenGL on desktop/native. Still, we've managed to build demos that have impressed WebGL "experts" such as this one: http://babylonjs.com/Demos/Sponza/ and this one: http://babylonjs.com/demos/SponzaDynamicShadows/. We have plenty of modern optimizations in a lot of parts of our engine (from web workers to SIMD support). Please share your background & skills to explain us why you think it's too slow before suggesting us we need your help. I'm really interested in discovering what we may have missed. David NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
GrosSacASacs Posted May 2, 2016 Author Share Posted May 2, 2016 Thanks alot for the constructive answers. Let me rephrase this question " Why is BabylonJs slower than what it could be ? ": What changes could we make to make a future BabylonJs version faster than the current one ? or ; Is BabylonJs perfect, and if not what is left for improvement ? Also I would like to know what makes the flight simulation low on fps, even on devices that render other games that seem to have more complexity at 60 fps, and this has probably nothing to do with BabylonJs, but insights from the creators would be nice. Quote Link to comment Share on other sites More sharing options...
adam Posted May 2, 2016 Share Posted May 2, 2016 29 minutes ago, GrosSacASacs said: Also I would like to know what makes the flight simulation low on fps, even on devices that render other games that seem to have more complexity at 60 fps Please provide links to the other games. Also, that flight simulator game is running on BJS 2.1.0 beta. Quote Link to comment Share on other sites More sharing options...
jerome Posted May 2, 2016 Share Posted May 2, 2016 flight arcade run at 60 fps in Chrome on my work desktop computer here could you tell us what FPS you got, what device, what browser ? and compared to what faster on the same environment ? your questions are very general, it's quite difficult to answer Quote Link to comment Share on other sites More sharing options...
GrosSacASacs Posted May 2, 2016 Author Share Posted May 2, 2016 I don't think it matters who I am. This is not how open source works. I am not attacking you, I am trying to help. If you think everything is perfect, say so. I am not communication god, I don't use the best words. 30Fps in chrome and firefox latest, pc hardware: Processor 3.4 GHz Core i7 6700 RAM 16 GB DDR4 Memory Speed 2133 MHz Hard Drive 1 TB SATA Graphics Coprocessor NVIDIA GTX 745 4GB DDR3 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 2, 2016 Share Posted May 2, 2016 i don't care any engine anyway but i care about team behind of engine in babylonjs we have wonderful members you can not found any where (team like this ) and you can not collect anyway so if you wanna join for us you welcome we don't talk more about fake conversation i think you have your answer in the replays so maybe you ask wrong question again? have good time Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 2, 2016 Share Posted May 2, 2016 There are SO many places where we can optimize code. But your question is too generic. For a scene with gazillons of sprites if we optimize the physics engine it won't change anything Quote Link to comment Share on other sites More sharing options...
Fatalist Posted May 2, 2016 Share Posted May 2, 2016 1 hour ago, GrosSacASacs said: 30Fps in chrome and firefox latest, pc hardware: Processor 3.4 GHz Core i7 6700 RAM 16 GB DDR4 Memory Speed 2133 MHz Hard Drive 1 TB SATA Graphics Coprocessor NVIDIA GTX 745 4GB DDR3 It works at 60fps on my much weaker PC. What OS do you have? Quote Link to comment Share on other sites More sharing options...
adam Posted May 2, 2016 Share Posted May 2, 2016 12 hours ago, GrosSacASacs said: what are the best practices to take full advantage of BabylonJs speed Quote Link to comment Share on other sites More sharing options...
jerome Posted May 2, 2016 Share Posted May 2, 2016 and what browser ? (and version ?) Quote Link to comment Share on other sites More sharing options...
MasterSplinter Posted May 2, 2016 Share Posted May 2, 2016 Babylon is about as fast they come for a webgl abstraction. Quote Link to comment Share on other sites More sharing options...
Dal Posted May 3, 2016 Share Posted May 3, 2016 @GrosSacASacs Looking at your system specs, you should certainly be able to achieve 60fps in the flight arcade demo based on my own testing/experiences. Is your browser using your GPU? It may seem obvious but there are quite a lot of ways in which your browser may not actually be using the GPU. First, the obvious one, check you have the proper graphics card drivers installed. Next, if you have switchable graphics,by default browsers usually use the low-power GPU instead of the main GPU. You need to force that in the driver settings. Next, check in your operating system power saving options and any third-party power management apps you have installed - again, sometimes software can set the GPU to run in power saving mode, particularly if you're running a laptop without the power cable plugged in. Make sure everything is set for maximum performance. Also, you don't mention what operating system you are using. I find I get much worse performance under Linux even with the Nvidia drivers installed because Chrome's DirectX browser backend seems to be better optimised than the OpenGL one. 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.