Godot Version
4.6
Question
Hi! I’m drawing a grid of many points by using the _draw function of a ColorRect.
I’m drawing a ton of tiny circles like so:
for (int i = 0; i < 300; i++)
{
for (int j = 0; j < 300; j++)
{
DrawCircle(new(20 + i * 6, j * 6), 3, Color.Color8(0,0,0,30));
}
}
Now, after these shapes have been drawn, I never call QueueRedraw() again. My assumption is that the drawing should be cached, and not have an effect on the performance. But even without redrawing, displaying these circles permanently drops the fps from ~200 to ~16.
I know there’s lots of workarounds here (I could convert the drawing to a texture for example), but I’d like to know why this affects performance so much first. What am I not understanding about _draw?