{"id":1508,"date":"2024-11-20T22:31:19","date_gmt":"2024-11-20T13:31:19","guid":{"rendered":"https:\/\/heyyocg.link\/?p=1508"},"modified":"2024-11-20T22:31:20","modified_gmt":"2024-11-20T13:31:20","slug":"ue4-26-niagara-advanced-particle-attribute-reader-basic","status":"publish","type":"post","link":"https:\/\/heyyocg.link\/en\/ue4-26-niagara-advanced-particle-attribute-reader-basic\/","title":{"rendered":"Niagara Advanced Guide &#8211; Particle Attribute Reader"},"content":{"rendered":"\n<p>Epic Games distributes a project called \u201cContent Examples,\u201d which is a collection of various sample projects showcasing different features of Unreal Engine. Since UE4.26, there is a map called&nbsp;<em>Niagara Advanced<\/em>.<\/p>\n\n\n\n<p>This map contains a wealth of useful samples, including examples of new Niagara features and practical applications. Upon reviewing the implementations, there\u2019s a lot to learn.<\/p>\n\n\n\n<p>This article will break down these samples into multiple parts for detailed explanations.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"621\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2024\/11\/image-2-1024x621.png\" alt=\"\" class=\"wp-image-1466\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2024\/11\/image-2-1024x621.png 1024w, https:\/\/heyyocg.link\/wp-content\/uploads\/2024\/11\/image-2-300x182.png 300w, https:\/\/heyyocg.link\/wp-content\/uploads\/2024\/11\/image-2-768x466.png 768w, https:\/\/heyyocg.link\/wp-content\/uploads\/2024\/11\/image-2-1536x932.png 1536w, https:\/\/heyyocg.link\/wp-content\/uploads\/2024\/11\/image-2-2048x1242.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>By the way,&nbsp;<em>Content Examples<\/em>&nbsp;can be downloaded from&nbsp;<a href=\"https:\/\/www.fab.com\/listings\/4d251261-d98c-48e2-baee-8f4e47c67091\">this link<\/a>&nbsp;in Fab. Please note that the content may vary depending on the version of UE.<\/p>\n\n\n\n<p>\u203bNote: This blog is written based on UE4.26 Contents Example, so it might differ from the latest version in small details, but the concept itself explained here won&#8217;t change<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">TLDR;)<\/h2>\n\n\n\n<ul>\n<li>With the Particle Attribute Reader, you can obtain attribute information from the same emitter or another emitter&#8217;s particles.<\/li>\n\n\n\n<li>To fetch the information, you need to specify which particle&#8217;s data to retrieve using either the Execution Index or Particle ID.<\/li>\n\n\n\n<li>The reader and the data source must be the same Sim Target.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p>This article will explain the Particle Attribute Reader.<\/p>\n\n\n\n<p>The Particle Attribute Reader has been available since version 4.25, but in version 4.26, it has more samples and has become a very useful feature. In this article, I will explain it in more detail.<\/p>\n\n\n\n<p>As the name suggests, it allows you to retrieve attribute data from other emitters or the same emitter\u2019s particles by specifying the Execution Index or ID.<\/p>\n\n\n\n<p>In this explanation, we will go over three samples in Niagara Advanced: \u201c2.1 Particle Attribute Reader,\u201d \u201c2.2 Follow The Leader 1.0,\u201d and \u201c2.3 Spawn Particles Another Emitter,\u201d to help you understand the basics of this feature.<\/p>\n\n\n\n<p>The Particle Attribute Reader can be used in both CPU Sim and GPU Sim, but the reader and the target particle must share the same Sim Target.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2.1 Particle Attribute Reader<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"480\" height=\"260\" src=\"http:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/FeatureSample-Preview-NetMode_-Standalone-64-bit_Windows-2021-02-10-18-33-44.gif\" alt=\"\" class=\"wp-image-530\"\/><\/figure>\n\n\n\n<p>Note: The GIF image above shows two Niagara Systems: one at the top and the Ring at the bottom. Since the top one is simple, we will focus on explaining the Ring at the bottom.<\/p>\n\n\n\n<p>A particle orbits along a circle, and its color changes as it passes through certain points.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"510\" height=\"478\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_04.png\" alt=\"\" class=\"wp-image-388\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_04.png 510w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_04-300x281.png 300w\" sizes=\"(max-width: 510px) 100vw, 510px\" \/><\/figure>\n\n\n\n<p>The system consists of two emitters: Leader and Ring.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"400\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/AttributeReaderRing-2021-02-12-13-54-27.gif\" alt=\"\" class=\"wp-image-533\"\/><\/figure>\n\n\n\n<p>The Leader emitter has a single sprite that continuously rotates in a circle. It completes a full rotation during its lifetime, and its color is randomly set upon spawning.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"181\" height=\"182\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_06.png\" alt=\"\" class=\"wp-image-390\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_06.png 181w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_06-150x150.png 150w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_06-88x88.png 88w\" sizes=\"(max-width: 181px) 100vw, 181px\" \/><\/figure>\n\n\n\n<p>The Ring emitter has particles evenly distributed in a circle. When no Leader is present, these particles remain white. By retrieving and applying the Leader&#8217;s color attribute, the particles change color accordingly.<\/p>\n\n\n\n<p>By the way, to distribute the particles evenly in a circle, the Torus Location module is used. The Distribution is set to Direct Mode, with the Radius Position set to a constant and U Position using the Return Normalized Exec Index. This is a handy piece of information.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"541\" height=\"308\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_07.png\" alt=\"\" class=\"wp-image-392\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_07.png 541w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_07-300x171.png 300w\" sizes=\"(max-width: 541px) 100vw, 541px\" \/><\/figure>\n\n\n\n<p>Now, for the important part: the Particle Attribute Reader. It is initialized at Emitter Spawn. By specifying the name of the emitter you want to read from in the Emitter Name, you can target the emitter.\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"534\" height=\"195\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_08.png\" alt=\"\" class=\"wp-image-393\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_08.png 534w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_08-300x110.png 300w\" sizes=\"(max-width: 534px) 100vw, 534px\" \/><\/figure>\n\n\n\n<p>Then, using the \u201cRead Color from Emitter\u201d (Scratch Pad module), it reads and applies the color data from the Leader.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"314\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_09-1-1024x314.png\" alt=\"\" class=\"wp-image-395\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_09-1-1024x314.png 1024w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_09-1-300x92.png 300w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_09-1-768x235.png 768w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_09-1-816x250.png 816w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_09-1.png 1325w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"243\" height=\"314\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_10.png\" alt=\"\" class=\"wp-image-396\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_10.png 243w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_10-232x300.png 232w\" sizes=\"(max-width: 243px) 100vw, 243px\" \/><\/figure>\n\n\n\n<p>Using the \u201cGet {Data Type} By Index\u201d node, you input the Particle Attribute Reader and Particle Index, and specify the attribute name you wish to retrieve.<\/p>\n\n\n\n<p>The Index is the same as the Execution Index. Since the Leader only has one particle, entering 0 will retrieve the data from that particle.<\/p>\n\n\n\n<p>In other parts of the Scratch Pad, the distance between the current particle\u2019s position and the Leader\u2019s position is checked. If it\u2019s smaller than a set threshold, the current particle\u2019s color is changed to match the Leader&#8217;s color.<\/p>\n\n\n\n<p>This creates the effect where particles change color as the Leader passes by.<\/p>\n\n\n\n<p>It\u2019s a simple but foundational concept.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2.2 Follow The Leader 1.0<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"480\" height=\"260\" src=\"http:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/FeatureSample-Preview-NetMode_-Standalone-64-bit_Windows-2021-02-10-18-34-03.gif\" alt=\"\" class=\"wp-image-534\"\/><\/figure>\n\n\n\n<p>In this sample, red particles float around, and green particles maintain a certain distance while following them.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"492\" height=\"518\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_11.png\" alt=\"\" class=\"wp-image-398\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_11.png 492w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_11-285x300.png 285w\" sizes=\"(max-width: 492px) 100vw, 492px\" \/><\/figure>\n\n\n\n<p>Like the previous example, it consists of two emitters: Leader and Followers.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"405\" height=\"392\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/AttributeReaderFollow-2021-02-10-18-53-31_1.gif\" alt=\"\" class=\"wp-image-535\"\/><\/figure>\n\n\n\n<p>The Leader is a red floating object. It spawns 22 particles using Spawn Burst Instantaneous and is kept floating with forces like Curl Noise Force and Vortex Force.<\/p>\n\n\n\n<p>One key point to note is that the Emitter Properties have the \u201cRequires Persistent IDs\u201d checkbox enabled. This ensures that when the Particle Attribute Reader retrieves data, it uses Particle ID instead of Execution Index.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"604\" height=\"636\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_13.png\" alt=\"\" class=\"wp-image-400\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_13.png 604w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_13-285x300.png 285w\" sizes=\"(max-width: 604px) 100vw, 604px\" \/><\/figure>\n\n\n\n<p>Execution Index refers to the order in which the processing is done. When particles are continuously born and die, new particles might get the same Execution Index as dead particles. On the other hand, Particle ID is unique and remains consistent, so there\u2019s no risk of overlap.<\/p>\n\n\n\n<p>Depending on the situation, you need to decide whether to use Execution Index or Particle ID.<\/p>\n\n\n\n<p>Next, let\u2019s look at the Followers. As with the previous sample, Particle Attribute Reader is initialized at Emitter Spawn.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"607\" height=\"135\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_14.png\" alt=\"\" class=\"wp-image-401\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_14.png 607w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_14-300x67.png 300w\" sizes=\"(max-width: 607px) 100vw, 607px\" \/><\/figure>\n\n\n\n<p>An Attribute called &#8220;Offset&#8221; is created, which stores a random vector of a specific length. This is used to maintain a set distance from the Leader.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"616\" height=\"167\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_15.png\" alt=\"\" class=\"wp-image-402\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_15.png 616w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_15-300x81.png 300w\" sizes=\"(max-width: 616px) 100vw, 616px\" \/><\/figure>\n\n\n\n<p>In the Initialize Followers section, the Particle ID of the Leader is determined, and in the Update Followers section, the particle follows the Leader\u2019s movement. Both are Scratch Pad Module.<\/p>\n\n\n\n<p>Let\u2019s focus on Initialize Followers.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"563\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_16-1024x563.png\" alt=\"\" class=\"wp-image-404\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_16-1024x563.png 1024w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_16-300x165.png 300w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_16-768x422.png 768w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_16-816x449.png 816w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_16.png 1418w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>First, from the Particle Attribute Reader, \u201cGet Num Particles\u201d retrieves the total number of particles in the emitter at that moment. Since there are 22 particles, subtracting 1 gives an index range of 0 to 21. Using \u201cCalculate Random Range Index,\u201d a random index between 0 and 21 is selected.<\/p>\n\n\n\n<p>This index is then used with \u201cGet ID at Spawn Index\u201d to retrieve the Particle ID.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"583\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_17-1024x583.png\" alt=\"\" class=\"wp-image-405\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_17-1024x583.png 1024w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_17-300x171.png 300w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_17-768x437.png 768w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_17-816x465.png 816w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_17.png 1087w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>That Particle ID is saved as the Leader\u2019s ID. This allows the particle to determine which Leader to follow.<\/p>\n\n\n\n<p>Now, using this ID, \u201cGet Vector by ID\u201d fetches the Leader\u2019s position (Attribute Name is None in the picture but it&#8217;s just a mistake and should be Position). The previously set Offset value is added to it to define the follower&#8217;s position.<\/p>\n\n\n\n<p>Next, in the Update Followers section, Each of particles retrieves Position of the Leader particle it follows by LeaderID which was set in Initialize Followers and adds velocity towards the position added by Offset.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"588\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_18-1024x588.png\" alt=\"\" class=\"wp-image-406\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_18-1024x588.png 1024w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_18-300x172.png 300w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_18-768x441.png 768w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_18-816x469.png 816w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_18.png 1102w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1022\" height=\"497\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_19.png\" alt=\"\" class=\"wp-image-407\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_19.png 1022w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_19-300x146.png 300w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_19-768x373.png 768w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_19-816x397.png 816w\" sizes=\"(max-width: 1022px) 100vw, 1022px\" \/><\/figure>\n\n\n\n<p>Instead of directly overwriting the position, the velocity is used, adding a bit of \u201cplay\u201d to make the following motion feel more natural.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"269\" height=\"525\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_20.png\" alt=\"\" class=\"wp-image-408\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_20.png 269w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_20-154x300.png 154w\" sizes=\"(max-width: 269px) 100vw, 269px\" \/><\/figure>\n\n\n\n<p>Finally, since velocity is used, be sure to include the Solve Forces and Velocity module to move the particle.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2.3 Spawn Particles Another Emitter<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"480\" height=\"260\" src=\"http:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/FeatureSample-Preview-NetMode_-Standalone-64-bit_Windows-2021-02-10-18-34-22.gif\" alt=\"\" class=\"wp-image-536\"\/><\/figure>\n\n\n\n<p>Finally, let\u2019s look at the \u201cSpawn Particles Another Emitter\u201d sample. In this system, particles are randomly emitted, and new particles are spawned along their trajectory, creating an effect similar to Ribbon Renderer.<\/p>\n\n\n\n<p>However, since Ribbon Renderer does not work in GPU Sim, this approach is noteworthy because it achieves a similar effect in GPU Sim.<\/p>\n\n\n\n<p>Also, unlike the previous examples, this sample doesn\u2019t require implementing Scratch Pad manually. Instead, UE provides specialized modules that work with other emitters to control particle behavior.<\/p>\n\n\n\n<p>Let\u2019s take a closer look.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"472\" height=\"462\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_21.png\" alt=\"\" class=\"wp-image-410\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_21.png 472w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_21-300x294.png 300w\" sizes=\"(max-width: 472px) 100vw, 472px\" \/><\/figure>\n\n\n\n<p>As usual, it consists of two emitters: Leaders and Followers.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"387\" height=\"402\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/AttributeReaderStreamers-2021-02-10-18-53-57_1.gif\" alt=\"\" class=\"wp-image-537\"\/><\/figure>\n\n\n\n<p>The Leaders emitter simply releases particles upward at random. We won\u2019t go into detail here.<\/p>\n\n\n\n<p>The important part with the Followers is the use of two modules: \u201cSpawn Particles from Other Emitter\u201d and \u201cSample Particles from Other Emitter.\u201d These two modules must be used together.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"274\" height=\"470\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_23.png\" alt=\"\" class=\"wp-image-413\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_23.png 274w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_23-175x300.png 175w\" sizes=\"(max-width: 274px) 100vw, 274px\" \/><\/figure>\n\n\n\n<p>First, let\u2019s look at the \u201cSpawn Particles from Other Emitter.\u201d<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"355\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_24.png\" alt=\"\" class=\"wp-image-415\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_24.png 736w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_24-300x145.png 300w\" sizes=\"(max-width: 736px) 100vw, 736px\" \/><\/figure>\n\n\n\n<p>You input the name of the emitter that will be the source of the particles.<\/p>\n\n\n\n<p>The Spawn Rate defines how many particles to spawn per second, and if you check \u201cCalculate Spawn Rate Per Particle,\u201d the spawn rate will be applied per particle of the source emitter. In this case, 22 x 50 = 1100 particles will be spawned per second.<\/p>\n\n\n\n<p>\u201cSpawn Rate Per Particle Cap\u201d sets the upper limit of particles spawned per source particle.<\/p>\n\n\n\n<p>Next, let\u2019s look at \u201cSample Particles from Other Emitter.\u201d<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"710\" height=\"798\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_25.png\" alt=\"\" class=\"wp-image-416\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_25.png 710w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_25-267x300.png 267w\" sizes=\"(max-width: 710px) 100vw, 710px\" \/><\/figure>\n\n\n\n<p>Emitter Sampling Mode has two options: Sequential and Random. Choosing Random will spawn particles from randomly selected particles of the source emitter. Sequential will select them in order.<\/p>\n\n\n\n<p>The Filtering section allows you to filter source particles with three settings.<\/p>\n\n\n\n<p>The other options pertain to the particle&#8217;s basic attributes, like Position, Color, Velocity, and Mass, and you can choose whether to inherit values from the source emitter.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"641\" height=\"84\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_26.png\" alt=\"\" class=\"wp-image-417\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_26.png 641w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_26-300x39.png 300w\" sizes=\"(max-width: 641px) 100vw, 641px\" \/><\/figure>\n\n\n\n<p>When you click the dropdown, you can select from Disabled, Apply to Attribute, or Output Only. Choosing Apply to Attribute will apply the source particle\u2019s value to the spawned particle\u2019s attributes. Output Only will keep the value as an output attribute without applying it.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"554\" height=\"530\" src=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_27.png\" alt=\"\" class=\"wp-image-418\" srcset=\"https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_27.png 554w, https:\/\/heyyocg.link\/wp-content\/uploads\/2021\/02\/particle_attribute_reader_basic_27-300x287.png 300w\" sizes=\"(max-width: 554px) 100vw, 554px\" \/><\/figure>\n\n\n\n<p>This is useful when you only need the data without modifying the particle.<\/p>\n\n\n\n<p>With these settings, it\u2019s easy to spawn new particles from another emitter\u2019s particles and inherit their attributes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The need to retrieve data from other particles is quite common, and thanks to the Particle Attribute Reader, it\u2019s now much easier to do.<\/p>\n\n\n\n<p>In the past, we would use an Event Handler to trigger an event and retrieve data from other particles, but using the Particle Attribute Reader is simpler and more performance-friendly.<\/p>\n\n\n\n<p>I think this is a great feature, and as expected from Niagara.<\/p>\n\n\n\n<p>Enjoy your CG journey!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Epic Games distributes a project called \u201cContent Examples,\u201d which is a collection of various sample projects showcasing different features of Unreal Engine. Since UE4.26, there is a map called&nbsp;Niagara Advanced. This map contains a wealth of useful samples, including examples of new Niagara features and practical applications. Upon reviewing the implementations, there\u2019s a lot to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":385,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"no","_lmt_disable":"","_mi_skip_tracking":false,"footnotes":"","_locale":"en_US","_original_post":"http:\/\/heyyocg.link\/?p=383"},"categories":[17,31],"tags":[32,15,30],"modified_by":"yohanashima","_links":{"self":[{"href":"https:\/\/heyyocg.link\/wp-json\/wp\/v2\/posts\/1508"}],"collection":[{"href":"https:\/\/heyyocg.link\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/heyyocg.link\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/heyyocg.link\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/heyyocg.link\/wp-json\/wp\/v2\/comments?post=1508"}],"version-history":[{"count":1,"href":"https:\/\/heyyocg.link\/wp-json\/wp\/v2\/posts\/1508\/revisions"}],"predecessor-version":[{"id":1509,"href":"https:\/\/heyyocg.link\/wp-json\/wp\/v2\/posts\/1508\/revisions\/1509"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/heyyocg.link\/wp-json\/wp\/v2\/media\/385"}],"wp:attachment":[{"href":"https:\/\/heyyocg.link\/wp-json\/wp\/v2\/media?parent=1508"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/heyyocg.link\/wp-json\/wp\/v2\/categories?post=1508"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/heyyocg.link\/wp-json\/wp\/v2\/tags?post=1508"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}