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
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 12-Sep-20

Post by Beauty »

merlinblack wrote:I'm thinking about how to generate gorilla files, etc on Linux.
Maybe you can use the commandline tool by Wine.
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
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 »



Here is it in-game. Works well IMO and quite a nice performance boost over the admittedly poor implementation of using 3d models for each RPM bar (300fps vs 250fps)
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 »

Look at Gorilla go. ;)

I wonder if it would be any faster with a ScreenRenderable?
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 »

It isn't easy for me to use a screen renderable as the dash isn't treated as a separate object in my car loaded. I did try not updating Gorilla at all and I saw maybe 1-2fps change (hard to say it flickers a bit), but it's definitely not a problem.

Thanks for a great little lib, much appreciated! I am still learning and gradually getting to know some of the lower level stuff, libs like Gorilla make the learning curve much less scary and I can look at how the code works and hopefully it will eventually go in by osmosis :D

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 12-Sep-20

Post by betajaen »

Alright. I remember reading something in the Viewport class, that you can turn off auto-updating. Perhaps you could tell the viewport to update only when Gorilla does, that should do less writes to the texture. So you may gain a bit more FPS. ;)
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 »

betajaen wrote:Alright. I remember reading something in the Viewport class, that you can turn off auto-updating. Perhaps you could tell the viewport to update only when Gorilla does, that should do less writes to the texture. So you may gain a bit more FPS. ;)
Already done :)

I only update when the number of lights have changed or the Speed / Gear changes. I mark it as dirty and do a render on the next update
Last edited by AshMcConnell on Tue Sep 14, 2010 3:34 pm, edited 1 time in total.
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 »

Nice. :D
User avatar
toglia
Gnome
Posts: 336
Joined: Sat Dec 08, 2007 4:28 am
Location: Canada
x 7

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

Post by toglia »

I'm about to finish a simple 2d Sprite Editor based on aj's Canvas, maybe I could port it to Gorilla as well. I'm very interested on having independent material shaders per sprite, which I have read its possible now with Gorilla, right?

I was thinking, since aj's Canvas actually packs Textures and Fonts into an Atlas, a simple tool based on this lib could be designed to generate Gorilla definition files and png atlas textures automatically, that would be much nicer for real production pipeline.

Right now I'm pretty busy myself, but I would love to help building this tool, maybe in a few weeks.
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 12-Sep-20

Post by Beauty »

toglia wrote:simple 2d Sprite Editor
Atlas, a simple tool based on this lib
Can you give us links to the applications?

Also it would be nice when you create a wiki page for your sprite editor and add a link to it from the wiki page Digital Content Creation Tools.
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 12-Sep-20

Post by betajaen »

toglia wrote:I'm about to finish a simple 2d Sprite Editor based on aj's Canvas, maybe I could port it to Gorilla as well. I'm very interested on having independent material shaders per sprite, which I have read its possible now with Gorilla, right?

Nope. One material/texture per screen.
togila wrote:I was thinking, since aj's Canvas actually packs Textures and Fonts into an Atlas, a simple tool based on this lib could be designed to generate Gorilla definition files and png atlas textures automatically, that would be much nicer for real production pipeline.
Seems a bit over the top to me. There are hundreds of Font-to-texture programs out there, and as for sprites and a few minutes in Paint.net for the sprites.

As for packing, When developing Gorilla I was going to do this, I can think of at about two algorithms to do this for you. It's just simple box packing.
User avatar
toglia
Gnome
Posts: 336
Joined: Sat Dec 08, 2007 4:28 am
Location: Canada
x 7

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

Post by toglia »

@Beauty
I will do this once its finished and translated. Right now its in spanish.

The Canvas lib I was talking about:
http://princeofcode.com/canvas.php#overview
http://www.ogre3d.org/forums/viewtopic.php?t=41365

Its packs multiple sprites and fonts into a single ogre texture on runtime.

