I can't add two different function nodes

Viewed 68

I have two function nodes and I want to add them together. Both work well, but when I want to do something with them, an error occurs. This happens not only with adding. Example this is just an example.

I'm defining the Function via File. Both files are the same, except one returns red, and the second blue. Code:

//UNITY_SHADER_NO_UPGRADE
#ifndef MYHLSLINCLUDE_INCLUDED
#define MYHLSLINCLUDE_INCLUDED


void Function1_float(out float4 Red) 
{
    Red = float4(1, 0, 0, 0);
}

#endif //MYHLSLINCLUDE_INCLUDED

I used this guide to create them: Unity Manual - Custom Function

1 Answers

I believe you just need to change the name of the define "MYHLSLINCLUDE_INCLUDED" to be unique for each function. I think the intent was to only have your function declared once, but that could be colliding and preventing the other from loading.

Related