Game Development Community

Alpha blending /Sorting issue

by Gareth Fouche · in Artist Corner · 08/12/2007 (6:44 pm) · 5 replies

Hi,

I am having problems with hair on my model, as you can see in the picture the head can be seen through the hair. I have broken up the model into seperate parts, each with its own texture (all textures including the one with alpha are part of a single multi/Sub-object texture). The hair has no skin modifier, it is attached to the biped head. Even if I make the transparent texture a seperate one on its own I still have this issue. With or without SORT::

i99.photobucket.com/albums/l300/nakedninja_2006/screenshot_143-00001.jpg

Anyone have any ideas?

Thanks,
Gareth

#1
08/25/2007 (8:26 pm)
*Bump*
#2
08/25/2007 (11:09 pm)
Does it change with the viewing angle? i.e. does it work correctly sometimes and not others depending where you view it from?
#3
08/26/2007 (4:50 pm)
Nope. It's always behind the players head, from every angle.
#4
08/26/2007 (5:18 pm)
Gareth,

We setup our characters with multiple meshes 'stacked' on them, like clothing/armor. All my tests with transparent textures as part of the stack gave the same result you got. You could see our player's body through any layers that were transparent. It didn't work basically. Has something to do with the render order, and I tried many things to fix how it sorts the meshes in game. No Luck. So we made all of the 'stacked' clothing use NO transparencies....

I hope someone who knows more about it might have some feedback on how to work around this (without giving up transparencies on the stack, like we did).

This may work for you:

We only use transparencies on separate, standalone meshes... no sorting issue when its one mesh :). SO we use .MountEquipment for anything that only needs a rigid rig (single mountpoint). Like hair, hats, backpacks... we export each element separately and mount it in game. It handles the sorting as 2 separate meshes and you don't get that funky effect.

player.mountEquipment (Hair1, "head"); <----------------sumthin like that....
#5
08/27/2007 (10:55 am)
Thanks Jondo.

Yeah, for the moment I have left alpha blending behind and just done there hair as solid "helmets". I may try the mount equipment thing at some point, if I decided alpha blending is vital.

Interesting that it is not based simply on the fact that it has alpha, but on the mesh heirarchy. If I had the time I'd be tempted to go search around the code, see if it can be fixed, but at the moment I don't. Ah well, good to know it isn't just me doing something silly.