@Override public void populateProbes(Geometry g, LightList lightList) { if (!lightProbes.isEmpty()) { //The first probe is actually the closest to the geometry since the //light list is sorted according to the distance to the geom. LightProbe p = lightProbes.get(0); if (p.isReady()) { lightList.add(p); } //clearing the list for next pass. lightProbes.clear(); } }
@Override public void populateProbes(Geometry g, LightList lightList) { if (!lightProbes.isEmpty()) { //The 3 first probes are the closest to the geometry since the //light list is sorted according to the distance to the geom. int addedProbes = 0; for (LightProbe p : lightProbes) { if (p.isReady() && p.isEnabled()) { lightList.add(p); addedProbes ++; } if (addedProbes == MAX_PROBES) { break; } } //clearing the list for next pass. lightProbes.clear(); } }
/** * For debuging porpose only * Will return a Node meant to be added to a GUI presenting the 2 cube maps in a cross pattern with all the mip maps. * * @param manager the asset manager * @return a debug node */ public static Node getDebugGui(AssetManager manager, LightProbe probe) { if (!probe.isReady()) { throw new UnsupportedOperationException("This EnvProbe is not ready yet, try to test isReady()"); } Node debugNode = new Node("debug gui probe"); Node debugPfemCm = EnvMapUtils.getCubeMapCrossDebugViewWithMipMaps(probe.getPrefilteredEnvMap(), manager); debugNode.attachChild(debugPfemCm); debugPfemCm.setLocalTranslation(520, 0, 0); return debugNode; }
Material m = probeGeom.getMaterial(); probeGeom.setLocalScale(probeScale); if (probe.isReady()) { m.setTexture("CubeMap", probe.getPrefilteredEnvMap());
public void populateProbe(LightList lightList){ if(probe != null && probe.isReady()){ lightList.add(probe); } }
@Override public void populateProbes(Geometry g, LightList lightList) { if (!lightProbes.isEmpty()) { //The first probe is actually the closest to the geometry since the //light list is sorted according to the distance to the geom. LightProbe p = lightProbes.get(0); if (p.isReady()) { lightList.add(p); } //clearing the list for next pass. lightProbes.clear(); } }
Material m = probeGeom.getMaterial(); probeGeom.setLocalScale(probeScale); if (probe.isReady()) { m.setTexture("CubeMap", probe.getPrefilteredEnvMap());