Sign in to follow this  

WebGL Text/UI. Two canvas' vs One canvas

This topic is 669 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all!

I am making a little webgl engine, and I am currently working on GUI's. I have a pretty good idea of how to render text to the screen using a font file and quads, however, I have been reading a little about using a second HTML canvas with a 2D context that is placed over the top of the first canvas.

 

This system seems nice because I don't have to think about the 3D area, and I get the browser fonts built into the system.

 

However, I suspect there could be some issues with this system. For example, if I wanted to use a specific font, I would still need to push the texture, and the font file over the web. In addition, I don't know what the performance cost of having two canvas' is or if it will have any impacts on detecting the mouse. 

 

So I was wondering what some of your thoughts are on this topic? Is it worth have a separate canvas for text and UI? Are there any other issues (or benefits) that I have not thought of? Finally, are there any performance implications in having two canvas'.

 

I appreciate any feedback on the subject.

 

Thank you!

 

Chris

Share this post


Link to post
Share on other sites

I think browser do wonders with layers. I am still amazed how fluent animations are, compared to flickering stuff in WinForms. The browser has to manage layers for all this modern CSS stuff and will be probably pretty optimized. Some passive html pages load fonts (inline) over the web. If it is not Chinese and baroque it is not that large.

Share this post


Link to post
Share on other sites

This topic is 669 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this