Ogre interface framework

Development directions, tasks, and features being actively implemented or pursued by the development team.
Post Reply
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Ogre interface framework

Post by klauss »

Ok... after a lot of struggle, and being unable to fix my OS, yesterday I decided I'll reinstall from scratch (the OS).
That meant a big delay with Ogre, so I'm uploading one of my backups up for revision.

There's a few items that I have in my working copy that are not in the uploads:
  • Proper project inside VS workspace - instead of Ogre's sample workspace
  • Loads a .system file, instead of manually spawning stuff
  • Started to use the UserInterface framework - if you look at what I'm uploading, the framework is being barely used
  • Working (almost) template instancing plugin - modellers will love this.
As soon as I reinstall my OS, I'll replace the files linked by the newer ones. I still have them... no reason to panic. It's only the OS the one that got screwed up, not the entire computer.

Also... if I have the time (uploads take unholily long), I'll update both a vegastrike and privateer dataset, as well as binaries, for those that want to test it in their machines but don't have a way to build it. I have them all on backup, so it's only a matter of uploading it.

Also... since I didn't migrate to Cg yet (some fragment shaders have to be done using assembler because Cg doesn't support ps1.4 - which I'm requiring), and I didn't give that such a high priority (rather, I wanted to complete the framework), it's Windows-only. (Unless you get HLSL working on Linux... which I doubt :p - or, most likely, unless you want to translate it to GLSL and have an arbfp1-capable card, it's not hard at all, very few changes needed).

Well... not really. It works in Linux (OpenGL), but has fixed-pipeline code.

The mining base looks like crap in OpenGL because of a bug in DevIL - the one translating DDS files for OpenGL (they're fixing it for Dagon - the newest version).

Well... feel free to comment.
Bugs, I'm not that interested in. There are lots of them, probably. Mostly comments on the design. Bugs will be removed slowly as I get my hands on Dagon (I already did... in my RIP compy, just didn't have time to play with it before the holocaust).

Find everything here

PS: You'll need an Ogre SDK to build it. My recommendation is to go grab 1.0.6 and its dependencies from www.ogre3d.org
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
hellcatv
Developer
Developer
Posts: 3980
Joined: Fri Jan 03, 2003 4:53 am
Location: Stanford, CA
Contact:

Post by hellcatv »

awesome Klauss! :-) I'll check it out

hopefully you can require ps2.0 soon enough!
Vega Strike Lead Developer
http://vegastrike.sourceforge.net/
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

