Lighting issue in 3.1 Hardware Skinning

I just switched to 3.1 stable from 3.0.10 and the lighting on my main character model is no longer working correctly. The only light source that appears to have an effect is the ambient light. I am using the default Lighting material definition. I believe the issue is related to hardware skinning and shared materials because when I turn hardware skinning off the issue goes away. I have one skeleton control attached to the parent node and separate geometries for each body part so they can be swapped out in game with different clothing. The body parts all share the same material since they are just sub parts of the same base mesh. I’ve tried creating new material files for each part but that didn’t work. I also tried assigning material clones to each part at run time but that also didn’t work. Any ideas how to correct this issue so that lighting is evaluated correctly for my model?

mhh there has been a fix recently regarding tangents, normals and hardware skinning.
could you add this file in your asset folder and see if you still have the issue?

put it in assets/Common/ShaderLib

I’ve tried using the suggested file I am still seeing the same issue, just to make sure it was being used I even tried replacing it in the jme3 core jar file in that directory. It’s interesting that the hair which does use a different material is also not lit correctly but the clothing is. I guess I need to figure out what is different about the clothing material that makes it work. So far the only difference I’m aware of is that it is loaded separately and swapped in at run time.

Did you try it with and without having gamma correction enabled?

I presume you mean the gamma correction setting in AppSettings. Tried setting to false but no change. I checked the available vertex buffers for each mesh both the clothing and base model have the same available buffers which makes since since the asset pipeline used for both was the same. I also printed all material parameters and they are the same except the textures of course. The only difference is that the asset name for the clothing material is null which brings me back to the conclusion that this is related some how to the sharing of materials.

Working
Geometry: MageRobes
TexCoord
Index
BindPosePosition
BindPoseNormal
BoneWeight
BoneIndex
HWBoneIndex
HWBoneWeight
Position
Normal

Material: null
Specular=0.0 0.0 0.0 1.0
Ambient=0.8 0.8 0.8 1.0
Diffuse=0.8 0.8 0.8 1.0
DiffuseMap=WrapRepeat_S WrapRepeat_T “Models/Clothing/Robes/MageRobes_Blue_Diffuse.png”
UseMaterialColors=true
ParallaxHeight=0.05
GlowColor=0.0 0.0 0.0 1.0
Shininess=25.0

Not Working
Geometry: FemaleToon_Hands
TexCoord
Index
BindPosePosition
BindPoseNormal
BoneWeight
BoneIndex
HWBoneIndex
HWBoneWeight
Position
Normal

Material: Materials/Creatures/Human/FemaleToon_Skin_White.j3m
Specular=0.0 0.0 0.0 1.0
Ambient=0.8 0.8 0.8 1.0
Diffuse=0.8 0.8 0.8 1.0
DiffuseMap=“Textures/Creatures/Human/FemaleToon_Body_Diffuse.png”
BackfaceShadows=false
UseMaterialColors=true
UseInstancing=false
ParallaxHeight=0.05
Shininess=25.0
GlowColor=0.0 0.0 0.0 1.0
NormalMap=“Textures/Creatures/Human/FemaleToon_Body_Normal.png”

Ok, so just after I posted this I realized my clothing material was missing a NormalMap I guess it was skipped when I imported it and I had never noticed. I deleted the NormalMap for my base model material and now everything looks fine and I am getting light from other sources. However this leads me to my next problem, why is my NormalMap not working as it did in 3.0.10?

Anybody have an idea why my NormalMaps might not be working correctly when Hardware Skinning is enabled in 3.1? Do I need to be supplying tangents because currently my models don’t have them. Guess I might have to start delving into the shaders to see what is going on.

Normal maps always require tangents. Always always.

If this worked before then it was just a fluke.

But normal maps always require tangents. It’s impossible to have proper normal maps without tangents.

Great thanks, will have to go back and review my blender export process to make sure I’m getting tangents included.

…or generate them with the tangent generator in JME. Many of the formats don’t export tangents, I guess.