Light and Shadow Rendering Algorithm, O(n2)