Jump to content
  • Advertisement
Sign in to follow this  
Cadoink

WebGL Text/UI. Two canvas' vs One canvas

This topic is 980 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
Advertisement

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!