Shader Graph is extremely slow since the LTS. 3000 MS instantiate of nodes.

We tested in an empty project and on 3 PCs with 100% reproduction.

Shader graph now takes up to multiple seconds to instantiate a node onto the graph.
This scales linearly with shader node count it seems. This had not been the case on 2022.1 or prior.

The Profiler shows a ton of action happening when instantiating.

All 3 computers on high end CPUs (13900k etc) were showing upwards or 2000-3000 ms.
With editor profiler enabled up to 8000 ms. Even deleting is very laggy. This was on a medium sized shader with 60 nodes but is noticeable on smaller ones as well. If it is empty, it is basically instant.

This makes working in shader graph extremely painful right now. Please have a look immediately.

A bugreport was also filed.

Edit 4th October:
2022.3.10 does fix the laggy nodes but the shader recompile times are COMPLETELY UNACCEPTABLE and broken still, I think this started happening with 9 or 8 (hard to say since shader graph was unusable for so long)

For the love of god unity please TEST your software, this is a disgrace
We waited so long now and I have a 50 seconds complete freeze of the editor on shader compile, how are we supposed to work like this? In older versions this was a couple seconds recompile. Am I downloading now a 2020 LTS and porting shaders over?

I open .10 and all non shader graph shaders are completely broken, my scene is flashing like a disco. First we cannot place single nodes and now we have to wait forever for a compile after this is fixed and all third party shaders are broken, jesus christ people

This is indicating that a lot of under the hood stuff was touched again, on a patch which is just supposed to be a minor incremental stability update.

Edit2: This might be releated to asset importing, since a texture import now takes 60 seconds on 13900k and freezes the entire editor, so maybe the shader graph does the same operation.
LINK Unity Editor CoreDLL keeps locking up for 60 seconds every time.

Holy shit I just realized I filed this original post on June 2 … We have October now
I would like to be able to work this year please.

8 Likes

Thanks for reporting, hope it will be fixed soom

Same issue here. I have a shader graph with around 70 nodes and it takes around 5 seconds to add a new node or make a connection.

This started after moving from 2021.3.20 to 2022.3.0.

Same issue with 2022.3.1.

I think this has also caused two crashes for me today.

I got a confirmation that the bug is reproduced and being looked at on my report

2 Likes

Lol that was fast. My bug reports are already fixed by the time they get back to me.

Yeah, Shader Graph has become unusably unresponsive after updating from Unity 2022.2.1f1 to 2022.3.1f1 (LTS).

Ironically, I updated specifically in the hopes of improved responsiveness in Shader Graph, which was already becoming painfully slow to work with on complex graphs. I tried to work through the significantly longer wait times in the LTS version by moving some code to external text files and custom functions. But, then I tried pasting some nodes from another shader. After waiting over 30 minutes, I had to just end the process. Unity Editor was taking 20 GB of memory, plus 5+ more in drive space.

Edit: still a problem in 2022.3.2f1

Any news?

What’s concerning to me is that I have not yet even seen this bug acknowledged in the Unity release notes. It seems the fix will be a long way off.

This is exactly why Unity should be making games with their products. If anyone from Unity used Shader Graph, there is no way they would leave it this broken.

5 Likes

Hey folks, thanks for the heads up!

@EricFFG do you have a link to that bug report?

40 min and 18 gb memory usage to add float to the graph. Unable to coppy more then 2 bricks in shader. Comeoneee:p

Note this related, historic issue too:

CASE IN-42815 Shader Graph Bad Performance
Link from mail:
Login - Jira Service Management (atlassian.net)

3 Likes

Unity 2022.3.5 LTS / Shadergraph 14.0.8. Echoing what many here are already saying.

Lowkey getting convinced this is a PsyOp to get everyone to learn HLSL when they inevitably snap from waiting for the editor to connect two nodes together and come to the conclusion that learning shader programming would be faster.

I’ve started pre-allocating and rationing node creation in another empty graph and pasting them in so I can eat the cost of the editor stall once instead of per-change. This sometimes uses the entirety of my system memory (~64GB) causing the editor and all other open apps to crash. Connecting, disconnecting, adding, or deleting a node costs anywhere between 1-2 minutes in a complex graph. I’m using sub-graphs as much as I feasibly can, but it doesn’t help too much.

I won’t presume the testing Unity is (or isn’t) doing internally, but it feels like this wasn’t tested in actual production scenarios beyond twee tech art demo projects. The friction is high enough to make it virtually unusable relative to other shader graph editors like ASE, etc. :confused:

2 Likes

I’ve been using Custom Function nodes with external HLSL scripts to mitigate this. There’s still a lot of delay on later Unity builds when connecting and reordering inputs when there are a lot of them. But, I can freely edit the scripts and see results pretty quickly when saving them.

On the workflow side, I’ve found using external functions to be a nice compromise, because it delegates what I dislike most about shader coding (all of the boilerplate—especially Unity-specific library function calls) to Unity itself via Shader Graph. So, I can just focus on the implementation math that I’m actually interested in. To that end, I dump inputs (like world position and light direction) into function inputs so that the functions don’t need to be aware of or rely on Unity’s current implementation details.

As a bonus, this mitigates the ridiculous file size growth of shadergraph files and improves version diff readability.

Literally just pasting a bunch of nodes from one graph to another. Made this screenshot 5+ mins ago… and it’s still busy.

9172907--1277135--MaterialGraphEditWindow_ExecuteCommand_Nightmares.png

1 Like

https://forum.unity.com/threads/shader-graph-massive-memory-leak-on-custom-function.1435936/#post-9009787

This error is currently continuing in 2022 LTS and 2023 versions in a funny way. The cause of the error is not only custom function, it can occur when you create 2 random nodes and connect them together and then copy paste them on top of each other.

1 Like

Yeah we need a fix soon, working in Shaders is basically impossible and completely blocked like this

1 Like

It’s really hard to focus on what I’m trying to build with my shaders when I have to pause for ten to thirty seconds every time I make or break a connection, and longer if I want to group things, copy paste, or create new nodes. And that’s not even mentioning the disaster that would ensue should I ever forget myself and hit undo. It’s fine if you only need to make a few quick tweaks, but if you’re trying to experiment the delays are brutal.

It’s

like try—ing

  • read to a

book… that’s
written
like
this.
You
much so spend
time_____in_____the
pauses
tHAt
the

overall
is
thought
lost.

6 Likes

Not sure if this is a one-size-fits-all problem - but I was able to repro my issue across 2022 + 2021 LTS.

In my case, it seemed to be related to using / creating shader keywords. A graph that effectively became immutable from the lag was fairly snappy again after removing all user-defined keywords. Not a fix, but hopefully helpful in finding one.

Here’s to hoping adding keywords to the generated shader manually isn’t a nightmare!

My Shader Graph has been extra slow since 2021 LTS, and I’m not using keywords in it, just a whole lot of textures.
The shader is perfectly performant in-game, but the graph is near unusable, whenever I have to add a bunch of parameters I know in advance it’s going to take me a whole day between load times and crashes, so I have to plan for it way in advance.

It could all be easily solved if we could simply disable automatic previewing in the graph, but alas, it’s been asked for years on end to no avail.