Tomb-Editor icon indicating copy to clipboard operation
Tomb-Editor copied to clipboard

TE: Spatial hashing of room vertices for quicker lighting

Open Raildex opened this issue 9 months ago • 0 comments

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

Raildex avatar May 10 '24 16:05 Raildex