Using custom node with shader graph node code

hey, there! any one to try to use the shader graph node code within custom function node ( hlsl ). No error I got but somehow, using SHADERGRAPH_SAMPLE_SCENE_COLOR does not seem to be return scene color on 2019.3. Just using scene color node is working fine. Is there anything missing?

float3 sum = float3(0,0,0);
float4 UV = float4(0,0,0,0);
float val = 1;

for (int i = 0; i < sampleCount; i++) {
if ( i < sampleCount/2 ) {
val = -1;
}
UV = float4(screenPosUV + float4(offsets*val, 0, 0));
float3 sampleColor = SHADERGRAPH_SAMPLE_SCENE_COLOR(UV);
sum = sampleColor;
};

sum = sum/sampleCount;
result.rgb = sum;
result.a = 1;
1 Like

I’d like this too. Perhaps something needs to be included to give a custom function access to the opaque texture (in URP) besides making it a transparent graph?