Outline-Effect icon indicating copy to clipboard operation
Outline-Effect copied to clipboard

Performance issues in Editor mode

Open rafaeldolfe opened this issue 3 years ago • 4 comments

For some reason the outline spikes over and over in edit mode. I've found this out using the profiler. My scene has many, many sprites, but only a few of them have outlines. Playmode runs OK, but edit mode is slow. Profiler is reporting issues around/in SceneView drawing. (If I close the Scene tab, performance goes up significantly. Same with Game tab too though.)

rafaeldolfe avatar Oct 31 '22 21:10 rafaeldolfe

@rafaeldolfe Can you provide a simple scene that reproduces the issue please?

cakeslice avatar Nov 01 '22 08:11 cakeslice

So I made a new scene and added a bunch of sprites. (FYI: this is a new scene within a larger project)

image

All of these sprites have just a sprite renderer and a normal sprite on it.

image

I have a normal camera in the scene with an OutlineEffect attached to it.

image

The performance, unfortunately, is hitting back in edit mode. It spikes with a relatively consistent pattern where the OnGUI method seems to eat tons of CPU. I don't know why.

image

The outline effect itself is visible in the game view and looks great. Performance in play mode is also totally fine. It's just not playing nice with edit mode.

As the screenshot shows, no problems in play mode.

image

rafaeldolfe avatar Nov 02 '22 21:11 rafaeldolfe

@cakeslice This outline is so great otherwise Q_Q Could you perhaps give me a hint as to what might be the problem?

rafaeldolfe avatar Nov 05 '22 17:11 rafaeldolfe

I did a deep profile and found some interesting results.

It does like a lot of the spikes are from the ProfilerWindow (which is good in a way), but I do still get 6 ms in the SceneView and 4.5 ms in the GameView (OnGui the main culprit for both).

image

rafaeldolfe avatar Nov 05 '22 17:11 rafaeldolfe