protected static ColorRGBA getAmbientColor(LightList lightList, boolean removeLights, ColorRGBA ambientLightColor) { ambientLightColor.set(0, 0, 0, 1); for (int j = 0; j < lightList.size(); j++) { Light l = lightList.get(j); if (l instanceof AmbientLight) { ambientLightColor.addLocal(l.getColor()); if (removeLights) { lightList.remove(l); } } } ambientLightColor.a = 1.0f; return ambientLightColor; }
protected void extractIndirectLights(LightList lightList, boolean removeLights) { ambientLightColor.set(0, 0, 0, 1); for (int j = 0; j < lightList.size(); j++) { Light l = lightList.get(j); if (l instanceof AmbientLight) { 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; } }
@Test public void testSimpleSort() { Geometry g = new Geometry("test", new Mesh()); LightList list = new LightList(g); list.add(new SpotLight(Vector3f.ZERO, Vector3f.UNIT_X)); list.add(new PointLight(Vector3f.UNIT_X)); list.add(new DirectionalLight(Vector3f.UNIT_X)); list.add(new AmbientLight()); list.sort(true); assert list.get(0) instanceof AmbientLight; // Ambients always first assert list.get(1) instanceof DirectionalLight; // .. then directionals assert list.get(2) instanceof SpotLight; // Spot is 0 units away from geom assert list.get(3) instanceof PointLight; // .. and point is 1 unit away. }
assert list.get(0) instanceof AmbientLight; assert list.get(1) instanceof DirectionalLight; assert list.get(2) instanceof SpotLight; assert list.get(3) instanceof PointLight; n.updateGeometricState(); assert list.get(0) instanceof AmbientLight; assert list.get(1) instanceof DirectionalLight; assert list.get(2) instanceof PointLight; assert list.get(3) instanceof SpotLight;
Light light = worldLights.get(i);
Light l = lightList.get(curIndex); if(l.getType() == Light.Type.Ambient){ endIndex++;
box.setLocalTranslation(-1f, 0.5f, -2); ((PointLight) scene.getLocalLightList().get(0)).setColor(ColorRGBA.Red); plsr.setLight((PointLight) scene.getLocalLightList().get(0)); plsr.setEdgeFilteringMode(EdgeFilteringMode.PCF4); plsf.setLight((PointLight) scene.getLocalLightList().get(0)); plsf.setEdgeFilteringMode(EdgeFilteringMode.PCF4); plsf.setEnabled(useFilter);
Light l = lights.get(i); if (l.getType() == Light.Type.Ambient || l.getType() == Light.Type.Probe) { continue;
for (curIndex = startIndex; curIndex < endIndex && curIndex < lightList.size(); curIndex++) { Light l = lightList.get(curIndex); if (l.getType() == Light.Type.Ambient || l.getType() == Light.Type.Probe) { endIndex++;
private ColorRGBA getAmbientColor(LightList lightList) { ambientLightColor.set(0, 0, 0, 1); for (int j = 0; j < lightList.size(); j++) { Light l = lightList.get(j); if (l instanceof AmbientLight) { ambientLightColor.addLocal(l.getColor()); } } ambientLightColor.a = 1.0f; return ambientLightColor; }
protected static ColorRGBA getAmbientColor(LightList lightList, boolean removeLights, ColorRGBA ambientLightColor) { ambientLightColor.set(0, 0, 0, 1); for (int j = 0; j < lightList.size(); j++) { Light l = lightList.get(j); if (l instanceof AmbientLight) { ambientLightColor.addLocal(l.getColor()); if (removeLights) { lightList.remove(l); } } } ambientLightColor.a = 1.0f; return ambientLightColor; }
private void initLight() { System.out.println("LightList size = "+rootNode.getLocalLightList().size()); while(rootNode.getLocalLightList().size() > 0) { System.out.println("\t"+rootNode.getLocalLightList().get(0).getType().name()); rootNode.removeLight(rootNode.getLocalLightList().get(0)); } System.out.println("LightList size = "+rootNode.getLocalLightList().size()); DirectionalLight sun = new DirectionalLight(); sun.setDirection(new Vector3f(0f, -1f, 0f)); rootNode.addLight(sun); AmbientLight ambientLight = new AmbientLight(); ambientLight.setColor(ColorRGBA.Red.mult(0.1f)); rootNode.addLight(ambientLight); }
protected LightProbe extractIndirectLights(LightList lightList, boolean removeLights) { ambientLightColor.set(0, 0, 0, 1); LightProbe probe = null; for (int j = 0; j < lightList.size(); j++) { Light l = lightList.get(j); if (l instanceof AmbientLight) { ambientLightColor.addLocal(l.getColor()); if(removeLights){ lightList.remove(l); j--; } } if (l instanceof LightProbe) { probe = (LightProbe)l; if(removeLights){ lightList.remove(l); j--; } } } ambientLightColor.a = 1.0f; return probe; } }
Light light = worldLights.get(i);
Light light = worldLights.get(i);
lightPos.setVector4InArray(0f, 0f, 0f, 0f, lightIndex); } else { Light l = lightList.get(i); ColorRGBA color = l.getColor(); lightColor.setVector4InArray(color.getRed(),
Light l = lightList.get(i); if (l instanceof AmbientLight) { continue;
Light l = lights.get(i); if (l instanceof AmbientLight) { continue;
for (curIndex = startIndex; curIndex < endIndex && curIndex < lightList.size(); curIndex++) { Light l = lightList.get(curIndex); if (l.getType() == Light.Type.Ambient) { endIndex++;