Game HUD using HTML

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
Mayko64
Gnoblar
Posts: 5
Joined: Sun Apr 08, 2012 6:26 am

Game HUD using HTML

Post by Mayko64 »

G'day, is it possible that when using Ogre3D as a render engine, to attach a static visual layer (Such as a HUD that you would see in a game), from an html file.

For example, if I had a collection of vector graphics that are processed, arranged, and linked to specific actions like opening a menu scripted in the HTML (From using a website builder to make the in-game GUI); would it be possible (or if there is an addon, or python script, etc.) for Ogre to read/process that HTML file on the screen like a HUD in a video game.

Or in other terms viewing a website (Local HTML File) in Ogre like a static layer, where the rendering is taking place behind it.

please reply soon :)

User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: Game HUD using HTML

Post by Klaim »

There are two libraries that might fit your need (it fits mine):

- Awesomium http://awesomium.com/ with Navi (wrapper for Ogre) https://github.com/khrona/Navi
- Berkelium http://berkelium.org/

Both just strip down a bit then embedd Chromium (the open source part of Chrome, that is, 95% of Chrome) and provide a simple to use C++ interface to draw the result on a texture or throw some inputs (mouse & keyboard) to the virtual windows.
Awesomium is developped by a company and doesnt provide the source code. They also require licencing in some cases.
Berkelium was born at the time Awesomium became closed source because the developers of a game did need the sources so they made their own wrapper and provided it open source.

For having used both I can say that they basically provide the same basic features. However, Berkelium is easier to work with when you have a problem as you can tweak the code; while Awesomium is far more stable, efficient and flexible than Berkelium. Also they really listen to their users so having a company full time on this project is actually an important thing.

For one company work, I choose Berkelium because the open source stuff was required and they didn't want to spend money on the tech.
For my own game I'm choosing Awesomium because in the end it'll be free for me (until I become rich I guess) and I don't really need the source code and finally because I need the most flexibility ever for this project.

So, choose depending on your needs.

Mayko64
Gnoblar
Posts: 5
Joined: Sun Apr 08, 2012 6:26 am

Re: Game HUD using HTML

Post by Mayko64 »

The Awesomium feature list has exactly what I'm looking for, and Navi will be useful in adding live active controls to objects to simulate interactive machinery.

& Berkelium I can use to add straight forward web support.

Thanks Much friend :D

User avatar
duststorm
Minaton
Posts: 921
Joined: Sat Jul 31, 2010 6:29 pm
Location: Belgium
x 80
Contact:

Re: Game HUD using HTML

Post by duststorm »

I think feature-wise that both Awesomium and Berkelium have about the same functionality.
Or am I wrong in this?

Anyway, you can do some pretty nice stuff with them, and they are a good fit for making user interfaces (a lot of people know HTML layouting already, you can test outside of the application)
The browser can be rendered on anything that can take a texture, so both overlays as objects in your scene, as well as passing it as input to a shader.
Developer @ MakeHuman.org

User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: Game HUD using HTML

Post by Klaim »

duststorm wrote:I think feature-wise that both Awesomium and Berkelium have about the same functionality.
Or am I wrong in this?
Exactly.
Dont use both, choose one!

User avatar
duststorm
Minaton
Posts: 921
Joined: Sat Jul 31, 2010 6:29 pm
Location: Belgium
x 80
Contact:

Re: Game HUD using HTML

Post by duststorm »

Klaim wrote:Exactly.
Dont use both, choose one!
Given they're almost identical I'd go for Berkelium, because the license is much more free and allowing. But that's a personal preference.
Agreed Awesomium has a fancier website and promotes a lot of fancy features. But those features in fact all come from Chromium itself, which both libraries are using.
Developer @ MakeHuman.org

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Game HUD using HTML

Post by jacmoe »

If your goal is to be able to use HTML/CSS, then I wouldn't recommend that you use either of those libs.

Why embed a browser if you don't need it?

I would use LibRocket instead:
http://librocket.com/wiki
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: Game HUD using HTML

Post by Klaim »

duststorm wrote:
Klaim wrote:Exactly.
Dont use both, choose one!
Given they're almost identical I'd go for Berkelium, because the license is much more free and allowing. But that's a personal preference.
Agreed Awesomium has a fancier website and promotes a lot of fancy features. But those features in fact all come from Chromium itself, which both libraries are using.

Actually, no I'm talking about the library features, not Chromium features. For example I had to add some features myself to berkelium when I worked with it and it's not guaranteed in my experience that the library will work for every platform it is supposed to work with. It was fine for the project I was working on, so you just have to think like that:
- supported by a company that have full-time developers making sure it works well and is well designed, but closed source : go for Awesomium
- open source, easy to tweak but (far) heavier on binary size and provided with no guarantee of any sort: go for Berkelium


