// Sun Light
sun.setDirection(new Vector3f(1,0,-2).normalize());
sun.setColor(ColorRGBA.White.mult(0.6f));
rootNode.addLight(sun);
rootNode.attachChild(sunLightNode);
// Ambient Light
ambient.setColor(ColorRGBA.White.mult(0.2f));
rootNode.addLight(ambient);
// Configure Shadows from the sun
final int SHADOWMAP_SIZE=256;
DirectionalLightShadowRenderer dlsr = new DirectionalLightShadowRenderer(assetManager, SHADOWMAP_SIZE, 3);
dlsr.setShadowIntensity(0.2f);
dlsr.setLight(sun); viewPort.addProcessor(dlsr);
Obs: There is some lights in the model, but I tried to remove those lights and got the same effect.
Does your space ships has special setting, like not writing depth, being in a trasparent bucket or non obvious things that we should know?
Post the code where you load and add the space ship
The material for this particular object is lighting.j3md with single texture on difusemap and specular/difuse = 1,1,1,1 , ambient = 0,0,0,1. I am using this setup for almost every object, not sure if there is something wrong with this ambient 0,0,0,1.
Blend = off , facecull = back.
Also, it looks like its happening with all objects, I think it allways happend, but I just notice today.
// Configure Shadows from the sun
final int SHADOWMAP_SIZE=256;
DirectionalLightShadowRenderer dlsr = new DirectionalLightShadowRenderer(assetManager, SHADOWMAP_SIZE, 3);
dlsr.setShadowIntensity(0.2f);
dlsr.setLight(sun); viewPort.addProcessor(dlsr);
Also, this is the code I use to load the planet ( that will receive shadows ) :
You are right !
I cant believe it was so simple to fix it !
I really thought post processors like glow should be declared only once per game, and I put it in the first lines of the main class.
I guess a lot of people do the same mistake.
Thanks friend, you are the best !