Currently, The lighting calculation iterates over each light and each vertex.
The Vertex Indices (VertexRange?) should be spatially hashed so the lighting needs only be calculated for vertices within a lights area of influence.
Something along the lines of IDictionary<VectorInt2,IList<VertexRange>>, where the Key is a vector that contains the x/z position. The bucketing should not be too small, otherwise you get 6 vertices for a single bucket.
The spatial hash would also allow to run the whole thing in parallel
Currently, The lighting calculation iterates over each light and each vertex. The Vertex Indices (
VertexRange
?) should be spatially hashed so the lighting needs only be calculated for vertices within a lights area of influence.Something along the lines of
IDictionary<VectorInt2,IList<VertexRange>>
, where the Key is a vector that contains the x/z position. The bucketing should not be too small, otherwise you get 6 vertices for a single bucket.The spatial hash would also allow to run the whole thing in parallel