Cocoon.js & Three.js: Productivity Improvement

I developed a rudimentary 3D game using box2Dweb for physics and three.js for rendering. This is the main scroller. I would like to get it and run it on iOS. I decided to use cocoon.js to package the game, since it allows you to use WEBGL on iOS

The problem I am facing is performance. On a desktop computer, the game runs at about 50 frames per second. On the iPhone 5, it runs at 3 frames per second.

I tried to hide the game, deleted all the textures, deleted the shaders, deleted the skybox, had a lower level (only what is on the camera screen, and a little behind and in front). This gave me a 25% increase in performance. Now it works at 4FPS

I looked at the demos that come with the iOS launcher app and they all work very smoothly.

The only thing I can do to improve performance is to minimize JS, which I think will not give a big increase in performance.

I am using Accelerated Canvas / WebGL in a launch application. I also tried compiling with the canvas + option, the same problem. I am using 3D revision 67. I am using the webGL renderer in the three.js file:

this.renderer = new THREE.WebGLRenderer

Any suggestions on how to improve the performance of the three .js with cocoon.js?

+4
source share
2 answers

I managed to improve the frame rate to about 25 frames per second, so a huge improvement.

, , :

object3d.castShadow = false;

light.castShadow = false;

renderer.shadowMapEnabled = false;

. . ,

, fps

JavaScript, , ,

+5

Source: https://habr.com/ru/post/1538796/


All Articles