Archive 17/01/2023.

‘Failed to create input layout for shader LitSolid(DIRLIGHT NORMALMAP PERPIXEL) due to missing vertex element’

RockRockWhite

I’d importered a model from FBX with one of a alpha texture(*.png) just now.Then I loaded the model,setting the material(with the alpha texture).I sadly found that the material didn’t work probably while it worked normally in Material Edit.The error code is ‘Failed to create input layout for shader LitSolid(DIRLIGHT NORMALMAP PERPIXEL) due to missing vertex element’.What was the matter?How can I deal with it?

%40%7BW0W%7B%5BN9X75D8L505LEHHK
1%5DZ9N_YY%7D%405X%40YRVCJM(BNH C6MBN%5D0JUFB7MOPF%60SW%241~R

lezak

It means exactly what is written in the error message - Your model is missing some vertex element required by the technique You are using (here is the list of all vertex elements). I can see that You have uvs, so it propably would be normal and/or tangents (those are required for normal map).
Also to make use of alpha from the texture You’ll have to define ALPHAMASK in technique or use one of the predefined techniques with alpha - Your current setup is not using alpha.

RockRockWhite

So how can I do?I tried to set PetVerText true,but if I do so,the normal Texture will not work.

Modanung

Common advice around here in these situations is to take it through Blender:


…and mark the right checkboxes.

RockRockWhite

However,‘Jack.mdl’ has the same problem when set material “Materials/StoneSmall.xml”

Modanung

Jack never intended to put on a normal map, or anything else for that matter. :stuck_out_tongue_winking_eye:
Feel free to give Jack some tangent data and submit it as a pull request. I don’t think there would be objections to the model working correctly with normal maps.

RockRockWhite

Well,by the way.How can I mark the right checkboxes?

Modanung

You will find them in the Render tab of the properties panel.
In your case the settings should be something like this:
image

RockRockWhite

But it dosen’t work all the same.Only if setting PetVerText true can it work normally,but if I do so,the normal Texture will not work.

Modanung

What do you mean by this?
Would you mind sharing the assets so I (or someone else) could have a look and try?
To get transparency to show you’ll need to use the DiffNormalSpecAlpha technique, btw.

RockRockWhite

谢谢你一直热心解答. :grinning: 算了,敲英文太累了,看了你的主页我想中文你应该看得懂的.我这个模型只是随便从网上下载下来试用的.是fbx带有法线贴图的那种.我导出成mdl后在编辑器试用,但是如果我不设置灯光Pet VerTex为True的话,模型的纹理就会像图上一样莫名变黑 _YBW%7BNV%7BEF53~%7DCUVX%5DP%25NJ ,如果我设置了Pet VerTex为True,模型能正常看到,但是法线贴图就无效了.但是我发现同样的纹理在box.mdl等基本模型上面就就没有任何问题. 我贴上我网上下载的模型,和转换后的模型

RockRockWhite

下载的fbx模型和转换后的模型:https://pan.baidu.com/s/17DoY4DiEqblo5vso_MMbIQ

RockRockWhite

Solved.Thank you very much!Using the Editor (File -> Import Model),everything is all right!

Modanung

我只懂中文,因为机器会为我翻译。 :wink:
Glad you solved it.

RockRockWhite

I saw in your page "魔大农’ ,which made me think you are know chinese

Modanung

I made up the name Modanung - from the top of my head - when I was about thirteen years old, with no intention of it having any meaning beyond it being my nickname in virtual environments. About a year ago I found out (while translating lines from Firefly and being twice as old) these three Chinese characters closely dictate the intended pronunciation. Seeing that many people are more familiar with Chinese characters than Latin characters I figured I’d use both. Also it’s shorter and I think it looks cool. :sunglasses:

RockRockWhite

So it does.And the two characters pronounced similarly.It’s really cool! :grinning:

RockRockWhite

But I’m poor in English and have difficulty to read the web in English .:disappointed_relieved:

Modanung

叢林中掙扎激勵鋪平道路 :slight_smile:

Struggling through the jungle motivates to pave the road

(A minimum of 20 characters is quite a high bar in Chinese, btw.)