Both are good. Depends on the project.

User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: Game HUD using HTML

Post by Klaim »

jacmoe wrote:If your goal is to be able to use HTML/CSS, then I wouldn't recommend that you use either of those libs.

Why embed a browser if you don't need it?

I would use LibRocket instead:
http://librocket.com/wiki
Oh yeah I forgot about this one. Depends on your needs really: myself I need most of the features of a browser, while most game developers will only need something to make a UI with HTML. If you're in the last case and the license is ok for you, Librocket is nice too.

Also, Awesomium & Berkelium dont support ios, android AFAIK even if I guess they could.

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Game HUD using HTML

Post by jacmoe »

Librocket license is MIT - how can that not be alright? :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: Game HUD using HTML

Post by Klaim »

I mixed with another one! That's really good! :D

I'll try it for other projects, I still need almost full browser for this one but it's really a specific case.

User avatar
duststorm
Minaton
Posts: 921
Joined: Sat Jul 31, 2010 6:29 pm
Location: Belgium
x 80
Contact:

Re: Game HUD using HTML

Post by duststorm »

Thanks for the tip jacmoe, I didn't know of its existence. Very interesting.

And yes, I agree the build size of Berkelium is pretty large (it just packs the full chromium browser, but can you do better without stripping the browser down?).
Developer @ MakeHuman.org

User avatar
Beauty
OGRE Community Helper
OGRE Community Helper
Posts: 767
Joined: Wed Oct 10, 2007 2:36 pm
Location: Germany
x 39
Contact:

Re: Game HUD using HTML

Post by Beauty »

Very useful information in this topic.

I copied many paragraphs to the wiki:
http://www.ogre3d.org/tikiwiki/Awesomium
(Later the raw information can be polished up.)

Additionally I added a link to this topic to 2 other pages (GUI and HUD)

So it doesn't get lost in the depth of the Ogre forum.
The wiki is a good place to keep such information "findable".
Help to add information to the wiki. Also tiny edits will let it grow ... :idea:
Add your country to your profile ... it's interesting to know from where of the world you are.

User avatar
duststorm
Minaton
Posts: 921
Joined: Sat Jul 31, 2010 6:29 pm
Location: Belgium
x 80
Contact:

Re: Game HUD using HTML

Post by duststorm »

Beauty wrote:The wiki is a good place to keep such information "findable".
I absolutely agree. I add things to it from time to time too, but should do it more often.
Developer @ MakeHuman.org

User avatar
Beauty
OGRE Community Helper
OGRE Community Helper
Posts: 767
Joined: Wed Oct 10, 2007 2:36 pm
Location: Germany
x 39
Contact:

Re: Game HUD using HTML

Post by Beauty »

The best is to do it immediately.
Otherwise it can be forgotten quickly.

If there is not much time or lazyness, the information can just be copy&pasted.
Later it can be beautified by the same or an other person.
Even it's nobody beautifies it, it can be useful to have it in the wiki.
Help to add information to the wiki. Also tiny edits will let it grow ... :idea:
Add your country to your profile ... it's interesting to know from where of the world you are.

Mayko64
Gnoblar
Posts: 5
Joined: Sun Apr 08, 2012 6:26 am

Re: Game HUD using HTML

Post by Mayko64 »

Thanks(: I'll look into LibRocket, as Berkelium has been giving me problems with loading my browser with spam, and won't do a direct render, it uses an internal firefox engine and merges with my current firefox, causing me to remove a lot of AOL Junk toolbars lagging my browser.

LiBRocket seems interesting, and the MIT License is extremely helpful :D Thanks :D

jacmoe wrote:If your goal is to be able to use HTML/CSS, then I wouldn't recommend that you use either of those libs.

Why embed a browser if you don't need it?

I would use LibRocket instead:
http://librocket.com/wiki

User avatar
Beauty
OGRE Community Helper
OGRE Community Helper
Posts: 767
Joined: Wed Oct 10, 2007 2:36 pm
Location: Germany
x 39
Contact:

Re: Game HUD using HTML

Post by Beauty »

Does anybody know if LibRocket is available for .NET and by this perhaps for Mogre?
In the Mogre forum I never read about this, but if there is a chance for usage with Mogre, I would create a forum topic for that.
Help to add information to the wiki. Also tiny edits will let it grow ... :idea:
Add your country to your profile ... it's interesting to know from where of the world you are.

Post Reply