4 ms·
I prefer BabylonJS for their excellent support. http://editor.babylonjs.com/ http://editor.babylonjs.com/ https://medium.com/babylon-js/programming-with-the-b
by adam12 10y ago
I prefer BabylonJS for their excellent support.
http://editor.babylonjs.com/ http://editor.babylonjs.com/
https://medium.com/babylon-js/programming-with-the-babylon-js-editor-ddab887c243a#.cv5ddrocj https://medium.com/babylon-js/programming-with-the-babylon-j...
http://www.html5gamedevs.com/topic/26619-new-official-babylonjs-ruins-demo-live/ http://www.html5gamedevs.com/topic/26619-new-official-babylo...
http://www.babylonjs.com/demos/ruins/ http://www.babylonjs.com/demos/ruins/
- jeremiep 10y agoWe tried babylon for a mobile VR experience, needless to say the performances are mediocre at best. It runs well on PC because it can afford to waste 95% of the computer's power and still run smoothly for small scenes.
- adam12 10y agoIt does take a little time to learn how to get the best performance out of BJS or any WebGL app. The community is very helpful with that.
- jeremiep 10y agoI looked through the source code and saw string concatenation to set the active texture unit among many other inefficiencies. Everything does isReady() checks multiple times per frame (rather than creating it only once its ready). The material parameters are indexed in the worst possible way. The stats gathering code is still active in release. The list goes on and on :) Some caches are even implemented with bugs. Half the code use a cache in a certain way and the other half in a different way. That was fun to dig into. I tried to optimize Babylon for a few days at work before giving up - my general rule of thumb is that if I'm about to refactor more than 20% of a codebase its much, much faster to rewrite it if I'm already familiar with the problem space. Took about two weeks to write a proprietary renderer running circles around Babylon - but only supported static meshes. Babylon was useful to prototype but the mobile performances aren't there, even after days of profiling and optimizing every slow path it was still an order of magnitude slower than an in-house renderer designed for performance from the ground up.
- adam12 10y agoWhat version of BJS are you referring to?
- jeremiep 10y agoLatest. Here's the string concatenation to set the active texture unit. (By the way the fastest way to do it is "gl.TEXTURE0 + channel" instead of creating the string to index in the proper constant). https://github.com/BabylonJS/Babylon.js/blob/master/src/babylon.engine.ts#L2798 https://github.com/BabylonJS/Babylon.js/blob/master/src/baby... As for the broken cache, I think it was Engine._activeTexturesCache; sometimes its indexed by texture channel other times by GL enum values (this makes the cache array explode to 30k elements and causes cache misses in half the code paths.) From what I remember, lots of caches are needlessly trashed many times per frame. There's also noticeable overhead to all of those "private static <constant> = value;" with public getters.
- deltakosh 10y agoJust pushed an update to remove the string concat. No evidence of broken cache as all references to activeTextureCache use texture channel index.
- jeremiep 10y agoYou won't see it in the code. Run it through the debugger; the value of "channel" is sometimes the value of the GL enum rather than the index of the texture unit. It could've been fixed since as well.
- deltakosh 10y agoFor isReady: you can set material.checkReadyOnlyOnce
- deltakosh 10y agoPerformance wise: http://doc.babylonjs.com/tutorials/Optimizing_your_scene http://doc.babylonjs.com/tutorials/Optimizing_your_scene
- MayorOfMonkeys 10y agoPlayCanvas has a renderer that has an optimized path for stereo rendering - achieves great perf on mobile. https://blog.playcanvas.com/webvr-support-in-playcanvas/ https://blog.playcanvas.com/webvr-support-in-playcanvas/
- jeremiep 10y agoWe had one as well. We're rendering VR with barrel distortion applied in the main vertex shader rather than as a post-process. Saves an expensive framebuffer (some mobile GPUs take as long as half a millisecond to switch render targets) at the cost of a slightly heavier vertex shader. It also requires geometry to be tesselated for the distortion effect to work. We had to write our own polyfill for our implementation but it beats the post-process technique of webvr-polyfill quite easily. That's how UE4 and Unity3D do barrel distortion as well.