Batching of draw calls or something? GPU acceleration? drawing is kinda slow
Closed this issue · 2 comments
Sorry if this doesn't make sense ima noob;
Ive been messing around with the physics balls demo and find it visually appealing, and was wondering how many balls could possibly be drawn at once, even with only 2500 balls or points this halves my fps from 1200+ to 600. I would like to be able to render at least 10k of the same thing without chugging the CPU.
ive disable physics, and create a vec with all the positions, i figured using canvas.draw_points() would be faster, doesn't seem like it. also passing paint, and font by reference where i can instead of creating variables in the draw function. i was hoping with a completely static scene it would render much faster, but nothing seems to help significantly.
- skia is going to lean a bit more towards "high quality" than "blistering speed". I doubt it's using instancing, and I'm not sure the approach they take to render (which I think is SDF-based) can map to hardware instancing well.
- drawing anything 1000 times per second is a pretty tall order. It's better to measure in terms of time taken. 1200 FPS = 0.833ms and 600 FPS = 1.667ms. Is it reasonable for drawing 2500 circles to take 0.83ms? I think if anything that's quicker than I would expect out of something like skia.
- Moving to higher counts of objects, you may need to use something lower level, and possibly use lower quality rendering techniques than skia uses. Depending on what you're looking to do, you might be able to cache an image with a bunch of stationary circles and just re-render things that move. You could also render less frequently if you're looking to reduce usage and are ok with lower frame rates.
Going to close because this is an expected result.