[2.1] GUI solution for Ogre 2.1 discussion

Design / architecture / roadmap discussions related to future of Ogre3D (version 2.0 and above)
123iamking
Gremlin
Posts: 152
Joined: Sat Aug 12, 2017 4:16 pm
x 3

[2.1] GUI solution for Ogre 2.1 discussion

Post by 123iamking » Mon Nov 06, 2017 4:47 am

Hi everyone,

Currently, I see some GUI solutions for Ogre 2.1 including but limited to the following:
CEGUI - Port successfully for GL3+ at this time.
MyGUI - The topic about port MyGUI.
Ogre's billboard - reuse Ogre v1 at this time
ImGUI - Here is it repo, I'll take a look at it soon. Here is an interesting article.

See also from the wiki: CEGUI and Ogre tutorial, Comparison of GUIs

At the time this post is written:
CEGUI: doesn't work with Ogre's DirectX11 render when choose Ogre as render.
MyGUI: I don't know about you guys, but... it doesn't run successfully for me,
Ogre's billboard: I'm learning how to use this. but I really worry about performance because my game may use a lot of billboards.

So let's discuss which GUI solution you are choosing.

Thanks.
1 x

farrer
Halfling
Posts: 63
Joined: Mon Sep 12, 2011 7:35 pm
x 7

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by farrer » Mon Nov 06, 2017 11:20 am

I'm using my own library: https://github.com/farrer/farso

