Strange lighting on objects

Hi, I’ve encountered another problem - this time it is not my shader, I’m using default Lighting.j3md

Look at the image:
http://postimg.org/image/rlhsfza3z/

In the upper part i have one item placed on the ground (separate node to hold all items). Everything looks ok.
On the bottom we see that another item appears on the floor, the first one is covered with darkness. No matter which item comes to the scene first, no matter which one is to the left, it’s always the torch (long item) blacked out.

Both items have separate material files, the difference is only on the maps.

[java]
Material MyMaterial : Common/MatDefs/Light/Lighting.j3md {
MaterialParameters {
DiffuseMap : Flip Repeat Models/Obiekty_mapy/Lochy/Items/Torch/toDIF.png
SpecularMap : Flip Repeat Models/Obiekty_mapy/Lochy/Items/Torch/toSPEC.png
Minnaert : false
Specular : 1.0 1.0 1.0 1.0
Diffuse : 1.0 1.0 1.0 1.0
UseMaterialColors : true
//ParallaxHeight : 0.05
NormalMap : Flip Repeat Models/Obiekty_mapy/Lochy/Items/Torch/toBUMP2.png
Ambient : 0.0 0.0 0.0 1.0
Shininess : 1.0
WardIso : false
HardwareShadows : true

	VertexLighting : false
	//ParallaxMap : Flip Repeat Models/Obiekty_mapy/Lochy/Items/Torch/toBUMP_HEIGHT.png
	//ParallaxMap : Flip Repeat Models/Obiekty_mapy/Lochy/Items/Torch/toPAR2.png
	//SteepParallax : true
	//ParallaxHeight : 0.09 
}
AdditionalRenderState {
  FaceCull Back
  Wireframe Off
  DepthWrite On
  PolyOffset 0.0 0.0
  AlphaTestFalloff 0.0
  Blend Off
  PointSprite Off
  ColorWrite On
  DepthTest On
}

}
[/java]

I’ve made simple test giving one of them my own material definition, which is used on walls, floor etc (that one witch cool shadows). If I do so, the problem does not exists. But, if I give them both my own material, the torch item is again covered with darkness.

Both items have ShadowMode.Off (tested with other options - the same effect). Both have tangents.

If one of them is placed outside the view, then again all is ok (expected behavior).

I have a light source following the camera, but placing both items next to another light source does not solve the problem.

To be honest I’m surprised with this problem. I don’t have any idea where to look at. Maybe someone from here encountered such behavior, or have some good question, which can guide me to the solution.

Do the objects have tangents? Normal maps require tangents or you will got odd random behavior as the GPU attempts to fill in garbage.

As I said, both have tangents.

I’m loading object using assetManager, generating tangents and placing that object for ‘future’ use in some collection.
In the ‘future’ I’m taking a clone() of it and placing it on the scene. As far as I see, clone() makes a tangent’s copy too.

@FrozenShade said: As I said, both have tangents.

I’m loading object using assetManager, generating tangents and placing that object for ‘future’ use in some collection.
In the ‘future’ I’m taking a clone() of it and placing it on the scene. As far as I see, clone() makes a tangent’s copy too.

Sorry… I missed the thing about tangents before. You can verify that it isn’t the normal map causing the issue simply by commenting it out in the material if you just wanted to double check.

Yes, it is something with normals. Strange thing, I’m using the same texture, the same normal map for everything (just an example graphics).
After removing normal map it looks like that:
http://postimg.org/image/9tk96obbh/

I don’t even have idea what to think about it. I’ll ask my team member to re-import that item or just to check it.
My actual investigations (2 hours after midnight here and I’m still working) took me to the point that there is something wrong with this particular model.

Thank you.

If this is the case:

  1. works fine without normal maps
  2. with normal maps, randomly looks dark or oddly colored, sometimes flat colors.

then… you do not really have tangents.

If you ran the tangent generator and you are sure that you did… then you may not even have normals as they would be required to generate tangents, I think.

Solved. To inform anyone who can encounter similar problem in the future - the UV mapping was not defined. My team member sent me just a sketch.