@Betajaen.
Well yeah, maybe its not a big deal. But I find it very important when dealing with non programmers (artists).
User avatar
toglia
Gnome
Posts: 336
Joined: Sat Dec 08, 2007 4:28 am
Location: Canada
x 7

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

Post by toglia »

betajaen wrote: Nope. One material/texture per screen.
Don't know why I assumed... no rotation per sprite either, I guess.
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 »

toglia wrote:
betajaen wrote: Nope. One material/texture per screen.
Don't know why I assumed... no rotation per sprite either, I guess.
Nope, but it's easy to hack in. It's just a few lines of cos and sin.
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 »

Started making a binding to Lua using Luabind. I'm keeping it separate to my other bindings (you want to keep Luabind source units small) so it should be easily incorporated by others. So far so good! :)

The gorrilla_3d.cpp is chock full of useful code isn't it! Not to mention a very cool demo.
"He'd never realized that, deep down inside, what he really wanted to do was make things go splat."
Terry Pratchett, Reaper Man
Image
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 seeing a problem with double deletion in my app. :( I think its layers... If you add

Code: Select all

delete mConsole;
to the App d'tor in the Console example it shows similar behaviour... anyone else? Looks like if you just delete your Silverback instance at the end all is ok, but if you destroy a layer before doing that, it tries to delete it again in the Silverback d'tor and kaboom! bits go flying. :P
"He'd never realized that, deep down inside, what he really wanted to do was make things go splat."
Terry Pratchett, Reaper Man
Image
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 »

Weird. Are you using the latest commit from the Git repository?

There is definite code in Silverback::destroy and the shutdown function in OgreConsoleForGorilla does call it.
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 »

Yeah, I pulled from your repo before I posted to make sure I was up to date.

I think the call:

Code: Select all

mScreen->destroy( mLayer )
does not completely clear things out and you get a problem when the Silverback d'tor runs.

I still looking into it. Just trying to figure out the Layer index business - I think the problem may be in there perhaps.

EDIT:
To recreate, add

Code: Select all

delete mConsole;
to App::~App of the console example, so the OgreConsole d'tor runs. On my machine it seg-faults when deleting rectangles with a null pointer within the Silverback d'tor.

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
0x0805a022 in Gorilla::Layer::destroyAllRectangles (this=0xb66293f8) at Gorilla.cpp:1109
1109       OGRE_DELETE (*it);
(gdb) bt
#0  0x0805a022 in Gorilla::Layer::destroyAllRectangles (this=0xb66293f8) at Gorilla.cpp:1109
#1  0x08059d51 in ~Layer (this=0xb66293f8, __in_chrg=<value optimised out>) at Gorilla.cpp:1074
#2  0x08057914 in ~LayerContainer (this=0xb71e4c78, __in_chrg=<value optimised out>) at Gorilla.cpp:679
#3  0x0805904d in ~Screen (this=0xb71e4c78, __in_chrg=<value optimised out>) at Gorilla.cpp:959
#4  0x080571ce in ~Silverback (this=0xb7ce46e0, __in_chrg=<value optimised out>) at Gorilla.cpp:608
#5  0x0804fc5f in ~App (this=0x8092978, __in_chrg=<value optimised out>) at examples/gorilla_ogreconsole.cpp:90
#6  0x0804ee52 in main () at examples/gorilla_ogreconsole.cpp:289
(gdb) print *it
$1 = (class Gorilla::Rectangle *&) @0x0: <error reading variable>
(gdb) quit
"He'd never realized that, deep down inside, what he really wanted to do was make things go splat."
Terry Pratchett, Reaper Man
Image
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 »

Fixed. :)

Code: Select all

Fixed crash whilst deleting a already deleted Layer in the Silverback destructor.
http://github.com/betajaen/gorilla
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 »

betajaen wrote:Fixed. :)

Code: Select all

Fixed crash whilst deleting a already deleted Layer in the Silverback destructor.
http://github.com/betajaen/gorilla
And fix tested! :D

