Niagara Particles.RibbonUVDistance doesn't seem to work

Hi Ivaylo,

Attribute “Particles.RibbonUVDistance” is indeed zero by default, as it is actually meant to be calculated and set by the user if desired. It exists as a placeholder for user data that can get passed on to the Ribbon Renderer to drive how it generates UV coordinates along the ribbon. This UV coordinate generation is controlled by property “Ribbon Rendering -- UV0|1 Settings -- UV Mode” in the Ribbon Renderer, I included a brief explanation of each setting below. Note that a segment is a piece of ribbon generated between a pair of consecutive particles, according to their “RibbonLinkOrder” attribute. As such, the number N of segments is always 1 less than the number of particles with the same “Particles.RibbonID”:

  • Uniform Scale (By Segment) -- U goes from 0 to 1 over the entire ribbon. Each segment advances U by a fixed 1/N, so the value will increase unevenly if you have segments of varying lengths.
  • Non-Uniform Scale (By Total Length) -- U goes from 0 to 1 over the entire ribbon. Each segment advances SegmentLength/TotalRibbonLength, so the value will increase evenly across segments of varying lengths.
  • Tiled (By Segment Length) -- U goes from 0 to 1 over a distance of “TilingLength”. Each segment advances SegmentLength/TilingLength.
  • Tiled By Distance (By Particles.RibbonUVDistance) -- U goes from 0 to 1 over a distance of “TilingLength”. Each segment advances as given by Particles.RibbonUVDistance.

The first two settings above will generate a 0-1 texcoord value along the ribbon, which can be used by the Material used by the Renderer. For usage inside Niagara itself, usually you can get away with “Particles.RibbonLinkOrder” as generated by “Normalized Execution Index” during the Particle Spawn stage. This will result in a 0-1 value along the ribbon, matching the behavior of the “Uniform Scale” setting above, which means that the value will not increase evenly across segments with varying lengths.

If, for some reason, you really definitely need the exact normalized coordinate a particle would have along the ribbon (matching the behavior of the “Non-Uniform Scale” above), note that this cannot be calculated on the same emitter that is simulating the particles, because all particles are simulated in parallel and know nothing about each other. So, to achieve that, you would need to do something more complex. My first idea would be use one emitter to simulate the particles and store their resulting positions in a buffer, then another emitter where each particle would read from that buffer the positions of itself and all previous particles, so that it could calculate its cumulative “RibbonUVDistance” (this does look cumbersome, though). For an example of this data sharing between emitters, see the ContentExamples project, level “Niagara_Data_Channels”, display 3 “Write into a NDC from Niagara”.

Let me know if this helped clear things up!

Best regards,

Vitor