Adding vertices to a mesh that has skeletal animation

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Post Reply
michlbeck
Gnoblar
Posts: 5
Joined: Thu Aug 29, 2013 7:25 pm

Adding vertices to a mesh that has skeletal animation

Post by michlbeck » Mon Sep 02, 2013 1:56 pm

Hi all,

I'm trying to programmatically add vertices to a skeletal animated mesh. Here's my original question in the Help forum, I guess it was too advanced for there: http://www.ogre3d.org/forums/viewtopic.php?f=2&t=78809 . I've now looked further through the code and debugged using a debug build of the Ogre lib and it looks like I can't actually do what I need to do with Ogre, at least with version 1.8.1.

Essentially, I need the Entity's mSkelAnimVertexData to be rebuild after I add the vertices to the Mesh's sharedVertexData. However, the only lines of code I could find that could re-initialise the mSkelAnimVertexData with a different size were in Entity::prepareTempBlendBuffers(), which is protected and only called by Entity::_initialize().

It seems the best thing for me to do would be to subclass Entity so that I can expose the prepareTempBlendBuffers() as a public method, and then call it after modifying the Mesh's sharedVertexData so it can grow to the appropriate size. Is my thinking here correct?
0 x

User avatar
Lee04
Minaton
Posts: 944
Joined: Mon Jul 05, 2004 4:06 pm
Location: Sweden

Re: Adding vertices to a mesh that has skeletal animation

Post by Lee04 » Fri Sep 06, 2013 12:53 pm

This is something I wouldn't do programmatically.

I would leave this to the artist.

I would use Ogre so you could group imported vertices and scale groups of vertices.

These groups you can change scale for zero 0 would be not visible at all 1 fully visible large. And if you want a half size 0.5

The artist would group an group of vertices and mark them as a group, possibly store scale group id in the W component of the UVW component of each vertice. Or something like that.

So you load the 3d file read in objects, go through all w's to figure out all the groups the artist made.
And then have a vertice shader that takes the w component and scales. You just set the shader constans reigster to the scale you want for each group.

Max number of scale groups would be the number of shader constants your shader model supports.

Or you can use a texture where you write the scale values to a pixel in the texture and then you hand the shader the texture that reads the scale values.
This allows you a lot of groups.
0 x
Ph.D. student in game development

User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
Contact:

Re: Adding vertices to a mesh that has skeletal animation

Post by Klaim » Fri Sep 06, 2013 1:24 pm

Lee04 wrote:This is something I wouldn't do programmatically.

I would leave this to the artist.
What about creative coding and procedurally generated content?
The problem with this mindset is that it don't fit the current artistic world which strives for interactive visual creation which is hard to make smooth if you have to rebuild the whole bloody mesh each time a modification is done.
0 x

michlbeck
Gnoblar
Posts: 5
Joined: Thu Aug 29, 2013 7:25 pm

Re: Adding vertices to a mesh that has skeletal animation

Post by michlbeck » Sat Sep 14, 2013 9:33 am

Thasnk @Klaim, yes that is the point -- what I'm trying to do here is too complex to be done just by the artists -- think something like the Spore creature engine.

When I did what I suggested above it worked but it crashed as soon as the model came on screen, elsewhere in Ogre. I've given up on this aspect for now, but either doing what i suggested corrupts Ogre's inner state somewhere else, or (more likely) there is a bug in the way i'm adding the vertices that is destroying other data.

I'll post back here if I ever get what I want to work.
0 x

Post Reply