Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE 11 WebGL performance slow when using WebBrowser control

I'm trying to embed Cesium in a WebBrowser control inside of a WinForms or WPF application (using IE 11). As a test I'm using this link:

http://cesiumjs.org/Cesium/Build/Apps/CesiumViewer/index.html?stats=true

It "works" but is much much slower than using IE 11 directly. In IE 11, everything runs at 60fps; in a simple WPF or WinForms app with the WebBrowser control it runs at 4-6 fps. I've been unable to track down the cause of the problem. This is with a blank Form or WPF Panel with the WebBrowser control set to fill the entire pane. There's no transparency or other issues that I can imagine. I've noticed that going to the above link inside of the Visual Studio embedded browser has the same effect. Does WebBrowser control not JIT JavaScript? Is it a WebGL issue? Is there a way I can debug this to figure out what's going on? Any help would be greatly appreciated.

like image 825
Matthew Amato Avatar asked Jul 31 '14 04:07

Matthew Amato


1 Answers

Take a look at this article:

As it turns out, the embedded browser uses the IE7 rendering engine by default, even if a newer version of IE is installed. Also, GPU rendering is switched off, so the browser uses software rendering only.

This was fixed by setting the following feature control registry keys:

  • FEATURE_BROWSER_EMULATION – set to the desired version of the IE rendering engine
  • FEATURE_GPU_RENDERING – set to 1 to enable GPU rendering.

These keys can be set under HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER for a specific program (executable name), which uses the embedded browser. HKCU is preferred since the program won’t need administrator privileges to write to HKCU.

So when I set FEATURE_BROWSER_EMULATION to 10000 (for IE10) and set FEATURE_GPU_RENDERING to 1, the performance improved to ~850 fishies @ 60 fps. Still not as good as standalone IE with its 1000+ fishies, but quite an improvement!

like image 178
Luigi Belli Avatar answered Sep 23 '22 06:09

Luigi Belli