(not official released yet... and maybe it's too much tied to my own needs).

For 2.1 it implements a Movable/Renderable for widget renderers (note that the only widgets that have a renderer are those without parents: the children use the same renderer as the parent), but some optimizations should be implemented (the main one: keep the widget textures with constant-size between them for allowing Ogre to batch them together) and some things are - and probably will - be missing (the library did not have layout managers for example).

For 1.10 its renderer is built on top of - argh - Overlays.
2 x

mrmclovin
Goblin
Posts: 283
Joined: Sun May 11, 2008 9:27 pm
x 7

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by mrmclovin » Sun Nov 12, 2017 1:52 am

I'm also looking into different solutions to GUI to integrate in Ogre.

I have worked a lot as a front-end developer so I'm used to using CSS3's FlexBox standard to easily layout elements in a highly flexible way.

Facebook is behind an open source C library called Yoga with an API built on the FlexBox standard. So if one is famililar with FlexBox principles, Yoga's API makes a lot of sense. Using Yoga for layout, Cairo graphics for 2D drawing and SDL as window manager I did implement a light-weight GUI for my 2D game in a few days of work.

Since I recently went from 2D to Ogre, the thought of implementing a Ogre-Cairo back-end for drawing has been very tempting but I'm not familiar with either Ogre's new internals as well as Cairo's and so I'm not sure if it's worth to starting on something like that time-wise... and I'm not sure if it's even a good idea technically either..

I may be biased but I really think CSS and its "Box model" is great for GUI's and I would love to see a GUI library for Ogre based on that standard. At the moment my GUI solution exists only in my head - but if I get time, I'd like to explore implementing a GUI using:
  • Facebook's Yoga for layout
  • Cairo graphics and its companion Pango for the drawing API (will handle shapes, colorization and text rendering
  • Implement a backend for Cairo to draw to Ogre
  • Basic implementation of GUI events like clicks, double clicks, hovering etc. etc
0 x

User avatar
Mako_energy
Greenskin
Posts: 125
Joined: Mon Feb 22, 2010 7:48 pm
x 4

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by Mako_energy » Sun Nov 12, 2017 5:21 am

I ended up rolling my own solution that was originally a port of Gorilla, but has since evolved into an unrecognizable beast with considerably more features. It wasn't written to be standalone, so it's really only useful to me atm...something I may go back and change in the future.

Lately though I've been wondering about putting in a new UI system that would allow a web front end dev to make UIs in my engine. It's appealing to me since the skills are common and it would allow the same person to work on games, tools, and a website. However I'm not sure about some of the complications in integrating such a thing. I briefly considered Electron, but it's fairly bloat when I just want a UI. I've heard mixed things about Awesomium, but their main site seems to be down and alluding to a release in the future so I can't look at it directly. Librocket is the only other thing I've heard of for this but I haven't gotten around to looking at it yet.
0 x

User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 605
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 3
Contact:

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by AshMcConnell » Mon May 28, 2018 12:37 pm

@Mako I'm looking for the same thing (web front end for the UI). A new version of Awesomium was created recently, but unfortunately it doesn't have a "GPU Driver" for it yet. I don't think I have the necessary skills for such a thing, but Adam (the author) said he'd make a driver with some help. Would that be something you could help with?

Thanks!
Ash
0 x

User avatar
TheGameMaker
Kobold
Posts: 26
Joined: Fri Jun 18, 2010 4:19 pm

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by TheGameMaker » Mon May 28, 2018 3:34 pm

Last time I looked at Awesomium it was pretty much just a Chromium wrapper. I implemented CEF myself once and it takes a bit to learn but not that bad once you know. But it does look like Awesomium may be doing something to make it more light weight according to their homepage. Hopefully that is the case. Too many programs these days with embedded browsers :|

I created an application with Sciter but that's more for desktop apps and probably wouldn't integrate well with a game. But it's worth noting that it is about a 400KB library compared to these CEF/Awesomium/Electron >80MB applications.

What looked like a good solution was LibRocket. The idea anyway. It seems to be dead now :(
0 x

User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 605
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 3
Contact:

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by AshMcConnell » Mon May 28, 2018 3:46 pm

Ultralight (the new version of Awesomium) seems to be a lot, well, lighter :). It uses webkit and is around 8 meg compressed. It would do me nicely for ORC as I've had quite a bit of exposure to web front ends over the past few years :)
0 x

User avatar
TaaTT4
OGRE Contributor
OGRE Contributor
Posts: 142
Joined: Wed Apr 23, 2014 3:49 pm
x 4

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by TaaTT4 » Mon May 28, 2018 8:47 pm

We use Coherent GT but it's not free. It follows the same design philosophy of Awesiomum (S.T.T.L.) since it let you code the UI using HTML+CSS+JS. The library support both DirectX and OpenGL and, in my opinion, it's superior of Awesomium by far (in terms of simplicity and especially performances).
The basic integration between Coherent GT and OGRE is pretty straightforward and should require, to a skilled programmer, about a week.
1 x
Senior game programmer at Vae Victis
Working on Racecraft

crancran
Greenskin
Posts: 131
Joined: Wed May 05, 2010 3:36 pm
x 2

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by crancran » Tue May 29, 2018 4:37 pm

123iamking wrote:
Mon Nov 06, 2017 4:47 am
CEGUI: doesn't work with Ogre's DirectX11 render when choose Ogre as render.
I believe I have already fixed this on the default branch of CEGUI over a month ago.
0 x

User avatar
Mako_energy
Greenskin
Posts: 125
Joined: Mon Feb 22, 2010 7:48 pm
x 4

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by Mako_energy » Wed May 30, 2018 12:33 am

@AshMcConnell
I'm afraid I'm a near perpetual state of work overload, so I really can't put too much effort into another project. Even if I had the time, I have near future plans to upgrade from Ogre 1.10 to Ogre 2.2. Ideally this driver should be written for Ogre 2.2 and I have yet to touch it, so I lack the background information. I am, however, thrilled to see some progress being made here. I am somewhat concerned about the licensing that will be chosen as that could kill the prospect of my using it rather quickly.

@TaaTT4
Coherent GT looks like it's solid feature-wise. However as I hinted above, my project is pretty demanding when it comes to licenses. Anything more strict than LGPLv2 is a non-starter.
1 x

Lax
Gnome
Posts: 322
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 7

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by Lax » Wed May 30, 2018 10:32 am

MyGUI: I don't know about you guys, but... it doesn't run successfully for me,
MyGUI works perfectly with Ogre2.1 I have heavily integrated in my application.

If you need assistance, I could help you.

Regards
Lax
0 x

Jay721
Halfling
Posts: 54
Joined: Mon Jan 29, 2018 8:19 am

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by Jay721 » Thu Jul 26, 2018 5:12 pm

Lax wrote:
Wed May 30, 2018 10:32 am
MyGUI: I don't know about you guys, but... it doesn't run successfully for me,
MyGUI works perfectly with Ogre2.1 I have heavily integrated in my application.

If you need assistance, I could help you.

Regards
Lax
I can't get it to find FreeType on Windows :/
0 x

Lax
Gnome
Posts: 322
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 7

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by Lax » Thu Jul 26, 2018 8:11 pm

I compiled MyGUI without using free type, so I'm using just one font, that is delivered with MyGUI.
The define flag is: MYGUI_USE_FREETYPE
0 x

rujialiu
Gremlin
Posts: 174
Joined: Mon May 09, 2016 8:21 am
x 11

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by rujialiu » Fri Jul 27, 2018 3:49 pm

Jay721 wrote:
Thu Jul 26, 2018 5:12 pm
Lax wrote:
Wed May 30, 2018 10:32 am
MyGUI: I don't know about you guys, but... it doesn't run successfully for me,
MyGUI works perfectly with Ogre2.1 I have heavily integrated in my application.

If you need assistance, I could help you.

Regards
Lax
I can't get it to find FreeType on Windows :/
At first we ran into the same problem (CMake cannot find FreeType). Later we found that the prebuilt Ogre Dependency package we downloaded has a wrong FreeType directory structure so CMake cannot find ft2build.h. We inspected CMake script, reorganized the include directory (moving some files to some directory etc) and finally FreeType is found.

However, later we also tried to build Ogre Dependencies from source: https://bitbucket.org/cabalistic/ogredeps/
After the build to successful, just build "INSTALL" target and the directory structure is already correct, no need to reorganize.

So:
1. If you're familiar with CMake or you would like to hack a bit, the quickest way is to find out(or guess) the correct directory structure and reorganize
2. If you don't mind rebuilding the Ogre Dependencies from source, there should be no problem.
0 x

Jay721
Halfling
Posts: 54
Joined: Mon Jan 29, 2018 8:19 am

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by Jay721 » Tue Sep 04, 2018 5:28 pm

Alright, after you build MyGui what's the proper way to implement it into 2.1?
0 x

Jay721
Halfling
Posts: 54
Joined: Mon Jan 29, 2018 8:19 am

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by Jay721 » Fri Sep 07, 2018 4:04 pm

So I've got MyGui ready to put into Ogre...

Code: Select all

		mPlatform = new MyGUI::Ogre2Platform();
		mPlatform->initialise( renderWindow, smgr );

		mGUI = new MyGUI::Gui();
		mGUI->initialise();

		MyGUI::ButtonPtr button = mGUI->createWidget<MyGUI::Button>("Button", 10, 10, 300, 26, MyGUI::Align::Default, "Wallpaper");
		button->setCaption("exit");
The program works, there's just no GUI. What am I missing out?
0 x

Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 536
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 11

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by Slicky » Fri Sep 07, 2018 4:37 pm

I am also playing with the demos for MyGui but they don't render anything. I am part way through manually applying a patch that al2950 made. Hopefully we can get something working.
0 x

Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 536
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 11

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by Slicky » Fri Sep 07, 2018 6:43 pm

OK I got the demos rendering. I cannot take credit because I spent hours reading posts and trying to work out what was going on. I can't claim I even understand all the code. I will, however, create a separate thread with my notes once I check that I can get it working in a simple app.
0 x

Jay721
Halfling
Posts: 54
Joined: Mon Jan 29, 2018 8:19 am

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by Jay721 » Fri Sep 07, 2018 7:37 pm

The actual demos that ship with MyGUI were working for me
0 x

Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 536
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 11

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by Slicky » Fri Sep 07, 2018 7:40 pm

Ok - you're ahead of me :D

I'm trying to plug it into my test app to see if it works. In theory it should - everything is being built against the same libraries.
0 x

Jay721
Halfling
Posts: 54
Joined: Mon Jan 29, 2018 8:19 am

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by Jay721 » Fri Sep 07, 2018 8:16 pm

I'm trying to figure out how to plug it in,

Code: Select all

mGUI = new MyGUI::Gui();
is giving me an access violation since i added this to the compositor

Code: Select all

	pass custom MYGUI
        {
        
        }
  
0 x

Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 536
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 11

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by Slicky » Fri Sep 07, 2018 8:20 pm

In the version I am using I believe the pass custom MYGUI is done in code and not a script. That is what I see.
0 x

Jay721
Halfling
Posts: 54
Joined: Mon Jan 29, 2018 8:19 am

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by Jay721 » Fri Sep 07, 2018 9:38 pm

I'm clueless, no gui was showing at all without adding the pass to compositor. Adding it to the compositor script just made it crash...

I'm using https://github.com/MyGUI/mygui/tree/ogre2.1
0 x

Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 536
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 11

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by Slicky » Fri Sep 07, 2018 9:46 pm

Yep I cloned that too. Unfortunately some GUI don't work with the latest Ogre and need updating. From that clone I applied manual patches. I'll be happy to share mine after I get it working in a test app.

The summary from my experience is that the latest clone from that repository does not work with the latest Ogre 2.1.
0 x

Jay721
Halfling
Posts: 54
Joined: Mon Jan 29, 2018 8:19 am

Re: [2.1] GUI solution for Ogre 2.1 discussion

Post by Jay721 » Fri Sep 07, 2018 9:59 pm

I think I'm just being stupid and it's possibly just skins causing nothing to show up on my screen because the demos are working fine. :?
0 x

Post Reply