Unable to create custom Shader Graph node due to inaccessibility of CustomFunctionNode class

Error: CS0122: ‘CodeFunctionNode’ is inaccessible due to its protection level

Unable to inherit from the class CodeFunctionNode due to its protection level, I was trying to create a custom shader graph node,
I’m using:

  • Unity 2019.1.0a9
  • Core RP Library 5.1.0
  • Lightweight RP 5.1.0
  • Shader Graph 5.1.0

Hi there,

We’re working on a new API for making custom nodes that will address some of the issues people had with the current API, as well as distance the public API more from the internals of Shader Graph such that we don’t back ourselves into a corner. Unfortunately we’ve had to make the current API internal before the new API is ready. We know that this sucks right now, but something better is coming :slight_smile: Everything you’ve created with CodeFunctionNode will be convertable (manually though) to the new API, and graphs made using custom CodeFunctionNodes will continue to work if you follow some simple guidelines when converting to the new API. Currently we’re aiming to have it ready for 2019.1.

5 Likes

Good to know, thanks for the proper and clear response! Waiting for the new API to come!

1 Like

I wish there was a way to get pinged when it’s available, is there a mailing list? haha. Thanks for the great work, loving the beta and alpha updates.

Any ETA about this? After update to 2019.1.0a10 got this error and most of my shaders cannot compile. Making the current API internal before the new API is ready with no temporary hack, to be able to continue was not a good decision at all.

Shader Graph + HDRP 5.2.3.

1 Like

Unity 2019.1.0a13, still same problem. :frowning:

The goal is still to have the new API ready for 2019.1, which is targeted to be released in April. It will likely become available before then on GitHub but not in the next couple of weeks.

2 Likes

any updates on this ??

+++ any news would be great!

We still not able to make custom nodes with 2019.1b5 and ShaderGraph 5.6.1 :frowning:

I was told it’s being worked on, and will probably (cant predict exactly as it has to be code reviewed and merged etc). I verified this with a visit to github and it’s being worked on without a specific date other than to land within 2019.1.

It’s intended to land in 2019.1 for sure through. You will just have to be patient since it’s at most within 4 weeks.

I’m still seeing this problem in 2019.2.0a9. Does it have the new API?

You can create Custom Function node in ShaderGraph now.

Yes and it’s not related to what alpha you have, but what version of SRP is in use.

Hey @hippocoder , i upgraded my projet to 2019.1 and my customnode broke as well, where i can find the guidelines to upgrade it for the last version of HDRP?

What’s the reason behind this change? Maybe I’m criticizing incomplete work but the previous API was way more flexible and easy to understand. Having to specify a custom node each time in the ShaderGraph GUI vs creating a C# superclass and selecting the node like any other node… this way will get very annoying when you have around 20 custom nodes. Please tell me we’ll get the CustomNode base class back :open_mouth:

2 Likes

For the sake of justice, you could actually create subgraph for custom node and reuse it. But I agree that C# class was much more handful in terms of share. It’s just easier to share your work when a user has the opportunity to look at the node’s code right on GitHub without a need to import it to Unity.

2 Likes

My problem now is: I have a customNode to my shader work with DrawMeshInstanced. Without the customNode Codes i cant specify my shader to be a MeshInstanciable.

1 Like

Just a heads up I wasn’t able to get this to show up in 2019.1b10 until I had updated the RP Core/LWRP to 5.10.0

any news?

This was handy for custom things like refraction nodes

It’s been replaced in 2019.1 forward with a Custom Function node instead of the C# API.
With the node, you can either directly write HSL code in it or attach an HSL file to it.