#10k 2D sprites moving low fps.

1 messages · Page 1 of 1 (latest)

tepid frost
#

Playing with dots I did started a new Core 2D URP project from scratch. Created a Spawner for a Prefab 2D circle sprite with a Shader Graph material that support batching (a really simple one with 2 concentrical circles colors) and spawn 10k circles.
My FPS went from (120 fps due to vsync) to 29fps. No systems active, nothing. When I destroy them it returns to 120fps.

I did try to "copy" all the URP and graphics preferences from the "official boids example", on that I get the 120fps with 50k fishes moving around but in mine still 25-29fps.
I'm sure that I just miss some checkbox or something but... can't find any documentation or information.

pseudo spade
#

You need to show profiler frame snapshot.

tepid frost
#

I lied. I added a physics shape (that takes 50fps and a vfx trail that takes another 50fps) I just tried without those and voila! 😭

#

vs no physics shape or vfx

pseudo spade
#

So, without vfx and physics you have 100FPS with 10K sprites? Am I right?

tepid frost
#

almost, aroun 90fps

pseudo spade
#

Note that this is an editor. Build performance would be higher.

tepid frost
#

yeah, i just created a fps ui to check.

tepid frost
#

is it ok to use Sprite Renderer with Dots? I just need a circle so I can use a mesh if it is faster. I read somewhere about sprite renderer in dots been slower?

pseudo spade
tepid frost
#

ouch, so it is true 😦
will mesh renderer work better? I saw NSprites but... too much localTransforms to 2dPos and so on 😦

pseudo spade
#

Mesh renderer is converted into internal ECS structures and rendered using BRG in a optimal way.

tepid frost
#

great. Thanks a lot for stopping by in this post and help me!

pseudo spade
tepid frost
#

oh my god! didn't know about it. So similar to what I was playing to do. I will devour it. First I will look how to change properties of the material of the mesh renderer of the entity (wich was instantiated from a prefab) 😄

#

well, they don't use physics at all. That should be a clue. Same as the boids demo, its own spatial partitioning etc
transform.Position += ship.Velocity * DeltaTime;

vast harbor
#

But are you GPU bound or CPU bound?

spice wren
#

You're using a custom 2d physics shape @tepid frost ?

tepid frost
#

I was using the Sprite->Circle
But I changed to just a sphere with a mesh renderer. I don't know why but even at rendering too much vertex now its doing better. I though the circle was just a quad mesh for unity 😦
I disabled all lights, shadows etc options from the shaders, URP properties, Camera settings etc There is just 1 shader graph for all entities, gpu instantiated etc....
Then I split my jobs on multiple frames batches and now with all that I can render 10k at 40fps -> with sprites circles it becomes 10fps 😦

CPU or GPU bound. Before the batching the jobs along frames it was both, after batching the jobs along frames now it seems to be GPU bound. I notice the NVIDIA properties to be working in silent mode (I don't know why) and I forced it to be full throttle, now it runs a little bit better.

I need to study the ECS Galaxy demo to spot the many things I must be doing wrong. I suspect that there are many many things....