@Override
    public Shader makeCurrent(AssetManager assetManager, RenderManager renderManager,
            EnumSet<Caps> rendererCaps, LightList lights, DefineList defines) {

        // TODO: if it ever changes that render isn't called
        // right away with the same geometry after makeCurrent, it would be
        // a problem.
        // Do a radix sort.
        tempDirLights.clear();
        tempPointLights.clear();
        tempSpotLights.clear();
        for (Light light : lights) {
            switch (light.getType()) {
                case Directional:
                    tempDirLights.add((DirectionalLight) light);
                    break;
                case Point:
                    tempPointLights.add((PointLight) light);
                    break;
                case Spot:
                    tempSpotLights.add((SpotLight) light);
                    break;
            }
        }

        defines.set(numDirLightsDefineId, tempDirLights.size());
        defines.set(numPointLightsDefineId, tempPointLights.size());
        defines.set(numSpotLightsDefineId, tempSpotLights.size());

        return techniqueDef.getShader(assetManager, rendererCaps, defines);
    }
Rendering logic for static pass.

@author Kirill Vainer
jme3-core/src/main/java/com/jme3/material/logic/StaticPassLightingLogic.java