Create Custom Node Source file

I am trying to make a Custom Node but I cannot stand using the string text editor. Any line that overflows on a tiny little square makes it literally impossible to select a line and insert text. So I need to create the file.

I looked at this page and it does not tell me how to create the file.
https://docs.unity3d.com/Packages/com.unity.shadergraph@6.7/manual/Custom-Function-Node.html

So I made a text file with .hlsl file extension. That is not accepted for the source file. It has to be a .cginc file. So I make it that instead. File can be used.

After failure, I look at this tutorial and copy his function. But he created an hlsl file.

All I get is “Undeclared Identifier MyFnc_float_float at line 196” with his function.

Every tutorial I’ve found are 2-3 years old using C# for custom nodes which is not supported anymore. On top of that

I don’t understand what is wrong, what changed and where can I find working tutorials for this.

same problem here still looking up for a solution

just found the solution in case someone still have this issue, the problem is in the Windows not unity. to fix it:
Search for “File Explorer Options” on start menu and click it. A pop up windows should appear.
Click on the second Tab “View”.
Locate tho option called “Hide extensions for known files types” and Unable it.
Hit Apply and head back to the hlsl file.
You should see now that the hlsl wasn’t actually the extension, just rename properly and should work just fine.

2 Likes

You just saved my life THANKS SO MUCH!!!