Interference Posted January 14, 2014 Share Posted January 14, 2014 I'm using Leadwerks 3.1 Steam Edition and when setting up materials that are alpha transparent and used on an animated mesh. The shaders I'm loading are the correct ones -- diffuse+normal+specular.shader from shaders/animated and shadow+animation.shader -- but when I set the blend mode in properties to alpha and enable "Z Sort" it vanishes and is invisible in-game. Disabling "Z Sort" makes it render, but z sorting is obviously completely screwed as a result. Is this a bug or a limitation? If not, what did I screw up and how do I go about fixing it? Quote Link to comment Share on other sites More sharing options...
YouGroove Posted January 14, 2014 Share Posted January 14, 2014 The parameters you used are perhaps for the full object and not for alpha on diffuse texture. You are asking diffuse+Norm+spec+alpha shader at final ? like for plants having normal+spec+alpha ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Interference Posted January 14, 2014 Author Share Posted January 14, 2014 I'm not quite sure what you're saying, so perhaps some more detail would help: I'm using it for hair. The material itself is applied to just the hair and nothing else, is set to "alpha" blending and two sided. Turning on the Z-sorting parameter (as mentioned in the Material Editor section of the user guide under the "Blend Mode" heading), makes the hair vanish (both in the material editor and in-game) and only affects this one material: setting the shader to diffuse.shader sort of works (there's still a fair bit of Z-buffer confusion where the hair is visible through itself) but, of course, this shader doesn't process skeletal animation and so the hair just hangs there while the rest of the model moves. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted January 14, 2014 Share Posted January 14, 2014 Yep LE3 manages Diffuse + alpha if i remeber well, im' not sure it can manage for your "hair" model some shader applying alpha on normal map + Spec map also. Caus i think your problem is that you want your hair using alpha texture to have normal map also ? this shader doesn't process skeletal animation and so the hair just hangs there while the rest of the model moves You should attach the hair to the character head bone with some code, this way you will be able to change it, or just make the hair part of the model character when rigging. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Interference Posted January 14, 2014 Author Share Posted January 14, 2014 No, I don't need a normal map. The single shader provided that works on animated meshes can accept one but I don't need it and the box for dropping one in is currently empty on this material. Detaching the hair from the main mesh and having it as a separate object that's linked to the character's head would allow me to use the non-animation ready shader but that's far less than ideal for several reasons: 1. Even the non-animation shader doesn't process the Z-order correctly. It's better, but since the animated one is flat out invisible the baseline is pretty low. 2. You lose the ability to have the bone structure of the model influence the hair. If the hair is long or you're doing this with eyelashes -- which need to move when a character blinks -- then you *need* that functionality. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted January 14, 2014 Share Posted January 14, 2014 Detaching the hair from the main mesh and having it as a separate object that's linked to the character's head would allow me to use the non-animation ready shader but that's far less than ideal for several reasons: All shaders works same on character with animation or static object , you mean Static Vs dynamic shader ? For hair dynamic physic in games, it's special code managing vertex, or rope physics on some hair parts colliding with an invisble volume attached to the bone head of character. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Interference Posted January 14, 2014 Author Share Posted January 14, 2014 Eh? I didn't say anything about physics. The hair is vertex weighted, just like the body, and is meant to move with the bone structure. If you detach it, it'll stop doing that. It'll just move with the one bone and ignore other bone influences. Long hair will clip through a character's shoulders. Eyelashes won't move when a character blinks. The shader you apply to materials that are going on skinned meshes -- specifically shaders/animated/diffuse+normal+specular.shader -- is designed specifically to allow skinning on the GPU. If you don't use the right shader, the object doesn't deform with the bones: it just hangs there. The correct shader, when applied to alpha transparent hair -- diffuse map only. No specular or normal map -- currently seems to cause the hair material to completely turn invisible when you tick the checkboxes the documentation says ensure the material renders correctly. Here's my current material settings: http://i.imgur.com/NMsCVrX.png Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.