Bad peformance on offscreen rendering & other questions

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Bad peformance on offscreen rendering & other questions

Postby DarkShadow » Thu Feb 26, 2015 8:46 am

Hello,

I've been working on a game engine for the last year and i choosed CEF as my UI framework since JS/CSS/HTML are very known technologies and the fact that its easy to make nice visual things without much effort.

I had implemented CEF3 with Chromium 33 and it was working just fine, however, the 3D transforms didn't work so i've upgraded to the latest stable branch (Chromium 41) just to see that the general offscreen peformance has gone worse.

CSS transitions that previously were smooth now they run slower and feels choppy, the game its running at more than 2000FPS so isn't a engine rendering issue (at first), i dont know if i've missed something in the process of upgrading from 33 to 41 that could make the rendering to be slower on offscreen, it also gives the feeling to be out of sync, for example, i fade out the screen using a div, swap something on my engine to draw a different scene and then fade-in, i can see the scene swapping and like 0.5 secs later the screen fades in -> out (the fading is also choppy), i've experimented the same thing with webgl demos, they run fine but gives the feeling that the offscreen rendering isn't being updated as fast as it should.

Note that those issues doesn't happen in Chromium 33 (of course excluding the 3D rendering since isn't even supported)

Another question is, what would be the best way to render a engine-generated model inside chromium? Let me explain myself.

I want to have elements inside my HTML that draws models generated on my engine, for example, by rendering to a texture and then passing up that texture to chromium and display it on a canvas, however i think that requesting each frame manually from JS would give a very poor peformance.

Thanks!
DarkShadow
Newbie
 
Posts: 2
Joined: Thu Feb 26, 2015 8:35 am

Re: Bad peformance on offscreen rendering & other questions

Postby magreenblatt » Thu Feb 26, 2015 11:59 pm

For best performance pass '--disable-gpu --disable-gpu-compositing --enable-begin-frame-scheduling' command-line flags. See http://code.google.com/p/chromiumembedd ... il?id=1368 for details.

In regards to rendering content, take a look at html5 canvas, webgl and animation APIs. If none of those satisfy your use case then consider a custom pepper plugin or generating video and using html5 video tags.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Bad peformance on offscreen rendering & other questions

Postby DarkShadow » Fri Feb 27, 2015 5:12 am

magreenblatt wrote:For best performance pass '--disable-gpu --disable-gpu-compositing --enable-begin-frame-scheduling' command-line flags. See http://code.google.com/p/chromiumembedd ... il?id=1368 for details.

In regards to rendering content, take a look at html5 canvas, webgl and animation APIs. If none of those satisfy your use case then consider a custom pepper plugin or generating video and using html5 video tags.


Great, that fixed the issue, webgl doesn't work anymore but i dont need it but css 3d still works and much smoother :D however i would like to know how can i can set the flags from c++ code to avoid passing them as command line, i've peeked at the settings structs but i didn't found anything.

I'll take a look at the PPAPI since i guess it would be the faster way to accomplish this.

Thanks!
DarkShadow
Newbie
 
Posts: 2
Joined: Thu Feb 26, 2015 8:35 am

Re: Bad peformance on offscreen rendering & other questions

Postby magreenblatt » Fri Feb 27, 2015 11:40 am

You can set command-line flags programmatically using CefApp::OnBeforeCommandLineProcessing().
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 86 guests