public void TaskMethod(List <LightSource> lights, List <Triangle> triangles) { Point ray = Point.GeneratePointOnSphere(Origin); Vector vector = new Vector(Origin, ray); float a = Trace(lights, triangles, vector, MaxDept); ray.MultiplyByLambda(a); if (!LookDirections.Contains(vector.GetEndPoint())) { lock (lockObj) { LookDirections.Add(vector.GetEndPoint()); } } }
private void StartSequential(List <LightSource> lights, List <Triangle> triangles) { for (int i = 0; i < Sampling; i++) { Point ray = Point.GeneratePointOnSphere(Origin); Vector vector = new Vector(Origin, ray); float a = Trace(lights, triangles, vector, MaxDept); ray.MultiplyByLambda(a); if (!LookDirections.Contains(vector.GetEndPoint())) { LookDirections.Add(vector.GetEndPoint()); } } bs.Close(); }