Hi again Niklas,
So the first thing to understand is that the frame time really is a budget in the sense that we will stop further processing that given frame as soon as we go over it.
It will then depend very strongly on what’s being run - if the task being run is not time-sliced (e.g. executable over multiple calls/frames) then it will do that whole task, then stop for that given frame.
In this specific case “Generic Element” is unfortunately a - you guessed it - generic call we do for a lot of things, that can be to trigger callbacks, UI updates, etc. It’s going to be hard to know what’s happening here unless you break into it unfortunately. I’ll talk to the team so we add a bit more information in these so it makes it easier to understand what’s happening, but this won’t change until 5.8.
Finally, the visibility update - it’s possible it’s related to occlusion, but it’s ultimately a symptom of you adding meshes to the scene. In this case, there are a few ways that could be changed:
1) spawn your ISMs in such a way that you do more of them, but with less instances, preferably in a smart way (with respect to bounds, which will help culling too).
There are few ways you can do this in PCG (intersect your points with other boxes, or partitioning, etc.), but nothing super trivial for that specific case.
2) it would be possible to push “parts” of the instances to the ISM on a frame-by-frame basis; however, I remember we tried this and it was not behaving super well (because the total sum was a lot bigger than doing it in a single pass).
Ultimately, if this is a problem, I would suggest you look into hierarchical generation - you could do your point logic at larger scales, but spawn on smaller grid sizes (+ you’d cull data per cell).
For example, we’ve done something like this in the Cassini Sample demo, where we’d generate a lot of things up-front, but spawn around the camera on a significantly smaller grid.
Hope this helps.
Cheers,
Julien
[Attachment Removed]