Menu

#20 AllocBlock: cache index of last used lightmap, start search there

None
closed-accepted
nobody
None
5
2015-03-23
2014-04-29
No

This is a level loading speedup, helpful mainly for levels with a lot of lightmaps. telefragged.bsp has 182 lightmaps and was spending over 3 seconds in AllocBlock while loading the level. With this patch that goes down to around 40ms, but the cost is we use 10 extra lightmaps because the packing is a bit worse.

The idea is, AllocBlock is trying to find a lightmap to fit a given surface in. Since it always starts searching at lightmap 0, once the first few lightmaps are full it's wasteful to keep trying the full lightmaps. So with the patch, as soon as a surface doesn't fit in a given lightmap, we go on to the next lightmap and never try adding surfaces to earlier lightmaps.

I tried various levels and the increase in # of lightmaps was never very high, e.g.
zendar 55 -> 57, ne_ruins start 103->104.

1 Attachments

Discussion

  • Ozkan Sezer

    Ozkan Sezer - 2014-08-05
    • status: open --> closed-accepted
     
  • Ozkan Sezer

    Ozkan Sezer - 2014-08-05

    This was applied @ r956. Closing.

     

Log in to post a comment.