Niagara Parameter Collection Color Curves do not work correctly with GPU emitters

When using a Curve For Colors data interface from a Niagara Parameter Collection, GPU emitters that reference it appear to not correctly connect the actual source NPC curve to the curve that is being compiled into the emitter’s GPU update, resulting in it using a default-constructed (entirely empty) curve when it goes to actually execute the update on the GPU. Other curve types (Curve For Floats, at least) work correctly.

I’ve been digging into this for a few days and have been unable to track down where things break here. Nothing about the behavior of the UNiagaraDataInterfaceColorCurve seems to be any different than any of the other curve types that do seem to work fine, and I’m somewhat convinced that the issue is somewhere deep inside the graph compilation process. When it fails, it consistently ends up with an empty LUT being written to the data store used by the update shader, so the particle data samples from zeroed data and its color ends up black with zero alpha.

The Niagara graph compilation process is rather complex, and there are so many layers to it that I haven’t been able to figure out at which point I should expect to see the correct Data Interface referenced. When it fails, there’s always a RapidIterationParameters entry for it in the GPUComputeScript that points to an empty instance of the color curve DI. When set to CPU sim, the correct DI instance data shows up in the CPU update script. Other parts of the code I’ve seen seem to imply that this is not a type that should be a rapid iteration parameter, so I’m not sure if that’s incorrect or just a red herring.

I will keep digging into it, but hopefully someone far more familiar with how this stuff works can provide some insight!

Steps to Reproduce

  1. Create a Niagara Parameter Collection containing a Curve For Colors data interface.
    1. Ensure that this curve is set to Use LUT, as this is required for it to work as a GPU-sampled curve
  2. Create a new Niagara Emitter, add that curve to a Niagara emitter’s list of parameters
  3. Assign that curve to a Color from Curve dynamic value in the emitter’s particle update stack; setting the particle’s color is by far the easiest way to see it breaking
    1. See that the particle’s color respects the color curve’s values, as expected
  4. Set the emitter to simulate on the GPU
    1. Particles disappear, as their color is now a constant zero as can be seen in the Attribute Spreadsheet

Hi,

Thanks for the report, I fixed this in CL 43837418 (UE5 Main). The fix will be in 5.7.

Thanks,

Stu

Awesome! Pulled that CL and integrated it and things seem to be working now. Appreciate the prompt reply with the fix, Stu!