In this case I am trying to remove a light from the scenegraph, surprisingly this ends up as an addLight down the stack trace causing me to use more lights than I should.
==>remove from bg org.xith3d.scenegraph.PointLight@188655e
Exception in thread “Thread-10” java.lang.ArrayIndexOutOfBoundsException: 8
at org.xith3d.render.shader.LightingShader.addLight(LightingShader.java:90)
at org.xith3d.render.prerender.AtomsCollector.collectGroupAtoms(AtomsCollector.java:258)
at org.xith3d.render.prerender.AtomsCollector.collectNodeAtoms(AtomsCollector.java:402)
at org.xith3d.render.prerender.AtomsCollector.collectAtoms(AtomsCollector.java:451)
at org.xith3d.render.ScenegraphModificationsManager.onChildRemovedFromGroup(ScenegraphModificationsManager.java:259)
at org.xith3d.scenegraph.GroupNode.removeChild(GroupNode.java:246)
at hawk.manager.LightManager.enableSet(LightManager.java:344)