Thanks Betajaen!

git rebase even went without any dramas - partly as I've learned what not to do.... :P
"He'd never realized that, deep down inside, what he really wanted to do was make things go splat."
Terry Pratchett, Reaper Man
Image
User avatar
vitefalcon
Orc
Posts: 438
Joined: Tue Sep 18, 2007 5:28 pm
Location: Seattle, USA
x 13

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

Post by vitefalcon »

Awesome, awesome utility/addon. Had some trouble to integrate it with 1.6.5 though (like the use of OGRE/Ogre.h instead of Ogre.h, Ogre::vector, Screen class not implementing the renderQueueStarted(...) and an error in the cpp file where you an iterator was being accessed as a nested-typedef in Ogre::VectorIterator). But otherwise, SUPER-EASY overlays :D...

@Betajaen: Dude, out of sheer curiosity, do you ever take a break? :shock:

BTW, I'm attaching the modified code to make it work in 1.6.x (and down, hopefully) for those who're interested, with this post.
Attachments
Gorilla_1.6.X.zip
The implementation of Gorilla that will work on 1.6.x (and hopefully for the versions below it).
(26.59 KiB) Downloaded 140 times
Image
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 16-Sep-20

Post by betajaen »

Nice, I can merge nearly all of your your changes into the Git hub repo if you like.


And, not really no. :D
User avatar
vitefalcon
Orc
Posts: 438
Joined: Tue Sep 18, 2007 5:28 pm
Location: Seattle, USA
x 13

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

Post by vitefalcon »

betajaen wrote:Nice, I can merge nearly all of your your changes into the Git hub repo if you like.
That'd be awesome!
betajaen wrote:And, not really no. :D
LOL! It's your hard work that makes our lives easy :P
Good work with Gorilla :)
Image
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 16-Sep-20

Post by betajaen »

Code: Select all

Made Gorilla compile under Ogre 1.6.5 (vitefalcon)
http://www.ogre3d.org/forums/viewtopic.php?p=404540#p404540
http://github.com/betajaen/gorilla


The only thing I couldn't do is the "#include <OGRE/Ogre.h>" thing for that you need to know the Ogre version, and to get that you need to include Ogre, which you can't do with out knowing the version, which you get by including it. So it's an endless loop. ;)
User avatar
vitefalcon
Orc
Posts: 438
Joined: Tue Sep 18, 2007 5:28 pm
Location: Seattle, USA
x 13

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

Post by vitefalcon »

LOL yea... That's an issue. One way around that would be to have a #define above it to say something like

Code: Select all

#define GORILLA_OGRE_1_7_X 67328    // (1<<16 + 7<<8)
#define GORILLA_OGRE_1_6_X 67072	    // (1<<16 + 6<<8)
// By default it's for 1.7.x change this for your version of OgreSDK
#define GORILLA_OGRE_VERSION GORILLA_OGRE_1_7_X

#if GORILLA_OGRE_VERSION >= GORILLA_OGRE_1_7_X
#	include <OGRE/Ogre.h>
#else
#	include <Ogre.h>
#endif // GORILLA_OGRE_VERSION >= GORILLA_OGRE_1_7_X
Edit: Man... I gotta admit, this is helping me loads as a visual debugging output, like checking out how my interpolation is getting messed up (I draw a graph on the screen for that using Gorilla::LineList).

Edit2: Just noticed... thanks for the credit :)
Image
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 16-Sep-20

Post by merlinblack »

Hi, here's a wee patch to stop Gorilla segfaulting should you give Rectangle::background_image( const String& ) a not existing sprite name. I've made it throw an exception which suits me, with the Luabind binding I've starting making, you may want to do something different.

Upload attachment....The extension is not allowed.... what? why? Sigh. :?

It's a git patch - so should 'git am' right in.
Attachments
patch.zip
Zipped patch file
(989 Bytes) Downloaded 143 times
"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