Skeleton GPU Limitations

Software: Away3D 4.x

Avatar
Choons, Sr. Member
Posted: 21 September 2011 12:10 AM   Total Posts: 281

in SkeletonAnimation.as the function usesCPU() returns whether a skeletal animation is running on GPU or CPU fallback (false for some reason means true, but I won’t go there) based on “too many joints or too many joints per vertex.” Further down it looks like the maximum number of joints per vertex is 4, but the 2nd condition is a little less clear:

numUsedVertexConstants + _skeleton.numJoints * 3 > 128

I know vaguely that this refers to registers on the AGAL/GPU pipeline but would like to know what this means in a practical case. How many joints can we realistically expect to use before CPU fall back happens?

   

Richard Olsson, Administrator
Posted: 21 September 2011 07:55 AM   Total Posts: 1192   [ # 1 ]

It depends on what materials you are using, so I’m afraid there is no easy answer.

Btw, usesCPU should be true if the animation uses CPU. You seem to be implying that there is something wrong with this boolean. Can you elaborate?

   

Avatar
Choons, Sr. Member
Posted: 21 September 2011 08:14 AM   Total Posts: 281   [ # 2 ]

yeah, if you look at the note above get usesCPU() in SkeletonAnimation.as it says “Returns false if it cannot run on GPU.” So I take that to mean false being returned actually means the animation is using the CPU. It would make more sense if the function was called usesGPU() in that case.

   

Richard Olsson, Administrator
Posted: 21 September 2011 08:16 AM   Total Posts: 1192   [ # 3 ]

I see. Sounds like a documentation error. Thank you for explaining.

   

Avatar
Choons, Sr. Member
Posted: 21 September 2011 08:24 AM   Total Posts: 281   [ # 4 ]

can you confirm which one is actually right? It kind of makes a big difference. Is that note correct that the Boolean being false means the vertex transform is being done on the CPU? Or should true indicate CPU as you said?

EDIT - OK I see in getAGALVertexCode where true means CPU so yeah the note appears to be incorrect

   

Richard Olsson, Administrator
Posted: 21 September 2011 08:27 AM   Total Posts: 1192   [ # 5 ]

Yes. usesCPU will return true if the animation uses CPU (and not GPU). Ignore that piece of documentation.

   

Samuel Girardin, Member
Posted: 21 September 2011 08:37 AM   Total Posts: 74   [ # 6 ]

@Choons, thanks to have past time on that, so for the rope it uses GPU(return false).

 

   

Avatar
Choons, Sr. Member
Posted: 21 September 2011 08:53 AM   Total Posts: 281   [ # 7 ]

yeah Samuel and that’s important for me too since I’m doing similar procedural skeleton experiments. The limitation of AGAL to a maximum of about 40 bones before CPU fallback happens has me kind of concerned though. If I understand the issue, looping needs to be implemented by Adobe into AGAL at the shader level to allow for more bones.

You should post a link to your rope demo & character demo in this thread so people know what we are referring to.

   

Samuel Girardin, Member
Posted: 21 September 2011 08:58 AM   Total Posts: 74   [ # 8 ]

rope demo with GPU animation :

http://www.visualiser.fr/fp11/Rope.html

Samuel

   

Richard Olsson, Administrator
Posted: 21 September 2011 09:13 AM   Total Posts: 1192   [ # 9 ]

Don’t worry too much about GPU animation. You can get very far with animation on the CPU. Please do not overestimate the benefit of GPU animation.

   

Alex Bogartz, Sr. Member
Posted: 21 December 2011 09:49 PM   Total Posts: 216   [ # 10 ]

Was there ever resolution on this problem?  I’m trying to create a large number of cloned characters, but as above, it always uses CPU.  If I have more than 10 or so, the animation starts to slow, and if I ramp up to 100 clones, it slows to a crawl.

Any help would be greatly appreciated!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X