afonsobspinto / Advancing-Computational-Biophysics-with-Virtual-Reality

A repository to host my master thesis developments @FEUP @MetaCell
0 stars 0 forks source link

Fix memory issues #57

Open afonsobspinto opened 4 years ago

afonsobspinto commented 4 years ago

https://github.com/openworm/geppetto-client/commit/4c5e9d1416cc5252b4b725ec5aee5908b0e070ec

afonsobspinto commented 4 years ago

Hmmm I´ll look into it in more detail but: Initial impression is that when I initiate a new experiment the number of calls is too high. This may be because each cylinder generated is a distinct a-frame entity wich translates to a single call for each object. Also raf is too high because some kind of animation is trying to animate many distinct entities (I noticed there is a color gradient animation). I was having the same problem and the solution was instancing mesh geometry directly on three.js. Your scene is composed of tapered cylinders so there should only be one tapered cylinder in memory. You may take a look at this for instanced mesh and also this may be of purpose. I´ll take a closer look later.

Noticed something else: Try not to use shadows on both lights or reduce the overall shadow map dimensions. Sky is performance heavy and can be replaced by a nice background color. Those are big performance killers.

i´m removing directional light and it decreases raf latency by 30% for me and the scene looks pretty much the same. Noticed something else. A big culprit of raf latency is the menu entity. May have to do with collidable property on enitities over other entities. Try and decrease the refresh rate of thhe raycaster since its a single push button menu. Look that here. (edited)