Mär 02, 2016 12:55:17 AM com.jme3.app.Application handleError
SCHWERWIEGEND: Uncaught exception thrown in Thread[jME3 Main,5,main]
It’s never mentioned in that thread that batching hardware skinned models actually worked.
Based on the current design of how hardware skinning is done in jME3 and Ogre3D it is not actually possible to batch animated models. There’s a limit of 256 bones that you can have on a single batch which you’ll run out of pretty quickly if you were to batch many models.
Ah ok thank you. What I am want to do is batching the players model into one object. It consits of hands, arms, torso, head, legs and feets. So batching would reduce the draw calls for the player from 6 to 1 in many cases. I try this way to save some vertices and avoid clipping problems if the player is wearing gloves or boots and so on.
Is there a better way to do this or is batching software skinned models the way to go?
Please can someone tell me a more detailed reason why batching hardware skinned models technically doesn’t work? I am very interesseted to learn more about hardware skinning and why is it a problem to merge that buffers and so on
This is the one case where I wouldn’t recommend to batch. It doesn’t matter… You have one player on screen,
6 or 1 geom is not a big deal.
Btaching is interesting when you have dozens of geoms Batched into one.
First, batching hasn’t been designed with animated models in mind. So you may have some conrner cases where it’s completely broken.
Even if it was, it would only worl with software skinning. Software skinning modifies the mesh buffer on the CPU. So in theory this could work with batched models because it’s just a matter of index in the buffer to update the right vertex transforms.
Hardware skinning however, let’s the buffer intact, and instead sends all the bones transforms to the shader to transform the vertex at render time in the shader.
The problem is that you have a limitation on how many uniforms you can send to a shader, and you basically can send a limited numbe rof bones. (as an example on android it’s less than 100, on desktop I never really tested and it depends on the hardware, but IMO even with latest ardware you can’t go above 500 or 700 bones (this can be precisely calculated). With batched models you’ll reach this limit pretty fast. A classic models with hands entirely rigged will have around a hundred bones so if you batch 10 of them…you’re done… and it won’t make it really faster.