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

DFined
Wed, 26 Jun 2024 18:56:22 +0000
Programming & Scripting

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”

5 posts - 5 participants