The OgreOde Thread

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Locked
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

Crappy code notwithstanding, here's the new "chain" test. In this version (as opposed to the ODE version) you can throw the chain around manually and freeze it in mid-air in a Matrix bullet-time stylee;
Image
User avatar
houssem_bdioui
Kobold
Posts: 31
Joined: Tue May 11, 2004 8:09 am
Location: Tunisia

Post by houssem_bdioui »

Great monster :

Would be nice if you succeed to use real chain links, as in the Novodex
demos : http://www.novodex.com/demos.html
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

Well, the mesh that each "link" in the chain uses can be anything you want. I just used spheres 'cos that's what the ODE demo that I'm re-implementing uses.
User avatar
houssem_bdioui
Kobold
Posts: 31
Joined: Tue May 11, 2004 8:09 am
Location: Tunisia

Post by houssem_bdioui »

monster wrote:Well, the mesh that each "link" in the chain uses can be anything you want. I just used spheres 'cos that's what the ODE demo that I'm re-implementing uses.
Don't think it's the same since you are using some joints to link your spheres while using "links" only envolves contact joints : so it's more natural let's say.
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Post by tuan kuranes »

Impressive Work ! Bravo !

Once finished, Ode people will have to drop their "drawlib" thing ! ;) [edited]

As we're on Ode things, here's an two interesting snippets of code with binary win demos at http://www.geocities.com/stuart_gooding/ :

- GLodemanager : sort of odecppp + refapp (collision, friction, behaviours)
- SMCEditor : impressive editor taking animated body and set updating geoms around each bone during animation. (could be use with ODE or verlet phys.)

(beware delphi inside... but not so far from cpp code readings.)
Last edited by tuan kuranes on Fri Jun 04, 2004 1:10 pm, edited 1 time in total.
User avatar
psyclonist
OGRE Expert User
OGRE Expert User
Posts: 286
Joined: Fri Nov 01, 2002 3:54 pm
Location: Berlin & Nuremberg, Germany
x 1
Contact:

Post by psyclonist »

Good work! Quite a few people will find this very useful!
tuan kuranes wrote:Once finished, Ode people will have to drop their "drawlib" thing !
I don't think this would be a good thing ;) (not to speak of the previous attempts to replace or enhance drawlib...)

Anyway, drawlib exists only for the samples that ship with ODE. It's not intended to be used in any other applications. It'd be crazy to replace it and introduce another dependency. (ODE doesn't need eye candy ;) )

-psy
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

Don't think it's the same since you are using some joints to link your spheres while using "links" only envolves contact joints : so it's more natural let's say.
Ah, fair enough. I haven't looked at the Novodex samples much. However, as I've said before these tests are really just re-implementations of the ODE tests to make sure my framework isn't doing anything stupid and to try to get it tuned to work with real-world values.

Plus, in any reasonably complex game situation I would argue that there's absolutely no way you'd want to model chains in Novodex's "real world" way since that would be far, far too computationally expensive.
I don't think this [dropping drawstuff] would be a good thing
I totally agree with psy on that one, but I'm sure you were just being ironic anyway.

The drawstuff library is just a teeny tiny graphical framework for visually testing ODE. There's no way you'd use it in a production application, just like you wouldn't use Ogre's ExampleApplication or ExampleFrameListener, and people who are just after a physics engine wouldn't want several megs worth of graphics library!

Ogre is completely separate from ODE, as it should be, and OgreOde is (spookily enough) positioned to be the glue between the two. Just like Ogre, OgreTok, and Tokamak in fact! But then I'm sure you already knew that!
;)
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Would you be interested in putting this in ogreaddons so it can jostle boistrously with OgreTok ? ;)
tintin

Post by tintin »

I'm interested in the lighting in that scene.

You seem to have a perfect light "cone" with speculat light on the right side. What are your light values, and how is that floor surface made up.

When I have one ground mesh and one point light, I can only get the whole mesh to either be fully lit or not lit at all, with no specualr, no matter what settings i use
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

@ sinbad
For sure, but it'll probably be a while before it's ready. I'm always up for a bit of boistrous jostling.
:?
(where's your other hand? between two pillows. those aren't pillows! etc...)

@ tintin
It's just a spotlight. The ground mesh is just a bunch of simple flat meshes, each one 20x20 units (in my case 20x20 meters) and 5x5 quads (i.e. 50 tris). The more polys you have the better the edge of the spot lit area is, so really I should have high-poly version in the middle and lower LODs further out where it's dark and no-one ever goes! But it is just a demo to test my wrapper.

To get specular lighting I just set a specular component on my light and in my material. That works even if my mesh is 1000x1000 and 2 tris. It doesn't work in OpenGL though, only DirectX.
User avatar
ggambett
Kobold
Posts: 32
Joined: Tue May 25, 2004 3:03 pm
Location: Montevideo, Uruguay

Post by ggambett »

monster wrote:To get specular lighting I just set a specular component on my light and in my material. That works even if my mesh is 1000x1000 and 2 tris. It doesn't work in OpenGL though, only DirectX.
Why? To get specular highlights in huge triangles you need some kind of per pixel lighting, which OpenGL supports - maybe it's a problem with your drivers?
Gabriel Gambetta
Mystery Studio - Home of Betty's Beer Bar and Wild West Wendy
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

