2

How do I have to use CefSharp to render a 3d WebGL scene?

If I use the following code in my WPF application to initialize Cef. It works but it is very very slow.

var settings = new CefSettings();
//settings.CefCommandLineArgs.Add("disable-gpu", "0");
//settings.CefCommandLineArgs.Add("disable-webgl", "0");

settings.CefCommandLineArgs.Add("enable-gpu", "1");
settings.CefCommandLineArgs.Add("enable-webgl", "1");
//settings.SetOffScreenRenderingBestPerformanceArgs();

Cef.Initialize(settings);

How can I tweak it? I have tried already the CefSharp versions 43, 47, 51.0.0-pre01.

koalabruder
  • 2,582
  • 7
  • 29
  • 36
  • 2
    Results very greatly depending on your `GPU`. Versions `49` and `51` both have issues with the `WPF` control and `GPU` acceleration (make sure to checkout the release notes for each version). The last version that properly support `WPF` with `GPU` acceleration is `47.0.4`. Hosting the `WinForms` version in the `WindowsFormsHost` will give you the best performance, lots of people use this technique. – amaitland Jun 13 '16 at 14:56
  • Thanks. I would accept your comment as answer. But why is there such a large difference in performance between WinForms and WPF? – koalabruder Jun 14 '16 at 11:49
  • 1
    `WPF` is rendered as an image, very different under the hood. – amaitland Jun 14 '16 at 12:36

0 Answers0