I don't want to... it works decently enough with ps1.4... it's just a matter of rewriting it in assembler (BTW, RenderMonkey has an HLSL->assembler compiler, so it's not THAT hard). The ugly part is duplicating everything in Ogre because, you know, assembler doesn't work on all cards on OpenGL (only ATI), so you need both GLSL and ps1.4 - annoying, but not hard. I even have a 1.1 version I put together in 15 minutes... it's a very basic shader, there's no need to require ps2 for it.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
jackS
Minister of Information
Minister of Information
Posts: 1895
Joined: Fri Jan 31, 2003 9:40 pm
Location: The land of tenure (and diaper changes)

Post by jackS »

klauss wrote:I don't want to... it works decently enough with ps1.4... it's just a matter of rewriting it in assembler (BTW, RenderMonkey has an HLSL->assembler compiler, so it's not THAT hard). The ugly part is duplicating everything in Ogre because, you know, assembler doesn't work on all cards on OpenGL (only ATI), so you need both GLSL and ps1.4 - annoying, but not hard. I even have a 1.1 version I put together in 15 minutes... it's a very basic shader, there's no need to require ps2 for it.
I think it might be worth noting that, at anything resembling historical rates of progress for this project, ps2.0 is going to increasingly become old, and <2.0 ancient as the VS releases come out - the question therefore is not will we require ps2.0, but when, as there will clearly come a time where doing so in no meaningful way restricts the audience capable of playing it.

Given what you've written about the reasonably low cost of writing new shaders, it may be the case that the redundancy of having to write shaders for multiple ps versions may not be a particularly high overhead cost to keeping compatibility up as long as is feasible - but requirements will assuredly wander upwards.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

Yeah... we can require ps2 generally speaking. It's in this particular case that I think it's not necessary.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
rewpparo
Hunter
Hunter
Posts: 83
Joined: Sat Jun 11, 2005 8:11 pm
Location: Rouen, france

Post by rewpparo »

Why not use fallbach techniques so that you don't require anything ? Yeah it will not be as pretty, but it will still run on older cards (mine only supports 1.1:p)
There are 10 types of people in this forum
Those who understand binary... and those who don't
hellcatv
Developer
Developer
Posts: 3980
Joined: Fri Jan 03, 2003 4:53 am
Location: Stanford, CA
Contact:

Post by hellcatv »

I'm thinking the fallback shader will be incredibly simple... and do nothing more than teh current engine if that
Vega Strike Lead Developer
http://vegastrike.sourceforge.net/
f1gm3nt3d
Trader
Trader
Posts: 30
Joined: Mon May 31, 2004 8:01 pm
Contact:

Post by f1gm3nt3d »

klauss wrote:I don't want...you know, assembler doesn't work on all cards on OpenGL (only ATI), so you need both GLSL and ps1.4 - annoying, but not hard. I even have a 1.1 version I put together in 15 minutes...
That's not entirely true. Within the shader naming conventions anything like psx.x or vsx.x are DirectX format shaders, not openGL shaders. AFAIK 1.4 shaders have been supported since the 5XXX series by nVidia. Have you considered using OpenGl Shader Designer? The interface is somewhat similair to RenderMonkey and it's freeware, though windows only(well that's not entirely true but you have to take a seminar for the linux version)
hellcatv wrote:I'm thinking the fallback shader will be incredibly simple... and do nothing more than teh current engine if that
Yea, doing fallback shaders shouldn't be a problem at all really. Ogre's material system is really nice.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

f1gm3nt3d wrote:
klauss wrote:I don't want...you know, assembler doesn't work on all cards on OpenGL (only ATI), so you need both GLSL and ps1.4 - annoying, but not hard. I even have a 1.1 version I put together in 15 minutes...
That's not entirely true. Within the shader naming conventions anything like psx.x or vsx.x are DirectX format shaders, not openGL shaders. AFAIK 1.4 shaders have been supported since the 5XXX series by nVidia. Have you considered using OpenGl Shader Designer? The interface is somewhat similair to RenderMonkey and it's freeware, though windows only(well that's not entirely true but you have to take a seminar for the linux version)
Interesting (the OGL designer). However, what I was saying is that 1.4 is not supported by nVidia+Ogre (I think nVidia had some extension to support it, but Ogre does not have support for it that I know of). And, in any case, it was a different syntax to that of DirectX's ps1.4, so even if it was possible, it would need rewriting the shader in this other syntax. But, for ATI, since the syntaxes are so similar, Ogre has a cross-compiler (a translator) that can take ps1.4 source and use it even in OpenGL, through aan extension known as ATIFS (ATI fragment shader). nVidia has something along the NVFS line, which is not the same, and Ogre does not seem to support cross-compiling for those. So... 1.4 is not entirely portable, but does work in quite a broad range of hardware and software (all ATI cards run on both OpenGL and DX, nVidia only on DX). I'm more than happy to use <1.4 fallbacks for nVidia hardware on OpenGL - that can be solved later if people really want it fixed, which I don't think will happen since many, many people have ps2.0/arbfp1 capable cards.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
f1gm3nt3d
Trader
Trader
Posts: 30
Joined: Mon May 31, 2004 8:01 pm
Contact:

Post by f1gm3nt3d »

klauss wrote: Ogre has a cross-compiler (a translator) that can take ps1.4 source and use it even in OpenGL, through aan extension known as ATIFS (ATI fragment shader). nVidia has something along the NVFS line, which is not the same, and Ogre does not seem to support cross-compiling for those. So... 1.4 is not entirely portable, but does work in quite a broad range of hardware and software (all ATI cards run on both OpenGL and DX, nVidia only on DX). I'm more than happy to use <1.4 fallbacks for nVidia hardware on OpenGL - that can be solved later if people really want it fixed, which I don't think will happen since many, many people have ps2.0/arbfp1 capable cards.


I concede the point, I really wasn't trying to nitpick, and I can understand that there actually is a need to do this for comptability sake since the ATI 8500-9200 crads have no support for arb shaders. However ps2.0 is still a directX only shader and not OpenGL compatable(not a problem for me but for people with linux it is) and some things aren't doable in arbfp1 without having to have a few seperate shaders and running them in multiple passes do to the instruction limits involved with the shader format at any rate you may find this helpful: Babel Shader it'll convert between HLSL, PS2.0 and ARB shaders plus a few other things.

Edit:
On second thought is there any reason not to use cg? Looking at section 3.1.4 in the Ogre Manual under the high level language section it says the if you use cg you can stay API independent and specify the shader formats to compile down to via "profiles" from cg. IMHO this seems like a better course rather then writing 3 different versions of a shader. Then you can just have that and a fixed-function fallback in the materials. Also it performs it's own fallback shader-wise (i.e. if you define ps2.0 ps1.4 arbfp1 and you're card supports 2.0 it'll do that, if it's one of the radeons that does 1.4 in GL it'll do that otherwise it'll do arb shaders and failing that you have a another material for fixed function only.). Shoot me if this has been discussed.[/quote]
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

f1gm3nt3d wrote:On second thought is there any reason not to use cg?
Yes, and no.
No, Cg will be used (if there's no problem I didn't see with using it - like licensing issues).
But yes, there's a slight problem in this particular case with Cg: Available Cg profiles:
&#56256;&#56457; DirectX Vertex Shader 2.x Profiles (vs_2_0, vs_2_x)
&#56256;&#56457; DirectX Pixel Shader 2.x Profiles (ps_2_0, ps_2_x)
&#56256;&#56457; OpenGL ARB Vertex Program Profile (arbvp1)
&#56256;&#56457; OpenGL ARB Fragment Program Profile (arbfp1)
&#56256;&#56457; OpenGL NV_vertex_program 2.0 Profile (vp30)
&#56256;&#56457; OpenGL NV_fragment_program Profile (fp30)
&#56256;&#56457; DirectX Vertex Shader 1.1 Profile (vs_1_1)
&#56256;&#56457; DirectX Pixel Shader 1.x Profiles (ps_1_1, ps_1_2, ps_1_3)
&#56256;&#56457; OpenGL NV_vertex_program 1.0 Profile (vp20)
&#56256;&#56457; OpenGL NV_texture_shader and NV_register_combiners Profile (fp20)
(directly from Cg specs)

See any ps_1_4?
Some shaders need 1.4's capability to arbitrarily sample a texture (dependant sampling), and to sample it multiple times. Besides the increased instruction limit, of course.

So, in order to support it in Cg you need fp20, arbfp1 or ps_2_0.
But the same shader written in HLSL can run in ps1.4, so one would think that by writing both Cg and HLSL (or GLSL and HLSL), you'd be fine. But you can do better... you can use Cg + ASM (Cg for advanced hardware, ASM for limited hardware with no more than ps1.4). It turns out that ASM is more portable than GLSL+HLSL, since Ogre can cross-compile ps1.4 ASM into OpenGL.
Last edited by klauss on Mon Dec 26, 2005 2:18 pm, edited 1 time in total.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
Halleck
Elite
Elite
Posts: 1832
Joined: Sat Jan 15, 2005 10:21 pm
Location: State of Denial
Contact:

Post by Halleck »

Heh. Nice find f1gm3nt3d, but hellcatv wrote babel shader. :wink:
f1gm3nt3d
Trader
Trader
Posts: 30
Joined: Mon May 31, 2004 8:01 pm
Contact:

Post by f1gm3nt3d »

Halleck wrote:Heh. Nice find f1gm3nt3d, but hellcatv wrote babel shader. :wink:
yea... :oops: I realized that after I looked around the site more.
klauss wrote:So, in order tu support it in Cg you need fp20, arbfp1 or ps_2_0.
But the same shader written in HLSL can run in ps1.4, so one would think that by writing both Cg and HLSL (or GLSL and HLSL), you'd be fine. But you can do better... you can use Cg + ASM (Cg for advanced hardware, ASM for limited hardware with no more than ps1.4). It turns out that ASM is more portable than GLSL+HLSL, since Ogre can cross-compile ps1.4 ASM into OpenGL.
No, I agree that ASM is more portable that wasn't my issue, I mean HLSL is DX only. You said though that the ps1.4 when cross compiled is incompatabile to GeForce because it uses the proprietery ATI instructions. But if you're doing CG and 1.4 then yea, I see the point. I wa sjust trying to find a catch all solution which apparently isn't there. :oops: Sorry for wasting your time, heh, but thanks for explaining it better.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

f1gm3nt3d wrote:But if you're doing CG and 1.4 then yea, I see the point. I wa sjust trying to find a catch all solution which apparently isn't there. :oops: Sorry for wasting your time, heh, but thanks for explaining it better.
No worries, no time wasted if I got my point across... ;)
Who knows... perhaps you had a solution (I'd be delighted to be proven wrong about there not being an catch-all solution).
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

First of all, @f1gm3nt3d, I edited my previous post... a nasty typo...

Now, to the post:
Forget about the posted files, it's now on CVS:

cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/vegastrike co -r ogre_branch data5.x vegastrike vega-proj

Even with a binary :D (for that, just check out data5.x) - it's the SystemExplorer.
Enjoy.

I must warn... data5.x is like a 140MB download... and will keep growing. Very incomplete stuff yet, but now that I'm back in business, it will (slowly, still) evolve into something useful - and eventually into VegaStrike itself.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
www2
Venturer
Venturer
Posts: 537
Joined: Sat May 14, 2005 10:51 am
Location: milkyway->the sol system->earth->Europe->The Nederland->Soud Holland->Leiden
Contact:

Post by www2 »

@klauss
Thx i download now and test soon...


Edit furst problem i font :
The SystemExplorer.exe cant not find dis file: stlport_646.dll
Last edited by www2 on Tue Dec 27, 2005 10:17 pm, edited 1 time in total.
All Your Base Are Belong To Us
hurleybird
Elite
Elite
Posts: 1671
Joined: Fri Jan 03, 2003 12:46 am
Location: Earth, Sol system.
Contact:

Post by hurleybird »

Awesome klauss!
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

www2 wrote:@klauss
Thx i download now and test soon...


Edit furst problem i font :
The SystemExplorer.exe cant not find dis file: stlport_646.dll
Ah... I forgot that one... I'll commit that one tomorrow.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
www2
Venturer
Venturer
Posts: 537
Joined: Sat May 14, 2005 10:51 am
Location: milkyway->the sol system->earth->Europe->The Nederland->Soud Holland->Leiden
Contact:

Post by www2 »

sory i hef say previous post wrong it is stlport_vc646.dll and not stlport_646.dll
All Your Base Are Belong To Us
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

Yes, I know. I've already commited those files.

Just a disclaimer: the binary has one of the models hardcoded (I'm going to make it possible to select one from units.csv so that it can finally act as model previewer ;) ), and it so happens that it's not one of the most eye-catching models. If you want to try different models, try hacking units_vega.csv (replacing the Mesh entry in the refinery by whatever you want)
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
etheral walker
Elite
Elite
Posts: 1516
Joined: Sat May 10, 2003 5:26 pm
Location: into the depths

Post by etheral walker »

do you have some screens before I grab it with my 56k modem?
I see dead polygons....
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

Ugh... 56k. I wouldn't recommend it. Mostly now that it isn't using the full capabilities of the framework (not that much eye candy yet).

Let me post some screens instead... and if you really really want to see for yourself, well, I won't stop you. But don't download the entire CVS... mostly the debug binaries. You would have to download data5.x/core, data5.x/bin, and data5.x/mods/vegastrike (not all the models, if you can pick the ones you want). The good news is that data5.x/bin is highly compressible, so set your CVS compression setting to the max.

I'll edit-in the screens in a sec. (Dammit - I forgot I deleted them yesterday... well, I'll bring some tomorrow).
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
hurleybird
Elite
Elite
Posts: 1671
Joined: Fri Jan 03, 2003 12:46 am
Location: Earth, Sol system.
Contact:

Post by hurleybird »

klauss wrote: I'll edit-in the screens in a sec. (Dammit - I forgot I deleted them yesterday... well, I'll bring some tomorrow).
Still waiting eagerly :)
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

Oops.
Sorry... work and holidays made me forget.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
hellcatv
Developer
Developer
Posts: 3980
Joined: Fri Jan 03, 2003 4:53 am
Location: Stanford, CA
Contact:

Post by hellcatv »

BTW I got it working in linux :-) so far so good--waiting for those nice Cg shaders klauss has promised :-D
Vega Strike Lead Developer
http://vegastrike.sourceforge.net/
Post Reply