So, I've been testing UPBGE for a while now and ran into an issue when using a model + armature + animation combo from Adobe's Mixamo service.
The armature I am using has 65 bones, and the animations update each bone's every keyframe, ie. the animations seem to be pre-baked.
The problem I am having is that looping any animation on the armature eats up about 22% of frame time per armature in the scene, regardless of whether the armature is within camera view frustrum or not. And this is with my Intel i5 processor clocked at ~3 Ghz.
This is very bad performance, because I cannot have more than 5 instances of this animated object in the scene before the game starts lagging on just about any PC. And I am trying to target my projects on mid-tier hardware, which is even crappier than mine, so ...
1) If 22% overhead with my CPU is not to be expected, then this is probably an issue with the realtime armature transformation code and should be fixed, right?
2) If the overhead is a wontfix, then I'd appreciate a few pointers on how I could fix the problem myself. I guess reducing the number of bones would help, but what else can be done? Should I reduce the number of keyframes or what?
The scene with the model + armature + animations is here, you can play around with it and see if it causes high animation overhead on your rig.
The version of UPBGE I am using is 0.1.6
DISCLAIMER: I am very sorry to ask this here. If UPBGE had official forums I would have started there but since there's no such thing this issue tracker was the first thing I was able to find.
Ive made a test:
Upbge 0.1.8 + latest commits(vs2015). - pic: http://pasteall.org/pic/index.php?id=116138
Upbge 0.1.7 - pic: http://pasteall.org/pic/index.php?id=116139
So it should be fixed in 018. Use vsync off too.
Okay, interesting. I shall try rebuilding 0.1.8 with Visual Studio and see how much that helps.
Maybe you could also try to merge the model into one and even lower the polys too.
They produce a ridiculous amount of keyframes / bones with those riggs,
You may want to just use your own IK rig, and bind empty to the old rig, so
the new rig can be used to bake IK over,
Try and use waaaaay less keyframes, and interpolation.
On Jun 6, 2017 9:49 AM, "Akira1San" notifications@github.com wrote:
Maybe you could also try to merge the model into one and even lower the
polys too.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/UPBGE/blender/issues/503#issuecomment-306547908, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AG25WRe6UAlY-vc1OGE9_ivQtou16VgXks5sBYMlgaJpZM4NxWR3
.
Hmm, I can't seem to get UPBGE to build. CMake fails with error on configure:
32 bit compiler detected.
Visual Studio 2017 detected.
CMake Error at build_files/cmake/platform/platform_win32_msvc.cmake:152 (message):
Windows requires pre-compiled libs at: 'C:/UPBGE.git/../lib/windows_vc14'
Call Stack (most recent call first):
build_files/cmake/platform/platform_win32.cmake:29 (include)
CMakeLists.txt:872 (include)
Also why does CMake attempt to use a 32-bit compiler, since my system is 64-bit?
Should I have installed Visual Studio 2015 instead of 2017?
Also, as expected, the Mixamo stuff is not optimized. But then again, it is autogenerated so cannot expect much from it. However, currently this is the only thing I can use because I cannot do 3D modeling and I have no friends who would do it for me, or enough money to pay people to do it in my behalf. Thus I beg and take whatever biped models I can get for free. And Mixamo is great in that they have an inspiring library of animations to go with the rigs.
For the time being, what I know how to do is reduce the number of bones. That is simple, it is automated by Mixamo, generator has parameter for number of bones. Probably by reducing number of bones I can auto-produce a rig with animations that I can test in my low-spec hardware. Also will try reducing keyframes by hand. The IK animation stuff is way over my head right now, but I will keep that in mind.
Project priority at this moment is learning essential programming techniques for game development thru experimentation. Maybe later have time to learn 3D modelling stuff.
I use Visual Studio 2015. Or maybe you selected the wrong compiler in the cmake.
Ive compiled the latest master, link: https://drive.google.com/open?id=0B6yNvVGWiWysRnVSdTdqalZSczQ
image: http://pasteall.org/pic/show.php?id=116146
result, more fps :D
@panzergame awesome speed fix right there my dude :D
I just figured out what the problem was:
https://stackoverflow.com/questions/24464064/cmake-cant-find-some-image-libs
"You downloaded the source files but forgot its dependencies. For each platform blender provides its dependencies in its SVN repo."
So I just now have to download the dependencies.
Since UPBGE does not touch the dependencies, I should be able to make this thing work by downloading the deps from Blender SVN repo: https://developer.blender.org/diffusion/BL/browse/trunk/lib/win64_vc14/
However, that also means I have to install Visual Studio 2015, since VC14 libs only work with that one, probably.
The problem with CMake choosing 32-bit compiler was my own doing, I should have chosen the "Visual Studio 14 2017 Win64" compiler.
I guess I can get this thing working yet! We'll see ...
Well you could still try my build.
Sure, I will use it until I get my building setup done. But it will be probably a good idea to have a build setup for UPBGE so I can pull and compile masters just in case.
With your build, half speed CPU @ 1.6 Ghz
With your build, full speed CPU @ 3 Ghz
@Akira1San with the build you provided me the animation overhead seem to be halved! This is pretty good. Now if I just generate a model with less bones and reduce the number of keyframes I can instantiate more of these armatures in the scene.
Okay now I made a test with 7 instances, 8 animated models in total.
half speed cpu @ 1.6 GHz
full speed cpu @ 3 GHz
So basically with this optimization alone I should be able to run the prototypes on mid-tier laptops and rigs. And when I finally reduce the number of bones on the armature and optimize the keyframes on the animation, I should gain even more performance. Awesome.
I am quite happy with this right now.
I'll leave this ticket open for a day at least, I will have to test the new master build I got from @Akira1San to see how well it scales after I reduce the bone counts on the armature. This data might be useful for devs, maybe?
I think you can use animation clean up, to reduce keys significantly,
without huring anim quality, but I am not certain, as this is gleamed data
On Jun 6, 2017 3:57 PM, "Arto Pekkanen" notifications@github.com wrote:
Okay now I made a test with 7 instances, 8 animated models in total.
half speed cpu @ 1.6 GHz
https://drive.google.com/open?id=0B3u1MJ_t35aQOXFlVjl2Q3RscUU
full speed cpu @ 3 GHz
https://drive.google.com/open?id=0B3u1MJ_t35aQYm96VVJWT3Z5RTQSo basically with this optimization alone I should be able to run the
prototypes on mid-tier laptops and rigs. And when I finally reduce the
number of bones on the armature and optimize the keyframes on the
animation, I should gain even more performance. Awesome.I am quite happy with this right now.
I'll leave this ticket open for a day at least, I will have to test the
new master build I got from @Akira1San https://github.com/akira1san to
see how well it scales after I reduce the bone counts on the armature. This
data might be useful for devs, maybe?—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/UPBGE/blender/issues/503#issuecomment-306640761, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AG25WQYJVMvoeVXDot4PSCxsww5ZLqUGks5sBdlLgaJpZM4NxWR3
.
Youll get more fps, if you lower the number of polys of the body. But since you cant do that...
I already figured out a way to reduce polys. I just use the Decimate -modifier on the mesh after I've removed all the shapekeys from the meshes. I'll have to see if the old normal maps still look good with the decimated mesh, but that's a separate issue altogether.
As for the shapekeys: I will just need to create clone of the original model with shapekeys, then switch between decimated model and original model depending on whether I need the shapekeys or not.
I will probably try that MakeWalk tool to reduce keyframes if it works with my armature, seems interesting.
Alright, this fix will do for now. Animation overhead was greatly reduced, in this case about 50% less overhead.
Very well played guys, helping out a total noob like me.
I managed to set up a build for UPBGE. Now I can build and use UPBGE master, and if I will see any regressions or other problems later on I will make a separate ticket.