Why? To get specular highlights in huge triangles you need some kind of per pixel lighting, which OpenGL supports - maybe it's a problem with your drivers?
Dunno. I've just never got specular lighting (with the fixed function pipline) under OpenGL (with Ogre). Makes no difference whether it's huge triangles or small ones. Here's two shots takes from exactly (give or take a few pixels) the same position in my OgreOde test app, with exactly the same code. One under OpenGL, one under DX9, the only difference is what I chose in the Ogre config dialog. That's on a GeForce FX5600 with the 56.72 drivers.
Top one's DX9, bottom one's OpenGL;
Image
Image
And, while we're on the subject of OpenGL being bonkers. Modulative texture shadows. Crayzzeee!
Image
In case you're wondering, the shadows seem to be OK on the mesh that's under the spotlight casting them, but they're repeated across every mesh in the scene. And when the casting object(s) moves off that mesh then the shadows don't get cast any more. They fade out in the very very far distance, rather than in accordance with the spotlight settings. That's using the Octree scene manager. Works fine under DX9.
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

Oh, and just so DirectX doesn't feel left out; texture shadows sometimes cause horrible stuttering under DirectX in Release mode. If I turn off shadows (I can flip them on and off dynamically in my test app) then the stuttering goes away, or if I switch to OpenGL (although I do get the bonkers effect from above), or if I run under DirectX in debug mode (and that's not the debug version of DirectX, just of Ogre and my app), I don't get the stuttering. Or even sometimes I don't even get it under DirectX!

Hang on, all of this graphical cobblers has nothing to do with physics! I've hijacked my own thread here.
D'oh!
User avatar
KeaponLaffin
Kobold
Posts: 28
Joined: Sat Jan 17, 2004 7:45 pm

Post by KeaponLaffin »

monster wrote:Hang on, all of this graphical cobblers has nothing to do with physics! I've hijacked my own thread here.
D'oh!
LOL! :lol:

This is looking great, I can't wait to see it in the add-ons. (applauds like a maniac)
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

Test trimesh, seems to have some problems colliding capsules.
Could be something to do with small triangles, or high gravity.
Or something.
Image
User avatar
Noiprox
Halfling
Posts: 64
Joined: Mon Apr 05, 2004 6:25 am
Location: North Vancouver, Canada

Post by Noiprox »

:shock: :mrgreen: :shock:

Nice. Keep up the good work!
Dieter Buys
Image
"Death, be not proud, though some have called thee mighty and dreadful, for thou art not so." - John Donne
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

As for the GL texture shadows, there's a GL transform state bug (I really don't like GL's stateful transform pipeline - too open to bugs like this..) hidden somewhere in there which I managed to create once, but never managed to create again - it just went away (always concerning). Obviously it's still there - when your code is ready for ogreaddoning I'll see if I can recreate it with that.

I've no idea what the stuttering is about, never seen it!

And I'm amazed that DX gives you a per-pixel specular effect when you use large tris. It shouldn't, in truth, since specular terms are only supposed to be calculated at vertices. :?
User avatar
bad_camel
Halfling
Posts: 74
Joined: Tue Dec 17, 2002 11:57 am
Location: Somerset, England
Contact:

Post by bad_camel »

Sheesh, so all this time it was a bug. I really thought I was being a tit, so I didn't bother asking...was gonna leave it till the "make it look pretty stage". Good to know :)
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

It just does something like this;

Code: Select all

// Use a load of meshes to represent the floor
int i = 0;
for(Real z = -80.0;z <= 80.0;z += 20.0)
{
    for(Real x = -80.0;x <= 80.0;x += 20.0)
    {
        Entity* mPlane = mSceneMgr->createEntity(String("Plane_") + StringConverter::toString(i++), "Plane.mesh");
        mPlane->setCastShadows(false);
			
        SceneNode* mPlaneNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
        mPlaneNode->attachObject(mPlane);
        mPlaneNode->setPosition(x,0,z);
    }
}
Where "plane.mesh" is a 20x20 unit grid of 50 triangles (i.e. 25 quads, 4x4 units, 5 on a side, if you see what I mean).

[edit]...same sort of thing happens on the Trimesh demo (last picture posted) under OpenGL; the shadows are cast on the "terrain" mesh as if it hasn't been transformed. It's just moved by (0,3,0) and it's the only entity in the scene using that mesh.[/edit]
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

Test Crash, now with added Helicopters;
Image
(click for the less atmospheric version)
User avatar
houssem_bdioui
Kobold
Posts: 31
Joined: Tue May 11, 2004 8:09 am
Location: Tunisia

Post by houssem_bdioui »

Really good work monster.

And what is the mission of this helicopter ? :)

Is the helicopter's body a trimesh or just a box?
User avatar
SpannerMan
Gold Sponsor
Gold Sponsor
Posts: 446
Joined: Fri May 02, 2003 10:05 am
Location: UK
Contact:

Post by SpannerMan »

Wow! I cant wait to check this out in action. What sort of framerates are you getting, especially for that particular shot...thats alot of fallin boxes.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

/me jumps up and down a lot

Looking sweet! :)
supersuper
Greenskin
Posts: 114
Joined: Wed Feb 11, 2004 5:41 pm
Location: England!

Post by supersuper »

Beautiful (the helicopter one). :P
User avatar
3rd eye brainworm
Gnoblar
Posts: 3
Joined: Mon Jan 05, 2004 1:16 am
Location: WA, USA

Post by 3rd eye brainworm »

how is ode working with your buggy,

i hate it and im writing my own physics code,

but i didnt realy try ode

and i dont want to
hackers are the unforgiving scum of the earth
if i was to be a hacker, id forgive the world
die scum
feel the pain in my heart muscle
feel it
Locked