StackOverflowException on Procedural Tree sample

Avatar
  • updated

My goal is to draw a ton of shape, so I tried to use Procedural Tree sample for some hint.

I open an empty project and import Shapes asset from Asset store in Unity 2021.3.18f1, when I set line count around over 750~800, it go extremely lag and starting show StackOverflowException.

All error code is same, no other warning or log.

Is it any way to make me possible to draw more shape?

Image 748

Reporting a bug? please specify Unity version:
2021.3.18
Reporting a bug? please specify Shapes version:
4.2.1
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline
Avatar
Freya Holmér creator

the stack overflow is from the example code, not from shapes itself. you could set up a more simple example, drawing shapes in a for loop, offset by some vector, if you only want to do a stress test on your machine, tree code aside!


But yeah, the maximum depends on how you draw them, which shapes you draw, and if they're visible, and it depends on your target platform, so it's hard to say what the "maximum" is since there's not one maximum

Avatar
Social SiroNo

Since when I use Unity transform.position can easily control 2000 up of GameObject and go really lag on 5000 object. I think Rendering 800 of shape go lag really not a good performance, in case of many shape need another draw call for a outline effect, isn't it 400 object is already maxium object I can draw?