RAYLIB CIRCLES BE HELLA SLOW

I found out the hard way that Raylib's filled circle primitive is absurdly slow, which I somewhat suspected when I noticed a bunch of unfilled pixels in circles at various diameters. What's happening is (as I understand it; I haven't looked for myself) the routine fills the circle with a bunch o' triangle slices. Ouch.

Anyway, I ran into this performance issue face-first when I started putting multiple tentacles on screen. My dev unit is a certified toaster with a fairly recent-ish Ryzen CPU, and a pretty damn old GPU. I don't game on it, so no big deal there. Tentacles are made up of segments, and there is considerable overdraw if the segments are close together, which you probably want, to avoid that "Vectorman chic" look. Well... at 16 tentacles, with 64 segments each, I was suddenly dropping frames. Like, about half of them.

Wellfuckthis.jpg

That's.... disappointing. Clearly the native stuff isn't going to be performant. Fortunately, I had already committed to allowing for alternate rendering routines for the border, body, and suckers via callbacks. Switching over to those, and using 64x64 textures instead, gave me a similar level of quality as the same general scale, and I could roll around 200 tentacles before I started dropping frames. At 256 I was still around 50 FPS. At 512 I was around 25-30 FPS. Clearly this was the way to go.

Looking back at the resource meter, the CPU core running the test executable was well under 10% load, so it wasn't like I was in any way CPU-constrained. Even at 512 tentacles it was hovering around 12%, so despite being unoptimized, the GPU was taking the beating instead. File under: good to know.