Gorilla - minimal hud and overlay replacement for OGRE

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
Post Reply
User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 605
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 16
Contact:

Re: gorilla - hud/overlay replacement - Updated on 08-Sep-20

Post by AshMcConnell »

That's it working perfectly. Thanks for your help, hope my nagging has improved Gorilla for everyone a little :)
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Re: gorilla - hud/overlay replacement - Updated on 08-Sep-20

Post by betajaen »

Oh you can blame Microsoft for this, who's definition of a pixel is wonky.
User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 605
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 16
Contact:

Re: gorilla - hud/overlay replacement - Updated on 08-Sep-20

Post by AshMcConnell »

betajaen wrote:Oh you can blame Microsoft for this, who's definition of a pixel is wonky.
Oh I do, don't worry :)
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: gorilla - hud/overlay replacement - Updated on 08-Sep-20

Post by Beauty »

betajaen wrote:BetaGUI 4

This is a very sloppy, quickly written and very buggy version of BetaGUI which I rewrote from scratch in two days. It uses a whole manner of Gorilla stuff, and does buttons, textboxes, progress bars, menus, choices and labels. Did I say it's buggy? That's okay -- Gorilla's eat bugs. But 5000 FPS for a GUI like that? Not bad.
I didn't understand what you mean exactly.

BetaGUI 4 is a rewrite of an older BetaGUI version?
Or do you mean BetaGUI is buggy at all?
(I remember problems for BetaGUI ~2 years ago - and debugging was difficult because of cryptic variable/method names)

What means Gorilla's eat bugs? It has many bugs or it hasn't many bugs?

Do you mean 5000 fps for the Gorilla GUI or the BetaGUI?
Or related to both? (which seems to be on the screenshots)


Nice would be when somebody create a wiki page 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.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Re: gorilla - hud/overlay replacement - Updated on 08-Sep-20

Post by betajaen »

It's a sloppy rewrite/example code of showing a really quick GUI made in Gorilla. It wasn't made to be taken seriously, it doesn't even work anymore, since the API has changed.

Gorilla doesn't need a Wiki page. I have a website that I'm working on for Gorilla already. A link to this thread in the "Assembling a Toolkit" section would be nice though.
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: gorilla - hud/overlay replacement - Updated on 08-Sep-20

Post by Beauty »

The title contains HUD replacement.
So I suppose I can attach text or pictures to a SceneNode. Is that right?
If so:
* Does it always point to the camera (like Billboards) or is the orientations independent of the camera view?
* Can you show a code snippet, please?
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
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Re: gorilla - hud/overlay replacement - Updated on 08-Sep-20

Post by betajaen »

It's directly splat on your screen, anything drawn will be behind it. Just like with Overlays.

There are two full examples showing it off that comes with the download.
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: gorilla - hud/overlay replacement - Updated on 08-Sep-20

Post by Beauty »

betajaen wrote:Gorilla doesn't need a Wiki page. I have a website that I'm working on for Gorilla already. A link to this thread in the "Assembling a Toolkit" section would be nice though.
And an entry on GUI these related wiki pages:
http://www.ogre3d.org/tikiwiki/-GUI
http://www.ogre3d.org/tikiwiki/Comparison+of+GUIs
betajaen wrote:It's directly splat on your screen, anything drawn will be behind it. Just like with Overlays.
So I suppose it's possible to "clamp" such overlays to a SceneNode and it will be resized related to the SceneNode distance. Right?
I will look to the samples, too. :wink:
Also I made advertisement in the Mogre forum section. Maybe somebody write a wrapper for it or port it to C#. :mrgreen:
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
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Re: gorilla - hud/overlay replacement - Updated on 08-Sep-20

Post by betajaen »

