Niagara Data Channels - how to read from NDC in custom HLSL node?

So I was wondering if anyone knows a good way to read from a Niagara Data Channel in a custom HLSL node? I can pass an NDC Reader as an input and I can call read/consume on it in HLSL, but these functions take variadic parameters for outputs. The versions available in HLSL by default don’t output anything. I found the compiled shader files to see what happens if I use the actual read-from-ndc node and add some custom outputs and found the alternate functions it calls with the required outputs. However I don’t see a good way to call it from HLSL, as calling a function like “DataChannelReader.Consume(…)” gets transromed into something like “Consume_TestModule_DataChannelReader(…)”. And the function I actually need to call is something along the lines of “Consume_TestModule_DataChannelReader_ColorLinearColor_SpawnCountNiagaraInt32” but I can’t call that from my custom HLSL as it is not defined yet. I can kinda make it work by injecting the definition through a separate custom HLSL node but thats a horrific hack and also quite crash-prone. So I’d be glad to know if anyone knows the proper way to do this, as the search results so far turn out literally nothing for “Niagara data channel hlsl”

Update after 5.5 preview on Oct 04, 2024.

I tried 5.5 preview. Still no read function in hlsl but the editor will not crash finally.


I tried for serval days and didn’t find a way to use NDC in custom HLSL…

Even when I connect an NDC reader to a custom HLSL node it will crush my Unreal editor. I am on 5.4.

Hope there is a better tutorial for that later.