I've just started working with jME and I've created a 3d model in blender, and exported it to .obj and imported it in my jME application. Ambient light works fine, but the direct light I'm using, only lights up few faces, but instead of lighting up just one face of an object, it lights up the entire object regardless of the direction of the object (both upper arms):
The rest of the character stays unlit by the directional light. This is the source code:
public class Hello extends SimpleApplication {
@Override
public void simpleInitApp() {
Spatial character = assetManager.loadModel("/character.obj");
Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
character.setMaterial(mat);
character.scale(0.5f, 0.5f, 0.5f);
rootNode.attachChild(character);
AmbientLight al = new AmbientLight();
al.setColor(ColorRGBA.White.mult(1.3f));
rootNode.addLight(al);
DirectionalLight sun = new DirectionalLight();
sun.setColor(ColorRGBA.White);
sun.setDirection(new Vector3f(0,1,0).normalizeLocal());
rootNode.addLight(sun);
}
/**
* @param args
*/
public static void main(String[] args) {
Hello app = new Hello();
app.start();
}
}
What is the problem?