Beauty wrote:
betajaen wrote:Gorilla doesn't need a Wiki page. I have a website that I'm working on for Gorilla already. A link to this thread in the "Assembling a Toolkit" section would be nice though.
And an entry on GUI these related wiki pages:
http://www.ogre3d.org/tikiwiki/-GUI
http://www.ogre3d.org/tikiwiki/Comparison+of+GUIs
Gorilla isn't a GUI though. It provides an interface to become a GUI, but it's just as much as a GUI, as it's an piece of text on a screen or a full blown HUD. It can become those things, but doesn't mean it is one.
Beauty wrote:
betajaen wrote:It's directly splat on your screen, anything drawn will be behind it. Just like with Overlays.
So I suppose it's possible to "clamp" such overlays to a SceneNode and it will be resized related to the SceneNode distance. Right?
I will look to the samples, too. :wink:
Gorilla doesn't use anything to do with SceneManagers, it by passes that entirely and "hooks" into the RenderSystem. So when a frame is being drawn, it draws it's own triangles last.
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: gorilla - hud/overlay replacement - Updated on 08-Sep-20

Post by Beauty »

Ok, then I misunderstood the aim of your project.
(Maybe because you used the word HUD in the topic and the comparism to BetaGUI. For HUDs I think about head up display which shows information clamped to an object, e.g. over a displayed mesh)

But it's still intestesting and has a nice view. :D
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
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Re: gorilla - hud/overlay replacement - Updated on 08-Sep-20

Post by betajaen »

Beauty wrote:Ok, then I misunderstood the aim of your project.
I refer to HUDs as Head up displays in jet fighters, and games where you have the lifebar in the corner of the screen.
Beauty wrote:(Maybe because you used the word HUD in the topic and the comparism to BetaGUI. For HUDs I think about head up display which shows information clamped to an object, e.g. over a displayed mesh)
You can do that too, everything would be the same size though, because it has no depth.
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10
Contact:

Re: gorilla - hud/overlay replacement - Updated on 08-Sep-20

Post by DanielSefton »

betajaen wrote:
Beauty wrote:(Maybe because you used the word HUD in the topic and the comparism to BetaGUI. For HUDs I think about head up display which shows information clamped to an object, e.g. over a displayed mesh)
You can do that too, everything would be the same size though, because it has no depth.
The TitleCanvas class in ajs' player demo is a good example of how to do that, with pseudo depth.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Re: gorilla - hud/overlay replacement - Updated on 08-Sep-20

Post by betajaen »

Some progress:
coco3d.png

Code: Select all

Gorilla::ScreenRenderable* screen = mSilverback->createScreenRenderable(Ogre::Vector2(0.01,0.01), "dejavu");
m3DLayer = screen->createLayer(0);
m3DLayer->createMarkupText(24, 0, 0, "This is some text on a quad in the 3D world. Wooooo!");
Gorilla::Rectangle* rect = m3DLayer->createRectangle(10, 10, 100, 100);
rect->background_image("coco");

mNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(Ogre::Vector3(0,1.5,0));
mNode->attachObject(screen);
I've decided not to use RTTs for projecting Gorilla into the 3D world. Due to the need for extra cameras, viewports and other overhead. Even if I came up with a system of sharing a camera and viewport between them it would be tricky to make sure certain ones aren't visible when some needs to be rendered.

Instead, I just decided to use a SimpleRenderable instead and just render it directly into 3D space. My first draft was a bit of a kludge, so I went back and completely rewrote the Screen system, with the added bonus now that there is no limit for the number of order of layers.

I need to do a lot of testing, and things before I release the code to the public, but it's looking good.
User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 605
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 16
Contact:

Re: gorilla - hud/overlay replacement - Updated on 08-Sep-20

Post by AshMcConnell »

What would be involved in rendering a screen object to texture (if I was to attempt it myself).

Set up a scene with a camera / viewport and render the screen object fullscreen? Or is there a more direct way of creating a texture directly from the rectangle data?

Thanks for the help!
All the best,
Ash
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Re: gorilla - hud/overlay replacement - Updated on 08-Sep-20

Post by betajaen »

Pretty much yes. But this 3D way could be much faster and efficient than using an RTT, it isn't also bound by any image size either.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Re: gorilla - hud/overlay replacement - Updated on 08-Sep-20

Post by betajaen »

Gorilla in 3D


Code: Select all

- Removed limitation of 16 possible orders for layers
- Added LayerContainer class which Layers use as a parent
- Rewrote Screen to be part of LayerContainer
- Added ScreenRenderable class, for Screens to be attached to SceneNodes
- Added Support for Gorilla materials to be pre-defined before hand, for shader or special effects.
- Added ScreenRenderable demo (gorilla_3D)
http://github.com/betajaen/gorilla
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10
Contact:

