Commit f5018c8
[VFX] UI Optimization to improve performance
[Slack channel](https://unity.enterprise.slack.com/archives/C06D7PTSJ9H)
We recently noticed that switching tab to a big VFX Graph asset could take several seconds.
After investigation, we were told that's because the whole content is being recreated from scratch.
In the scope of Unity6 nothing is planned in UIToolkit, nor in GraphView to improve this behavior.
So the idea here is to reduce at the minimum the number of UI elements used to build our Graph.
In the process of this UI optimization, there I found several small design issues or even bugs that I could easily fix in the process of optimization (a large part of the work was to tweak uss anyway).
So far, the performance improvements measure give the following numbers:
**~ 30% less UI elements**
**~ 40% faster when switching tab**
See captures below (beta 8)

For the record, here are some small UI improvements

Some other improvements:
- Node's expand collapse button is nicer and has hover visual feedback
- Fixed issue when dragging a link from an "untyped" port (Add, Multiply ...) and using the ALT modifier key1 parent 14fe715 commit f5018c8
54 files changed
Lines changed: 1155 additions & 1823 deletions
File tree
- Packages/com.unity.visualeffectgraph/Editor
- Controls
- GraphView
- Blackboard
- Controllers
- Elements
- Controllers
- Views/Properties
- UIResources
- uss
- uxml
- Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 24 additions & 64 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | | - | |
4 | 2 | | |
5 | | - | |
6 | 3 | | |
7 | 4 | | |
8 | 5 | | |
| |||
15 | 12 | | |
16 | 13 | | |
17 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 19 | | |
24 | | - | |
| 20 | + | |
25 | 21 | | |
26 | 22 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | 23 | | |
36 | 24 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 25 | + | |
40 | 26 | | |
41 | | - | |
| 27 | + | |
42 | 28 | | |
43 | 29 | | |
| 30 | + | |
| 31 | + | |
44 | 32 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 33 | + | |
| 34 | + | |
55 | 35 | | |
56 | | - | |
57 | | - | |
| 36 | + | |
58 | 37 | | |
59 | 38 | | |
60 | 39 | | |
61 | | - | |
| 40 | + | |
62 | 41 | | |
63 | 42 | | |
64 | 43 | | |
| |||
70 | 49 | | |
71 | 50 | | |
72 | 51 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 52 | + | |
80 | 53 | | |
81 | | - | |
82 | 54 | | |
83 | 55 | | |
84 | 56 | | |
85 | 57 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | 58 | | |
103 | 59 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 60 | + | |
108 | 61 | | |
109 | 62 | | |
110 | 63 | | |
111 | 64 | | |
112 | 65 | | |
113 | | - | |
| 66 | + | |
114 | 67 | | |
115 | 68 | | |
116 | 69 | | |
| |||
120 | 73 | | |
121 | 74 | | |
122 | 75 | | |
123 | | - | |
| 76 | + | |
124 | 77 | | |
125 | 78 | | |
126 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
127 | 87 | | |
128 | 88 | | |
129 | 89 | | |
| |||
Lines changed: 21 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | | - | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
16 | 25 | | |
17 | 26 | | |
18 | 27 | | |
19 | 28 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 29 | + | |
| 30 | + | |
25 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
26 | 36 | | |
27 | 37 | | |
28 | 38 | | |
| |||
64 | 74 | | |
65 | 75 | | |
66 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
67 | 81 | | |
68 | 82 | | |
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | 73 | | |
79 | 74 | | |
80 | 75 | | |
| |||
Lines changed: 19 additions & 54 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
4 | 2 | | |
5 | 3 | | |
| 4 | + | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
22 | 21 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | 22 | | |
42 | 23 | | |
43 | | - | |
| 24 | + | |
44 | 25 | | |
45 | | - | |
| 26 | + | |
46 | 27 | | |
47 | 28 | | |
48 | | - | |
49 | | - | |
50 | 29 | | |
51 | 30 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 31 | + | |
| 32 | + | |
61 | 33 | | |
62 | 34 | | |
63 | 35 | | |
| |||
75 | 47 | | |
76 | 48 | | |
77 | 49 | | |
78 | | - | |
79 | | - | |
80 | | - | |
| 50 | + | |
81 | 51 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 52 | + | |
88 | 53 | | |
89 | | - | |
90 | | - | |
| 54 | + | |
| 55 | + | |
91 | 56 | | |
92 | 57 | | |
93 | 58 | | |
Lines changed: 15 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | 2 | | |
7 | 3 | | |
8 | 4 | | |
9 | 5 | | |
10 | 6 | | |
11 | | - | |
12 | | - | |
| 7 | + | |
| 8 | + | |
13 | 9 | | |
14 | 10 | | |
15 | 11 | | |
16 | | - | |
17 | | - | |
| 12 | + | |
| 13 | + | |
18 | 14 | | |
19 | | - | |
20 | | - | |
| 15 | + | |
| 16 | + | |
21 | 17 | | |
22 | 18 | | |
23 | 19 | | |
| |||
41 | 37 | | |
42 | 38 | | |
43 | 39 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 40 | + | |
48 | 41 | | |
49 | 42 | | |
50 | | - | |
51 | | - | |
| 43 | + | |
| 44 | + | |
52 | 45 | | |
53 | 46 | | |
54 | 47 | | |
55 | | - | |
| 48 | + | |
56 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
57 | 53 | | |
58 | 54 | | |
59 | 55 | | |
| |||
63 | 59 | | |
64 | 60 | | |
65 | 61 | | |
66 | | - | |
| 62 | + | |
67 | 63 | | |
68 | 64 | | |
69 | | - | |
| 65 | + | |
70 | 66 | | |
71 | 67 | | |
72 | 68 | | |
| |||
0 commit comments