I followed the tutorial in this blog: Custom lighting in Shader Graph: Expanding your graphs in 2019
It worked fine with URP so far but when I tried to customize the code and use Light struct as input parameter for an internal function, that’s when things went haywire.
That’s the file in the Project:
That’s my function prototype: void Lambert_half(Light light, out half3 Diffuse)
That’s the error:
Shader error in 'hidden/preview/CustomFunction_A10CE6A': unrecognized identifier 'Light' at Assets/Includes/DiffuseSpecular.hlsl(4) (on d3d11)
I tried to improvise and included some files which have the Light struct defined like:
But it only got me more errors, mainly: redefinition of '_Time'
Any idea if this will work, I don’t even want to expose that function, just want to call it internally to avoid passing the light data through subgraphs for each functions.
Also would like to know how to get vertex data from those functions procedurally if possible.