Performance - loristissino/RoboThree GitHub Wiki
Statistics
The property simulationDefaults.stats.mode can be set to:
- 0 (frames rendered in the last second -- the higher the number the better)
- 1 (milliseconds needed to render a frame -- the lower the number the better)
- 2 (MBytes of allocated memory)
The latter works only if you use Google Chrome or Chromium Browser, but you should add --enable-precise-memory-info
on the command line.
google-chrome --enable-precise-memory-info &
or
chromium-browser --enable-precise-memory-info &
Processor
The 3D rendering is managed by Three.js using WebGL and should not impact very much on your computer's main processor. But the physics simulation layer does.
If you see that the performance is not very good, you might try to use more than one core when you open your browser.
On GNU/Linux, you can use the taskset
command (thanks to Robydeb for the hint). For instance:
taskset -c 0,1 chromium-browser
or
taskset -c 0,1 firefox
or
taskset -c 0,1 google-chrome
See How to run program or process on specific CPU cores on Linux for further details.
Textures
Images used as textures should have a width and height power of 2. It's better to keep the size of the floor image small enough, expecially if you want to use the virtual pen of the robot to draw on it. Redrawing the floor from the canvas is quite expensive, so it's better to keep the image small (256x256 or 512x512 is ok for most uses).
Graphic card problems
In case of problems with the graphic card, try setting the property "shadow" to false in the defaults.js settings file.