Re: gorilla - hud/overlay replacement - Updated on 12-Sep-20

Post by DanielSefton »

I checked my fridge, but you weren't there. What gives?

Oh and your work is full of pure win, that is all.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Re: gorilla - hud/overlay replacement - Updated on 12-Sep-20

Post by betajaen »

DanielSefton wrote:I checked my fridge, but you weren't there. What gives?
I ate your food and left.
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 99
Contact:

Re: gorilla - hud/overlay replacement - Updated on 12-Sep-20

Post by Wolfmanfx »

Looks great :!:

One question regarding gorilla files how do you create them? Have a command line tool for it?
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Re: gorilla - hud/overlay replacement - Updated on 12-Sep-20

Post by betajaen »

Wolfmanfx wrote:Looks great :!:

One question regarding gorilla files how do you create them? Have a command line tool for it?
I use a really good tool by Microsoft called BMFontGen for the actual font data, which creates a PNG and a XML file from it. Then I edit the XML file into a Gorilla file. It doesn't take long if you have a text editor that supports regex.

The Gorilla Schema is here:

http://github.com/betajaen/gorilla/blob ... _SCHEMA.md

It is a bit out of date, since I added support for multiple fonts. But the dejava.gorilla file, is a good example to work from.
User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 605
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 16
Contact:

Re: gorilla - hud/overlay replacement - Updated on 12-Sep-20

Post by AshMcConnell »

Hi Folks,

I have managed to bend the mighty Gorilla to my will (to render to a texture) by using a second scene manager: -

Code: Select all

rttSceneMgr = mRoot->createSceneManager(Ogre::ST_GENERIC);
_rttCamera = _rttSceneMgr->createCamera("RttCamera");

Ogre::TexturePtr texture = Ogre::TextureManager::getSingleton().createManual( "DashTex", 
   Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, 
   512, 512, 0, Ogre::PF_R8G8B8, Ogre::TU_RENDERTARGET );
_renderTarget = texture->getBuffer()->getRenderTarget();
_renderTarget->setAutoUpdated(false);

_rttViewPort = _renderTarget->addViewport( _rttCamera );
_rttScreen = mSilverback->createScreen( _rttViewPort, "dejavu" );
Is there much overhead when using a second scene manager? Would I be better hiding everything in the scene instead?

Thanks!
Ash
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Re: gorilla - hud/overlay replacement - Updated on 12-Sep-20

Post by betajaen »

Try them both and see what happens. I'd imagine using one though could be slightly faster, as long as you get the rttCamera/rttViewport to ignore the rest of the scene.
User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 605
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 16
Contact:

Re: gorilla - hud/overlay replacement - Updated on 12-Sep-20

Post by AshMcConnell »

I tried creating 2 screens, one to render on screen and one for RTT, it works if I have 2 scene managers (they operate independently).

If I have a single scene manager, 2 cameras and 2 screens, they don't work independently. The second Gorilla::Screen that is defined becomes the source of content for both screens. I'm not sure how Gorilla hooks up to the render queue, it may be something to do with that?
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Re: gorilla - hud/overlay replacement - Updated on 12-Sep-20

Post by betajaen »

It renders when the overlays are being rendered, both will be separate batches, but I wouldn't know how to wipe the previous batch, or if you could it would affect the rest of the Scene.

I'd use two scene managers then, or ScreenRenderables.
User avatar
merlinblack
Goblin
Posts: 223
Joined: Thu Mar 15, 2007 10:05 am
Location: Sydney, Australia
x 7
Contact:

Re: gorilla - hud/overlay replacement - Updated on 12-Sep-20

Post by merlinblack »

I'm really impressed how easy this is to use. I got my Lua Console converted in no time! :D I think I might hold off making a binding with Luabind, for now, until the API has stabilised more. :P But this looks perfect for doing Doom3 style in-game GUIs!

I'm thinking about how to generate gorilla files, etc on Linux. There must be something close, or even that can do it. Perhaps some GIMP Script Fu. :)
"He'd never realized that, deep down inside, what he really wanted to do was make things go splat."
Terry Pratchett, Reaper Man
Image
Post Reply