Jump to content

slow DOM events and actions managers after upgrade to 2.5


drbanetti
 Share

Recommended Posts

Hello,
First thing, excuse my english, not my native language, second thing, I have a small problem with events and I cannot point if that's my coding or something else, in Edge browser is most prominently visible, but I also feel an "almost" unnoticeable delay in Chrome or Firefox  - DOM events and canvas/babylonjs events/action managers are fired with delay from the moment I upgraded babylonjs from 2.4 to 2.5.
 
It's my first foray into webgl, javascript, web apps, so be indulgent. I tested this page on a laptop with both integrated Intel graphics and a nvidia 940m dedicated card (which is not used  at all on webgl I saw).
In the attached file you'll see the page that I put together all in one place and the behaviour of the events when you'll change the version of the babylonjs in the file.
Please don't take into consideration the design of the page or the graphics in general, I put some colors quickly in place of images and textures over some primitive meshes.
 
Anyway, when I use babylon 2.4, DOM mouse over menus events, click events in the textbox worked ok in the DOM, responding quickly, the same was the animation of the sphere and the action managers pointerover for the 3 planes in the middle of the canvas.
When I changed to 2.5 version, I had delays both in dom events: mouse over menu elements, click in the text box, or babylonjs events - the speed of the sphere animation and the pointer over actions for the 3 planes in the middle are delayed noticeably.
 
I used cdns for both jQuery (ver. 3.1.1) and babylonjs, so just change/comment the lines for babylon to see this behaviour on different versions.
 
Thank you and please, if you saw were the problem resides (js code, styles, etc.), let me now.

test.html

Link to comment
Share on other sites

Hello,

I've created http://www.babylonjs-playground.com/#BEP46#1 hope I put them ok, I tried to mimic the page as it was constructed.

In Edge browser, it has the same behaviour as in my test page, the 3 blue planes are slow to react at pointerover. In my test page, also the dom elements has slow events raised, like mouse over, but i cannot put them in playground.

Thanks

Link to comment
Share on other sites

Hi again,

It seems to be in hardware mode, the only message in console is BJS - [19:45:07]: Babylon.js engine (v2.6-alpha) launched

I made a short video of how it's going on the laptop.  There is a delay from the moment the pointer is over a blue plane until the moment the action is taken place.

i've upgraded the graphics drivers to last versions before recording it. On babylon 2.4 worked ok, the moment pointer was above the plane, the action fired instantly, no delays.

It can be a fact that the card used is the integrated Intel, the nvidia is not used at all. I'll have to check if I enable the GPU to be only NVIDIA in Windows, what happens then. Shamefully, I didn't try it yet :(

playground 1.mp4

Link to comment
Share on other sites

Hi,

The problem was mainly in the Edge browser, in Chrome or Firefox from what I tested it works ok also for me. Even in IE11 it works well.

I set the nvidia control panel to have preferred graphics NVIDIA, i set Chrome and Firefox to also have the NVIDIA as preferred, but eveytime the intel onboard graphics was used, no matter what I've set.

After looking on the internet, I found that a solution could be disabling the onboard graphics from bios and that finally worked for me. The nvidia GPU was at last used in Edge browser for WebGL and the delays were history. So it looks as a driver problem on part of intel perhaps.

Link to comment
Share on other sites

Hello 
Edge is always a bit tricky, i know that some guys don't even put 'experimental-webgl' in their code, since webgl and webgl2 is standardized. Working with Edge is kind of a special case gl.debuginfo if==edge alert('download firefox&chrome') will fix most issues. 

Also note that everything you do on a Windows machine will be transpired to DirectX (ANGLE) so make sure your GraphicDriver is up-to-date and has proper ANGLE support.  workaround for enable OpenGL on Windows/ Browsers -disable ANGLE exists, but since OpenGL runs few ms slower on a Windows Machine then native DirectX code, i would not recomend it. One year ago as ANGLE was build upon DirectX 10, some people do this, becourse back then OpenGL has a greater Max Texture Size, they fixed it in DirectX 11.
https://browserleaks.com/webgl
 

Link to comment
Share on other sites

@drbanetti -

I'm not certain why you would want to use Edge at all - since it performs far below all other browsers in Windows 10 and even worse in Windows 7. Only IE benchmarks lower in some areas. I also have not been able to repro any latency in any of my browsers and/or OS, and don't wish to install Edge on any system. So obviously the issue is in using Edge, and if this is the spec you must follow in your current development, then I hope you're running Windows 10; as WebGL is hardly usable these days in Edge using Windows 7. Otherwise, your PG scene performs consistantly in all areas of hardwre resources using either 2.4 or 2.5 on all of my systems excluding using Edge.

I wish there was a way to improve this, but Edge has legacy issues which I don't foresee improving in the near future since there is little incentive to improve - not to mention that this would require considerable effort in changing much of the architecture acording to my sources.

Cheers,

DB

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...