I have an issue setting up lighting and shadows with my project. I added a simle Directional Light and then a Directional Light Shadow Renderer, but I have no shadows.
Here is my code:
ViewPort localvp = settings.getViewPort();
AssetManager localam = settings.getAssetManager();
DirectionalLight sun = new DirectionalLight();
sun.setDirection(new Vector3f(0, 1, 0).normalizeLocal());
sun.setColor(ColorRGBA.White);
settings.getNode().addLight(sun);
DirectionalLightShadowRenderer dlsr = new DirectionalLightShadowRenderer(localam, 1024, 2);
dlsr.setLight(sun);
localvp.addProcessor(dlsr);
You said you wanted it perpendicular to the X-Z plane so why do you make it parallel instead?
I can’t tell if there is confusion about what “perpendicular” means or what “direction” means.
If light is overhead then 0, -1, 0 is the light pointing straight down, ie: perpendicular to the x-z plane. -1, -1, 0 is not even a direction vector until normalized but will be parallel to the x-z plane as it has no y component at all (the definition of parallel to the x-z plane.)
Yes, I know that perpendicular light is X:0 Y:-1 Z:0 but I made a 45 degrees light with these parameters, right? I don’t think it’s parallel to the X-Z plane (it should be X:-1 Y:0 Z:0)