public bool init(Scene scene) { if (numSets < 1) { numSets = 1; } UI.printInfo(UI.Module.LIGHT, "Instant Global Illumination settings:"); UI.printInfo(UI.Module.LIGHT, " * Samples: {0}", numPhotons); UI.printInfo(UI.Module.LIGHT, " * Sets: {0}", numSets); UI.printInfo(UI.Module.LIGHT, " * Bias bound: {0}", c); UI.printInfo(UI.Module.LIGHT, " * Bias rays: {0}", numBias); virtualLights = new PointLight[numSets][]; if (numPhotons > 0) { for (int i = 0, seed = 0; i < virtualLights.Length; i++, seed += numPhotons) { PointLightStore map = new PointLightStore(this); if (!scene.calculatePhotons(map, "virtual", seed)) { return(false); } virtualLights[i] = map.virtualLights.ToArray(); UI.printInfo(UI.Module.LIGHT, "Stored {0} virtual point lights for set {0} of {0}", virtualLights[i].Length, i + 1, numSets); } } else { // create an empty array for (int i = 0; i < virtualLights.Length; i++) { virtualLights[i] = new PointLight[0]; } } return(true); }
public bool init(Scene scene) { if (numSets < 1) numSets = 1; UI.printInfo(UI.Module.LIGHT, "Instant Global Illumination settings:"); UI.printInfo(UI.Module.LIGHT, " * Samples: {0}", numPhotons); UI.printInfo(UI.Module.LIGHT, " * Sets: {0}", numSets); UI.printInfo(UI.Module.LIGHT, " * Bias bound: {0}", c); UI.printInfo(UI.Module.LIGHT, " * Bias rays: {0}", numBias); virtualLights = new PointLight[numSets][]; if (numPhotons > 0) { for (int i = 0, seed = 0; i < virtualLights.Length; i++, seed += numPhotons) { PointLightStore map = new PointLightStore(this); if (!scene.calculatePhotons(map, "virtual", seed)) return false; virtualLights[i] = map.virtualLights.ToArray(); UI.printInfo(UI.Module.LIGHT, "Stored {0} virtual point lights for set {0} of {0}", virtualLights[i].Length, i + 1, numSets); } } else { // create an empty array for (int i = 0; i < virtualLights.Length; i++) virtualLights[i] = new PointLight[0]; } return true; }