protected void extractIndirectLights(LightList lightList, boolean removeLights) {
        ambientLightColor.set(0, 0, 0, 1);
        useAmbientLight = false;
        for (int j = 0; j < lightList.size(); j++) {
            Light l = lightList.get(j);
            if (l instanceof AmbientLight) {
                useAmbientLight = true;
                ambientLightColor.addLocal(l.getColor());
                if(removeLights){
                    lightList.remove(l);
                    j--;
                }
            }
            if (l instanceof LightProbe) {
                lightProbes.add((LightProbe) l);
                if(removeLights){
                    lightList.remove(l);
                    j--;
                }
            }
        }
        ambientLightColor.a = 1.0f;
    }
Uploads the lights in the light list as two uniform arrays.
<p>
<code>uniform vec4 g_LightColor[numLights];</code> //
g_LightColor.rgb is the diffuse/specular color of the light. //
g_LightColor.a is the type of light, 0 = Directional, 1 = Point, 2 = Spot.
<code>uniform vec4 g_LightPosition[numLights];</code> //
g_LightPosition.xyz is the position of the light (for point lights)
// or the direction of the light (for directional lights). //
g_LightPosition.w is the inverse radius (1/r) of the light (for
attenuation) </p>

@param shader the Shader being used
@param g the Geometry being rendered
@param lightList the list of lights
@param numLights the number of lights to upload
@param rm to manage rendering
@param startIndex the starting index in the LightList
@param lastTexUnit the index of the most recently-used texture unit
@return the next starting index in the LightList
jme3-core/src/main/java/com/jme3/material/logic/SinglePassAndImageBasedLightingLogic.java