Jump to content
  • entries
    948
  • comments
    5,905
  • views
    945,324

Hello, Crawler


blog-0629196001343869597.jpgThis year, Halloween makes an early arrival. Either that, or Josh is working on animation!

 

Obviously this is wrong, but it's only a few lines of code away from being right, and I'll figure it out.

 

Skinning in the new game engine is done on the CPU. You don't have to assign a special shader to make an animated model appear, but it is slower than GPU skinning. I can distribute the load across CPU cores, but no matter what we're not going to have free skinning like we do with Leadwerks Engine 2. Unfortunately, there is no cross-platform technique to get the bone matrices to the GPU in OpenGL2/OpenGLES2. Heck, I could barely get it working on NVidia and ATI cards on Windows.

 

OpenGL 3+ provides a technique for handling this that is built into the specification. The vertex skinning routines are being designed for GPU skinning, so that it will be easy to adapt to OpenGL 3-4 in the future.

 

Ha, this one's even better:

blogentry-1-0-75224100-1343871504_thumb.jpg

10 Comments


Recommended Comments

Road Kill Kenny

Posted

So if the skinning is done in the CPU... Will a raycast be able to hit the mesh in its animated location/orientation? Rather than just hitting the original non skinned mesh like it currently does in LE2

Josh

Posted

So if the skinning is done in the CPU... Will a raycast be able to hit the mesh in its animated location/orientation? Rather than just hitting the original non skinned mesh like it currently does in LE2

Raycasts are performed on a BSP structure that is generated from a triangle mesh, to make them fast. Dynamically recreating the BSP structure would make performance very slow. I could step through testing triangles one at a time, which would be faster but still slow, but I anticipate using GPU skinning in the high-end renderer, so I think that would be a bad idea.

 

However, you can attach hit boxes in the editor pretty easily in the editor, save the model as a prefab, and then reuse it.

  • Upvote 1
macklebee

Posted

at least in LE3 it sounds like the characters wont have this annoying phy body of the character following it around since we will now have control over when/if the phy body gets created...

  • Upvote 2
Road Kill Kenny

Posted

I see that makes sense.

 

My problem currently is that I have an automatic door/gate class and my gates are actually animated instead of hard coded moving of sliding doors. I did this so that I could have multiple different types of doors/gates running off.the same class without harcoding each type of door. However, because the BSP structure doesn't update with animation my camera object avoidance always screws up when I go through a gate. Maybe if I just change the entity type of.the gate when it is opened so the camera raycasts aren't affected by it... Sounds like a good possibility

Road Kill Kenny

Posted

at least in LE3 it sounds like the characters wont have this annoying phy body of the character following it around since we will now have control over when/if the phy body gets created...

 

Yes this is good. I hate how I have a character controller with a mesh parented to it and then another physics box parented to that when you use LoadModel.

Josh

Posted

Animation and skinning don't have to go together. You should only use skinning for organic shapes that need it.

Josh

Posted

I got animation working and now I am optimizing. The weighting uses a single mat4 * vec3 operation. I'm optimizing now, and I've got an 8400 poly mesh weighting 10 times in 9 milliseconds, which is faster than I expected.

Josh

Posted

Lol, I got it down to 4-5 msecs. C++ is fun to optimize.

Josh

Posted

Okay, so with 8400 polys and four bones per vertex, the crawler model skins in 0-1 milliseconds. That's plenty fast. :D

  • Upvote 4
Josh

Posted

1000 FPS now in my test. :o

  • Upvote 3
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...