I was messing around with some simulated 3D in a 2D and noticed I was getting a suspiciously large amount of lag.
Upon checking the Profiler I discovered "Idle Time" was sometimes taking up to 100ms to pass every 5-8 seconds or so, creating a lag spike. So I messed around with the project trying to figure out what was causing it. I narrowed it down to a small part of code that was setting the z-Index of a bunch of polygons. If there any way I can alleviate the lag? Or stop it? And if not should I file this as a bug?
- The lag doesn't occur in fullscreen, only when the game is windowed.
- The lag doesn't seem to be from setting z-index of these polygons, because even if I set the z-Index at runtime the lag spikes continue to occur at the same interval.
- The z-index of these polygons is being set between a range of 300-600, well within the max of 4096