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?
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.
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.
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.