Questions regarding embedding CEF in a game

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

Questions regarding embedding CEF in a game

Postby Asadas » Wed Mar 22, 2017 6:43 pm

Hi! I need to integrate a browser in our game in the near future, so I'm trying to find out whether we can run CEF at high frame rates and synchronize it with the game rendering.
Already looked at the cef-client example, but so far I failed to get it running at more than 64 fps when offscreen is enabled, needs to handle 144+.

I'm currently thinking of a system like this:
- Game provides a render target for each open browser widget
- Browser draws to this render target using gpu rasterization
- Game reads from the render targets to draw the browser widgets

For the synchronization, I'd like CEF to draw exactly one frame for every frame drawn by the game.
Similar to using vsync, except that it will block until the game processed the browser widget.


Can this be done using CEF? Or maybe I'm completely on the wrong path here? Thanks!
Asadas
Newbie
 
Posts: 3
Joined: Wed Mar 22, 2017 5:58 pm

Re: Questions regarding embedding CEF in a game

Postby magreenblatt » Wed Mar 22, 2017 9:27 pm

What is the point of such high frame rates when hardware operates at 60Hz?
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: Questions regarding embedding CEF in a game

Postby magreenblatt » Wed Mar 22, 2017 9:29 pm

CEF does not currently support rendering to a GPU surface provided by the client application. See https://bitbucket.org/chromiumembedded/ ... ardware-gl
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: Questions regarding embedding CEF in a game

Postby Asadas » Thu Mar 23, 2017 7:07 am

magreenblatt wrote:What is the point of such high frame rates when hardware operates at 60Hz?

Many players have 120 or 144hz monitors nowadays. I'm running a 100hz ultrawide myself, and things just feel a bit... smoother, I guess? It's nice.
But yes, if someone has a 60hz monitor, they'd run it at 60 fps.


magreenblatt wrote:CEF does not currently support rendering to a GPU surface provided by the client application. See https://bitbucket.org/chromiumembedded/ ... ardware-gl

Well that's a shame. I'll see if we can hack something here as drawing to a window already works.
Though it seems strange to me that this issue is basically stuck since 2015... it's an essential feature for integrating CEF in a high performance engine.
Asadas
Newbie
 
Posts: 3
Joined: Wed Mar 22, 2017 5:58 pm

Re: Questions regarding embedding CEF in a game

Postby magreenblatt » Thu Mar 23, 2017 10:40 am

magreenblatt wrote:CEF does not currently support rendering to a GPU surface provided by the client application. See https://bitbucket.org/chromiumembedded/ ... ardware-gl

Well that's a shame. I'll see if we can hack something here as drawing to a window already works.
Though it seems strange to me that this issue is basically stuck since 2015... it's an essential feature for integrating CEF in a high performance engine.

There are a number of game engines that embed CEF currently (search Google for examples). It's unfortunately not possible to provide the optimal architecture for every use case.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: Questions regarding embedding CEF in a game

Postby magreenblatt » Thu Mar 23, 2017 10:49 am

Asadas wrote:
magreenblatt wrote:What is the point of such high frame rates when hardware operates at 60Hz?

Many players have 120 or 144hz monitors nowadays. I'm running a 100hz ultrawide myself, and things just feel a bit... smoother, I guess? It's nice.
But yes, if someone has a 60hz monitor, they'd run it at 60 fps.

Does Google Chrome run at 100FPS on your display? You can test with http://webglsamples.org/field/field.html
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: Questions regarding embedding CEF in a game

Postby Asadas » Thu Mar 23, 2017 10:56 am

magreenblatt wrote:
Asadas wrote:
magreenblatt wrote:What is the point of such high frame rates when hardware operates at 60Hz?

Many players have 120 or 144hz monitors nowadays. I'm running a 100hz ultrawide myself, and things just feel a bit... smoother, I guess? It's nice.
But yes, if someone has a 60hz monitor, they'd run it at 60 fps.

Does Google Chrome run at 100FPS on your display? You can test with http://webglsamples.org/field/field.html


Yes, chrome runs at 100fps with g-sync. Actually so does the cef-client, but only when offscreen is disabled.
Asadas
Newbie
 
Posts: 3
Joined: Wed Mar 22, 2017 5:58 pm


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 28 guests