Hello,
I can’t figure out how to use RibbonUVDistance. It seems to be always 0. See the attached scene. Can’t find much information about this attribute in the forums. I just need 0-1 value along the ribbon
Thanks,
Ivo
Hello,
I can’t figure out how to use RibbonUVDistance. It seems to be always 0. See the attached scene. Can’t find much information about this attribute in the forums. I just need 0-1 value along the ribbon
Thanks,
Ivo
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”:
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
Hi Ivaylo,
I took another look at the Content Examples project (“Niagara_Advanced_Particles” map, which I highly recommend you also follow along in the direction of your interests), and I got a couple more ideas for filling up RibbonUVDistance in a way that it represents the actual distance from a first particle (distance zero) to each other particle along a ribbon. Instead of using a “Niagara Data Channel”, you could use Particle Attribute Readers for that, which allows one emitter to read data directly from the particles of another emitter, or even one emitter’s particles to read data directly from its other particles. So:
From your example project, I understand you are exploring Niagara features, so I’m not diving too deep into complex topics, but I hope I could give you some more insight into the possibilities. If you need help to achieve some specific behavior or result, let me know and I can try to help with that, or feel free to open a new discussion on that specific topic so that other people that have tackled similar problems can help even further.
All the best,
Vitor
I suspected that trying to compute the actual UV is complicated, and hoping Unreal will fill RibbonUVDistance, but… ok, no luck there.
There is no way we are using these complicated approaches. We already have performance issues, and want to move everything possible to NDC. I think the RibbonLinkOrder should be “good enough” for us.