Render order

I’ve got a character with a shirt, vest and coat. One on top of the other. The idea was that the player can change and select what to use.

The problem is poor rigging. With some animations parts of the shirt end up on top of the vest and coat, a knee sticks out from under the pants etc.

Is there any (easy) way to fix this with panda?

A solution woud be to somehow force the shirt to be always drawn in front of the body, the vest in front of the shirt and the coat in front of the vest… but I’ve no idea how to do that.
There can be more then one char on the screen, so if I add the shirts of both to a ‘shirt-bin’ then a coat of one of the chars would be drawn in front of both shirts? Even when the coated char is behind?

Maybe some trick with depth offset would work? But would it work with up to 4 layers?

Oh, and some layers/cloths have transparent part, not sure if this changes anything.

There’s no really great way to fix this in Panda or any other 3-D engine. You can play games with the depth offset or the binning or stuff, and they will work to a certain extent, but they all cause artifacts of one kind or another. It’s much better just to solve the rigging problems in the first place.


Ok, thanks. I’ll just have to do it the hard way, but at least I know now that the hard way is the right way.

My artist likes to have several torso models, instead of trying to put different things over the torso. This avoids the issues by not even having the overlapping geometry that causes the issues. Combine this with using textures where possible (you can stack multiple normal mapped and alpha masked textures if you are willing to get into shaders) instead of more geometry and maybe there is some hope.

I’d like to know what is usually done though, since its a very problem and I don’t see a great approach.