Hi, I’m checking out Panda3D for the first time and I have trouble getting normal maps to work.
My model has a diffuse, specularity and normal map and I loaded it into the bump-mapping sample room to test it, but the normal map has no effect (spec and diff work). I did exactly the same with my model as with the room in the sample: self.model.setLight(plnp), self.model.setShaderAuto(). The normal maps of the abstractroom.egg work fine.
I exported my model from Blender with YABEE and the top of the exported egg looked like that:
<CoordinateSystem> { Z-up }
<Material> Mech_desert {
<Scalar> diffr { 0.077307 }
<Scalar> diffg { 0.093049 }
<Scalar> diffb { 0.073390 }
<Scalar> specr { 0.396502 }
<Scalar> specg { 0.396502 }
<Scalar> specb { 0.396502 }
<Scalar> shininess { 16.0 }
<Scalar> ambr { 1.000000 }
<Scalar> ambg { 1.000000 }
<Scalar> ambb { 1.000000 }
<Scalar> emitr { 0.000000 }
<Scalar> emitg { 0.000000 }
<Scalar> emitb { 0.000000 }
}
<Texture> Nor2 {
"./tex/Mech5_nor2.png"
<Scalar> envtype { NORMAL }
<Scalar> minfilter { LINEAR_MIPMAP_LINEAR }
<Scalar> magfilter { LINEAR_MIPMAP_LINEAR }
<Scalar> wrap { REPEAT }
}
<Texture> Spec {
"./tex/Mech5_spec.png"
<Scalar> envtype { MODULATE }
<Scalar> minfilter { LINEAR_MIPMAP_LINEAR }
<Scalar> magfilter { LINEAR_MIPMAP_LINEAR }
<Scalar> wrap { REPEAT }
}
<Texture> Desert {
"./tex/Mech5_desert.png"
<Scalar> envtype { MODULATE }
<Scalar> minfilter { LINEAR_MIPMAP_LINEAR }
<Scalar> magfilter { LINEAR_MIPMAP_LINEAR }
<Scalar> wrap { REPEAT }
}
Then I had to change the spec texture format and envtype manually, because it only darkened the model.
<Texture> Spec {
"./tex/Mech5_spec.png"
<Scalar> format { alpha }
<Scalar> envtype { gloss }
<Scalar> minfilter { LINEAR_MIPMAP_LINEAR }
<Scalar> magfilter { LINEAR_MIPMAP_LINEAR }
<Scalar> wrap { REPEAT }
}
I’ve also noticed that the vertices in the abstractroom.egg have additional tangent and binormal values
that are missing in the YABEE file. Maybe that could be the problem? Also, the order of the values is different.
That’s a vertex in the abstractroom.egg:
<Vertex> 25 {
-35.1127 50 32.3473
<UV> {
-1.09994 2
<Tangent> { 0.587785 0 0.809017 }
<Binormal> { 0 1 0 }
}
<Normal> { -0.809017 0 0.587785 }
<RGBA> { 1 1 1 1 }
}
And that’s one in my exported file:
<Vertex> 234 {0.652181 2.961116 9.088800
<Normal> { 0.125889 0.991455 -0.033540 }
<UV> {
0.9738800525665283 0.32654404640197754
}
}
Edit: Oops, should’ve posted this in pipeline.