0
Not a bug

BUG: Add Node doesn't accept more then n-instructions? Black Shader when re-opening Unity!

Ian Newland 10 years ago updated by Freya Holmér (Developer) 10 years ago 4
I've crated a shader that utilizes multiple nodes that get combined together using 'Add'.

For example: a Color Node and Texture2D Node get combined using a Multiply Node, that Multiply Node gets added to the Add Node. I repeat this process 4 times to create a 'masked color picker' and assign directly to the Diffuse Slot. However, when I add my 4th set to the Add Node and close out of Unity and open it back up, the shader is black until I compile it again. When I only have 3 sets assigned to the Add Node, it works fine. As soon as I add that 4th set and close out of Unity, I get a black shader upon re-opening.

When I deploy to iOS with 4 sets added, the shader is also black, even after compiling. However, it works will 3 sets added.

Not sure what is going on.

Answer

Answer
Not a bug
The reason SM2.0 is under experimental, is because it can break like this. There's no way for me to know beforehand if an error like that is going to get thrown or not. Glad you found out what it was, closing this now :)
Under review
Could you take a screenshot of the node trees? The working and non-working one
Ok so I found out the problem was - 'Temporary register limit of 8 exceeded;'

Apparently Shader Model 2.0 only accepts 8. If I add #pragma target 3.0 it goes away. You may want to check for this and throw a warning to users.
Answer
Not a bug
The reason SM2.0 is under experimental, is because it can break like this. There's no way for me to know beforehand if an error like that is going to get thrown or not. Glad you found out what it was, closing this now :)