Gorilla - minimal hud and overlay replacement for OGRE
- AshMcConnell
- 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
That's it working perfectly. Thanks for your help, hope my nagging has improved Gorilla for everyone a little
- betajaen
- 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
Oh you can blame Microsoft for this, who's definition of a pixel is wonky.
- AshMcConnell
- 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
Oh I do, don't worrybetajaen wrote:Oh you can blame Microsoft for this, who's definition of a pixel is wonky.
- Beauty
- 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
I didn't understand what you mean exactly.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.
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 ...
Add your country to your profile ... it's interesting to know from where of the world you are.
Add your country to your profile ... it's interesting to know from where of the world you are.
- betajaen
- 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
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.
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.
- Beauty
- 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
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?
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 ...
Add your country to your profile ... it's interesting to know from where of the world you are.
Add your country to your profile ... it's interesting to know from where of the world you are.
- betajaen
- 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
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.
There are two full examples showing it off that comes with the download.
- Beauty
- 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
And an entry on GUI these related wiki pages: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.
http://www.ogre3d.org/tikiwiki/-GUI
http://www.ogre3d.org/tikiwiki/Comparison+of+GUIs
So I suppose it's possible to "clamp" such overlays to a SceneNode and it will be resized related to the SceneNode distance. Right?betajaen wrote:It's directly splat on your screen, anything drawn will be behind it. Just like with Overlays.
I will look to the samples, too.
Also I made advertisement in the Mogre forum section. Maybe somebody write a wrapper for it or port it to C#.
Help to add information to the wiki. Also tiny edits will let it grow ...
Add your country to your profile ... it's interesting to know from where of the world you are.
Add your country to your profile ... it's interesting to know from where of the world you are.
- betajaen
- 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
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:And an entry on GUI these related wiki pages: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.
http://www.ogre3d.org/tikiwiki/-GUI
http://www.ogre3d.org/tikiwiki/Comparison+of+GUIs
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.Beauty wrote:So I suppose it's possible to "clamp" such overlays to a SceneNode and it will be resized related to the SceneNode distance. Right?betajaen wrote:It's directly splat on your screen, anything drawn will be behind it. Just like with Overlays.
I will look to the samples, too.
- Beauty
- 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
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.
(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.
Help to add information to the wiki. Also tiny edits will let it grow ...
Add your country to your profile ... it's interesting to know from where of the world you are.
Add your country to your profile ... it's interesting to know from where of the world you are.
- betajaen
- 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
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:Ok, then I misunderstood the aim of your project.
You can do that too, everything would be the same size though, because it has no depth.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)
- 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
The TitleCanvas class in ajs' player demo is a good example of how to do that, with pseudo depth.betajaen wrote:You can do that too, everything would be the same size though, because it has no depth.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)
- betajaen
- 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
Some progress:
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.
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);
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.
- AshMcConnell
- 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
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
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
- betajaen
- 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
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.
- betajaen
- 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
Gorilla in 3D
http://github.com/betajaen/gorilla
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)
- 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
I checked my fridge, but you weren't there. What gives?
Oh and your work is full of pure win, that is all.
Oh and your work is full of pure win, that is all.
- betajaen
- 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
I ate your food and left.DanielSefton wrote:I checked my fridge, but you weren't there. What gives?
- Wolfmanfx
- 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
Looks great
One question regarding gorilla files how do you create them? Have a command line tool for it?
One question regarding gorilla files how do you create them? Have a command line tool for it?
- betajaen
- 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
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.Wolfmanfx wrote:Looks great
One question regarding gorilla files how do you create them? Have a command line tool for it?
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.
- AshMcConnell
- 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
Hi Folks,
I have managed to bend the mighty Gorilla to my will (to render to a texture) by using a second scene manager: -
Is there much overhead when using a second scene manager? Would I be better hiding everything in the scene instead?
Thanks!
Ash
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" );
Thanks!
Ash
- betajaen
- 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
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.
- AshMcConnell
- 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
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?
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?
- betajaen
- 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
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.
I'd use two scene managers then, or ScreenRenderables.
- 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
I'm really impressed how easy this is to use. I got my Lua Console converted in no time! I think I might hold off making a binding with Luabind, for now, until the API has stabilised more. 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.
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
Terry Pratchett, Reaper Man