What is the impact of “Max Debug Vertices” on performance?

After adding new particles to the game I started to receive the following warning:

Out of debug vertex data (10000). Increase graphics.max_debug_vertices to avoid this warning.

Looks like Particle Fx Vertex Buffer goes over the 45000. (I’m not sure if it is related to particle vertex buffer or not.) There isn’t impact on performance as far as I can see. It works well even on good old iPad 3.

I can simply set graphics.max_debug_vertices to something 50000.

But, I’m curious:

  • What is the Max Debug Vertices? Is it related to particles?
  • Is this number normal?
  • What is the impact of “Max Debug Vertices” on performance?

This is the max number of vertices used when drawing debug graphics using render.draw_debug3d(). This is the physics debug overlay and lines.

I’m not using any physic objects and not drawing text or line? Why I’m hitting this warning then?

No idea. @jhonny.goransson, @sven, @Mathias_Westerdahl?

Are you running/showing the profiler by any chance?

Yes, I guess so.

I guess that’s why. The profiler drawer is consuming debug vertices

1 Like

Good to know thanks. But is it safe to increase the Max Debug Vertices?
Does “Debug Vertices” have an impact on performance or memory usage?

Increasing the debug vertex count will allocate space for more debug vertices, regardless if they are used or not. Yes it will or will not impact both memory and performance, depending on what you do in your game. The debug vertices will always be there, even in release, but if you don’t use them for debugging (i.e running the profiler, drawing lines and whatnot) they won’t be drawn.

1 Like

Last question :slight_smile: Since I’m not actually using them in the game, is it a good practice to set it 0(or lower number) when building for release?

A debugvertex is 32 bytes, and with the default value of 10k, you’d shave off ~300kb in runtime memory so if you want to really trim it down then by all means :slight_smile:

1 Like

:slight_smile: Thank you

1 Like

Why do particles consume debug verts? Nothing is drawn for particles?

I think when particles available on screen, profiler start to draw new texts on it and this causes the warning.

This is the exact frame of when I got the warning

Not sure what you mean, there’s no debug drawing for particles afaik

1 Like

Seems like the profiler drawer is consuming more debug vertices when particles available(for drawing more text maybe?) and it hits the 10k limit by itself.

1 Like

Yeah, it’s probably drawing more texts and showing more boxes :slight_smile:

1 Like