Strange Lighting

Ok, so in my scene, i discovered that looking in certain angles make everything(models and terrain) darker or lighter. When I look down, it is bright, but if I look up, with the y rotation of the camera in a particular angle, the lights seem to dim and go brighter as i turn. What might be causing this?

Does it have something to do with the fact that I am overlapping textures on the terrain?

It seems to be worse when I have terrain textures with normal maps

As it turns out, the problem is only present when I have a normal map associated with a texture. When i apply it, I can see changes to the lighting in the terrain editor. Is this feature not quite finished yet?

Most likley your normal map is using a differnet semantic. eg what each color means.

When you add a normal map are you also adding a tangent buffer?

Without tangents, the behavior of normal maps will be undefined.

@pspeed all I am doing is clicking the box that says normal next to the texture in the texture layers in the terrain composer. I add the normal that matches with the color. I don’t see where you can use tangent buffer or what have you. Is there another way I should do it?

You have a mesh. That mesh has normals. Those are enough for regular lighting.

As soon as you want to use normal maps then you also need your mesh to have tangents… otherwise the normal maps will have undefined results because the shader can’t calculate which way the normals in the normal map should face.

If this is a loaded model and not one you’ve generated yourself then you may need to run the TangineBinormalGenerator on it.

If he’s using the JME terrain I don’t think he needs to generate tangents. I guess they are generated along with the normals (@sploreg can confirm maybe)

@jrlowe what does your normal map look like?

@nehon said: If he's using the JME terrain I don't think he needs to generate tangents. I guess they are generated along with the normals (@sploreg can confirm maybe)

Hmmm… didn’t know that the terrain supported bump mapping by default. I guess memory-wise that’s kind of wasteful if it’s not used but maybe terrain isn’t vertex heavy.

@nehon I used a software called crazy something and it makes normal maps, bump maps, specular maps, and the normal map is mainly blue and purple with light reddish parts. It looks like a normal normal map. The same as all the other normal maps I have seen in terms of color and shading

@pspeed, yeah you’re right, actually idk. will wait for sploreg input about this.

@jrlowe ok, some normal maps needs to have some of their channels inverted. For example, a normal map generated with blender needs to have the red channel inverted to work with JME. Some will need the green one to be inverted. So maybe try to experiment with that.
Before doing this wait for the answer of sploreg though, if the tangents are not generated as pspeed hinted, this is definitely your issue.

@nehon Terrain generates tangents for you. As you said, it does that along with the normals.
@jrlowe some screenshots will help debug this. Also maybe a link to the normal map and texture you are using that seems to be causing the issue.

To rule out your normal maps as the issue, you can also try temporarily using some of the normal maps in the test data.

@Sploreg How do I add a screen shot. I have the images, how to I attach them?

@Sploreg Here http://i.imgur.com/sOQj7R4.png and http://i.imgur.com/WVhLga2.jpg

The first one has the normal the second one doesnt. The normal map is http://i.imgur.com/rh41qdC.jpg

The first images appear to be dead.

Try one of the normal map samples in the test data used in the tutorials. If that has the same issue then you will know it’s not your normal map that is the problem.

Wthat do you mean they appear dead?

@jrlowe said: Wthat do you mean they appear dead?
The first 2 links you provided go to this