Jump to content
  • entries
    943
  • comments
    5,899
  • views
    924,450

Hello, Crawler


Josh

3,575 views

 Share

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

 Share

10 Comments


Recommended Comments

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

Link to comment

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
Link to comment

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
Link to comment

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

Link to comment

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.

Link to comment

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

Link to comment

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.

Link to comment

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
Link to comment
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...