Page 6 of 21

Re: Making better use of Ogre's capbilities?

Posted: 11 May 2012, 02:26
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)

Re: Making better use of Ogre's capbilities?

Posted: 11 May 2012, 04:44
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.

Re: Making better use of Ogre's capbilities?

Posted: 11 May 2012, 11:22
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.

Re: Making better use of Ogre's capbilities?

Posted: 12 May 2012, 04:32
by jhooks1
Seem to be having some problems with ancestor ghosts not animating correctly, not sure what is going wrong yet.

Re: Making better use of Ogre's capbilities?

Posted: 12 May 2012, 23:46
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.

Re: Making better use of Ogre's capbilities?

Posted: 14 May 2012, 22:50
by jhooks1
At this point I am stumped. Ancestor ghosts look wrong in certain places. Skirts and robes also look wrong

Re: Making better use of Ogre's capbilities?

Posted: 14 May 2012, 23:21
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.

Re: Making better use of Ogre's capbilities?

Posted: 15 May 2012, 00:12
by jhooks1
Ajira does work properly, but most of the other npcs with robes do not look right.

Re: Making better use of Ogre's capbilities?

Posted: 15 May 2012, 04:56
by Chris
Maybe something to do with the non-beast skeleton/animation? Do other Khajiit and Argonians animate correctly in robes?

Re: Making better use of Ogre's capbilities?

Posted: 15 May 2012, 05:19
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)