Review the HLSL cbuffer packing rules here: https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-packing-rules
HLSL packing rules are similar to performing a #pragma pack 4 with Visual Studio, which packs data into 4-byte boundaries. Additionally, HLSL packs data so that it does not cross a 16-byte boundary. Variables are packed into ...
Here's a quick stab at how to convert your shader code to a custom function node we can apply in a Shader Graph.
First, we'll make a new text file to hold the shader code. I called mine "shaderGraphArray.cginc"
const static int maxLayerCount = 8;
const static float epsilon = 1E-4;
ShaderGraph generates sourcecode which you can view, copy and paste into a code-based shader, so converting or integrating a ShaderGraph shader into a code-based one is possible. However, the other way around isn't. If you want to convert a code-based shader into ShaderGraph, you have to manually rebuild it from scratch.
can someone talk me through how I ...