Making better use of Ogre's capbilities?

Everything about development and the OpenMW source code.
Post Reply
User avatar
Greendogo
Posts: 1467
Joined: 26 Aug 2011, 02:04

Re: Making better use of Ogre's capbilities?

Post by Greendogo »

Will there be a good way to test for performance improvement with your animation improvements? For example, will FPS noticeably differ with several animating NPCs on screen at once? (like in the exotic dancing tavern in Suran)
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: Making better use of Ogre's capbilities?

Post by jhooks1 »

Yes, as soon as I get NPCs working in this new implementation we can test the difference between this and .14. Having a lighting problem (was in the current master) as I mentioned in a thread in support, so right now the npc's and creatures are all black. Would like to see this fixed, I have no idea what is going wrong though, problem existed in master before I modified anything.
Chris
Posts: 1626
Joined: 04 Sep 2011, 08:33

Re: Making better use of Ogre's capbilities?

Post by Chris »

jhooks1 wrote:Good news guys, I got unskinned shapes working within creatures without using attachObjectToBone or modifying buffers.
I'd think attachObjectToBone would actually be a good thing to use where possible, as that will only give one transformation for the whole trishape that can be supplied through the world-model matrix, without going through the whole skinning process for each vertex in the trishape. In at least in some cases, the unskinned portion will have other transformations applied, e.g. heads having vertex animations for lip and eye movement while staying connected to the neck which tracks the player.

The only way to do that, though, is to create separate meshes/entities for each trishape. NPCs need to do this already anyway, it seems, since different body parts can come from separate nifs, but it could probably be more robust from what the current code looks like.

What I imagine is this: an NPC would contain data for each equipable slot, which includes the item attached to the slot (which itself would specify the appropriate .nif file somewhere). The NPC would have a root Ogre::Entity* that contains a base skeleton and an invisible (collision?) mesh.

There'd also be a vector of extra Ogre::Entity*'s, filled with all the trishapes in all the different .nifs from the items attached to the various slots. Skinned meshes would share the skeleton instance with the root Ogre::Entity*, and unskinned ones would be attached to the appropriate bone. Whenever the items in the equipment slots change, then all the extra (non-root) entities are thrown out and recreated according to what's equipped.

Creatures would behave similarly, except they only have one .nif and no equipment slots. It would have a root Ogre::Entity* (the first skinned trishape/mesh), and any extra would be stored in an entity vector and shared/attached as appropriate.

In both cases, for NPCs and creatures, all you'd need to do is animate the root entity's skeleton, and everything should Just Work from there.
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: Making better use of Ogre's capbilities?

Post by jhooks1 »

Seem to be having some problems with ancestor ghosts not animating correctly, not sure what is going wrong yet.
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: Making better use of Ogre's capbilities?

Post by jhooks1 »

With my latest commit I am getting 65fps animating all npcs in Desele's House of Earthly Delights. There are some graphical glitches though. We still are not doing hardware skinning, so it may be possible to get even better performance.
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: Making better use of Ogre's capbilities?

Post by jhooks1 »

At this point I am stumped. Ancestor ghosts look wrong in certain places. Skirts and robes also look wrong
Chris
Posts: 1626
Joined: 04 Sep 2011, 08:33

Re: Making better use of Ogre's capbilities?

Post by Chris »

jhooks1 wrote:At this point I am stumped. Ancestor ghosts look wrong in certain places. Skirts and robes also look wrong
I tried your animexperimental2 branch the other day, and it looked to me like Ajira animated correctly in her robes.
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: Making better use of Ogre's capbilities?

Post by jhooks1 »

Ajira does work properly, but most of the other npcs with robes do not look right.
Chris
Posts: 1626
Joined: 04 Sep 2011, 08:33

Re: Making better use of Ogre's capbilities?

Post by Chris »

Maybe something to do with the non-beast skeleton/animation? Do other Khajiit and Argonians animate correctly in robes?
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: Making better use of Ogre's capbilities?

Post by jhooks1 »

At this point I am thinking the robe/skirt problem may be from sharing skeletons. I may try to apply base_anim and base_animkna animation directly to the robe body parts (separate skeleton for each free part)
Post Reply