Commit 38a3192
committed
perf(terrain): Hoist global light ray computation out of per-vertex loop
In HeightMapRenderObjClass::updateVB, the light ray directions were
recomputed from TheGlobalData->m_terrainLightPos for every terrain
quad in the nested i,j loops. These values are constant for the
entire update region, so move the computation before the loops.
Eliminates (width * height - 1) redundant recomputations per update
tile (typically 255 iterations saved for a 16x16 tile).1 parent 6e4e5f0 commit 38a3192
1 file changed
Lines changed: 6 additions & 6 deletions
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
330 | 336 | | |
331 | 337 | | |
332 | 338 | | |
| |||
362 | 368 | | |
363 | 369 | | |
364 | 370 | | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
| |||
0 commit comments