Subpixel text rendering with offscreen renderer.

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.

Subpixel text rendering with offscreen renderer.

Postby fokz » Sat Jun 18, 2016 11:37 am

Hello,

I am trying to use CEF3 (2704) to render UI to an offscreen texture that is later used by a 3d application written in OpenGL. Thus I need the whole UI rendered to a texture with transparency. But I have noticed one problem: whenever I enable the transparency via window_info.transparent_painting_enabled = true; I get working transparency but the ClearText or if someone prefers Subpixel Text Rendering is gone and it falls back to the grayscale rendering which is way more less readable. This among many other things was the reason to decide and integrate CEF as a front-end layer for my application as it solves many UI problems, web technologies are great for prototyping and in addition there was this bonus of having rich 'drawing' routines already present like subpixel text.

Am I doing something wrong? Is this a bug, or intented behaviour and there is no way to enable subpixel rendering along with transparency in offscreen mode? Any help would be appriciated.

Also is there any movement in fixing the issue with offscreen rendering in newer branches? The lack of GPU support makes the rendering kind of sluggish and as far as my research went I see I cannot easily fallback to 2526 branch as there are problems with compiling under Vs2015u2 right?
fokz
Techie
 
Posts: 22
Joined: Sat Jun 18, 2016 10:53 am

Re: Subpixel text rendering with offscreen renderer.

Postby magreenblatt » Mon Jun 20, 2016 10:08 am

Can you provide an example of the subpixel issue that you're seeing? Running cefclient with `--off-screen-rendering-enabled --transparent-painting-enabled --url=http://tests/transparency`in 2623 and 2704 looks OK to me.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Subpixel text rendering with offscreen renderer.

Postby fokz » Wed Jun 22, 2016 12:07 pm

Sorry for late reply.

This is how it looks in my APP. The scenario is the following, in one case I have transparent_painting_enabled = true passed to windows settings. The HTML document being rendered to the offscreen buffer has in CSS body background specificed as rgba(0,0,0,0) and the effect is the following, which is correct but note the text has no subpixel rendering:
Image

But if I disable the transparent_painting_enabled flag it looks like this:
Image

Please note the background change, in the first case it was cornflower blue coming from the OpenGL rendering itself the scene was cleared and the texture with HTML conent was rendered on top of it. In the second case the whole picture is a texture and you can see the default white texture.

The zoom and guides are from screenshot capturing app called Greenshot so you can see what I mean.

I will try what you said in cefclient and report back the results.
Last edited by fokz on Wed Jun 22, 2016 12:37 pm, edited 1 time in total.
fokz
Techie
 
Posts: 22
Joined: Sat Jun 18, 2016 10:53 am

Re: Subpixel text rendering with offscreen renderer.

Postby magreenblatt » Wed Jun 22, 2016 12:22 pm

How are you blending the transparent bitmap in your application? Keep in mind that CEF uses premultiplied alpha.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Subpixel text rendering with offscreen renderer.

Postby fokz » Wed Jun 22, 2016 12:35 pm

I am using premultiplied alpha as well but please note that the text regions and the dark gray backgrounds they are displayed on are all HTML elements so this is all chromium rendering that I finally display as a textured quad so blending is not an issue here. The thing is that enabling transparent backgrounds disables subpixel text rendering and I think this is not intended behaviour.
fokz
Techie
 
Posts: 22
Joined: Sat Jun 18, 2016 10:53 am

Re: Subpixel text rendering with offscreen renderer.

Postby Foiled » Thu Apr 06, 2017 9:47 am

Hello,

I am encountering the same problem (using CEF 3.2704) where subpixel antialiasing does not occur with offscreen rendering, falling back to grayscale aa.
Was anyone able to get subpixel aa working with offscreen rendering?
Foiled
Newbie
 
Posts: 1
Joined: Thu Apr 06, 2017 9:29 am

Re: Subpixel text rendering with offscreen renderer.

Postby fokz » Thu Apr 06, 2017 11:50 am

Foiled I haven't fixed the issue yet, I had a long break from CEF and now coming back to it but as far as I remember this happens when you enable transparent painting in OSR. Without transparent painting it uses subpixel text rendering so if you don't need transparency it might solve your issue.

Btw Marshall - your question regarding the issue - I just verified - this also happens in cefclient. I am not sure what and where the issue actually is. I was looking at Spotify client UI and it seems that parts of their UI is with subpixel font rendering and some is not. I guess they use multiple frames some of which use painting with transparency enabled which turns off subpixel text rendering?
fokz
Techie
 
Posts: 22
Joined: Sat Jun 18, 2016 10:53 am

Re: Subpixel text rendering with offscreen renderer.

Postby magreenblatt » Thu Apr 06, 2017 11:53 am

fokz wrote:Foiled I haven't fixed the issue yet, I had a long break from CEF and now coming back to it but as far as I remember this happens when you enable transparent painting in OSR. Without transparent painting it uses subpixel text rendering so if you don't need transparency it might solve your issue.

Btw Marshall - your question regarding the issue - I just verified - this also happens in cefclient. I am not sure what and where the issue actually is. I was looking at Spotify client UI and it seems that parts of their UI is with subpixel font rendering and some is not. I guess they use multiple frames some of which use painting with transparency enabled which turns off subpixel text rendering?

Yes, it seems to be a general Chromium issue with transparency and not CEF-specific.
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 67 guests