private void addDirectionalLight() {
        DirectionalLight light = new DirectionalLight();

        light.setColor(ColorRGBA.White);
        light.setDirection(new Vector3f(-1, -1, -1));

        DirectionalLightShadowFilter dlsf = new DirectionalLightShadowFilter(assetManager, 1024, 1);
        dlsf.setLight(light);
        dlsf.setEdgeFilteringMode(EdgeFilteringMode.PCFPOISSON);
        filterPostProcessor.addFilter(dlsf);

        rootNode.addLight(light);
    }
A test case for using instancing with shadow filter.

Based on distance from camera, swap in/out more/less detailed geometry to/from an InstancedNode.

@author duncanj
jme3-examples/src/main/java/jme3test/scene/instancing/TestInstancedNodeAttachDetachWithShadowFilter.java