Hacker News new | ask | show | jobs
by ensmotko 4686 days ago
I really like coupling html and webgl, but thus far I've only done it the other way round: adding html on top of webgl. I did this in my last LudumDare game jam [1]. I used html to render nice looking text on top of webgl. Although it's possible to render text within webgl it's messy, especially if you want bold or italic text, different fonts, colors etc.

[1] http://min.psywerx.net/

2 comments

This is pretty cool! Even as simple as this is, it shows how pretty webGL can be, and how it can play nice with DOM elements. Did you have much trouble getting the text to look right?
Thanks! I had no trouble at all with the text. I just created a centered div above the webgl canvas and loaded a custom font from google fonts. I believe I used jquery to accomplish all of this.

It felt like cheating because there was no way I could make the text look this good within webgl under the time constraint (I only had 48 hours for the whole thing).

FWIW that page crashed my browser, FF22 on Kubuntu.
I'm sorry to hear that. Do you have the same issue on other sites that use WebGL or just mine?