private static void GenerateLightSection(object posObj) { try { Vector3i pos = (Vector3i)posObj; SunlightEngine.ComputeRays(pos.x * Chunk.Size, pos.z * Chunk.Size); SunlightEngine.Scatter(pos.x * Chunk.Size, pos.z * Chunk.Size, new Queue <Vector3i>(), new Queue <Vector3i>()); numCompleted++; if (numCompleted == total) { ThreadManager.QueueForMainThread(LightFinished); } } catch (System.Exception e) { Debug.LogError("An error has occurred. See the error log for details."); Logger.Log("Error while generating lighting.", e.Message, e.StackTrace); Engine.SignalQuit(); } }
public static void RecomputeLighting(int x, int y, int z) { SunlightEngine.Recompute(new Vector3i(x, y, z), sunNodes); BlockLightEngine.Recompute(new Vector3i(x, y, z), lightNodes); }