The example apps are not telling me enough about how to use even the basic shadows.
I looked at the TestShadow.java and am confused, as it is hard to see what code within it is actually part of the shadow rendering versus the frustum display. My effort to mimic its essence in my own app produces no shadows.
Do I need anything at all in my update loop (other than, perhaps, setting the BasicShadowRenderer’s direction so it matches that of a given DirectionLight in my scene) to make this work?
I’m also not sure what the BasicShadowRenderer does and does not do. Will a given Geometry self-shadow when any of its parents are marked CastAndReceive? Will a given Geometry cast shadows on its parent Geometries if CastAndReceive are in effect?
My code right now looks like so, when I init the scene:
mBasicShadowRenderer = new BasicShadowRenderer(App.getApp().getAssetManager(), 256);
mBasicShadowRenderer.setDirection(new Vector3f(-.5f,-.5f,-.5f).normalizeLocal()); // light direction
App.getApp().getViewPort().addProcessor(mBasicShadowRenderer);
I have temporarily removed the update() code, as it appeared to do nothing as regards shadows.
I called Node.setShadowMode(CastAndReceive) on my scene’s root node.
I called Node.setShadowMode(off) on my SkyBox (in case that can ever cast a shadow)
No shadows are visible.
tone
This tutorial goes into great detail how to use shadows and how they work, it also has all the necessary code. Nothing fancy has to be done in the update loop.
Run the test cases and see if they work. You might also try setting any parent nodes to CaseAndReceive as this can affect if the children use shadows.