1,826 draw calls to put 61 objects on the screen
Development covered 15 Aug 2026 to 17 Aug 2026 (commit dates). Players of Myriad Immortal Sect walk a continent that streams in around them as they go. It had felt slightly rough for weeks, in the way that is easy to live with and impossible to un-notice, and I had two confident theories about why. Both were wrong. I finally measured, and the number that came back was 1,826 draw calls to put 61…
Between August 15 and August 17, 2026, developers of the game Myriad Immortal Sect worked on improving the performance of the game. Players explore a continent that streams in around them as they progress, but the game had felt slightly rough for weeks. Two theories were initially formed to explain the roughness, but both were later proven incorrect.
The final measurement revealed that there were 1,826 draw calls to display just 61 objects on the screen. The issue arises because the renderer draws all loaded objects, regardless of whether they are in the player's view or not. Chunks of the map load and unload at specific distances, but the renderer keeps drawing objects that are far away, causing unnecessary strain on the system.
The solution is to treat the unit of loading as chunks and the unit of visibility as individual objects. This change ensures that only visible objects are drawn, optimizing performance. Additionally, a trigger for visibility computation was added to account for new chunks loading while the player is stationary, preventing unnecessary rendering.
Building chunks, which involves arranging objects, is a synchronous operation that can cause freezes if run for too long. To address this, chunk assembly now runs against a per-frame budget, prioritizing the nearest chunks first. Terrain loading is not budgeted as late ground appearance is less noticeable than late tree appearance.
The continent is laid out in this overview, showing the extent of the streaming area. The author emphasizes the importance of measuring performance issues and documenting the results to prevent future recurrence.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.