<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mori Issei on Medium]]></title>
        <description><![CDATA[Stories by Mori Issei on Medium]]></description>
        <link>https://medium.com/@ganntyu1225issei?source=rss-50fd7b5a6f54------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Y5AH-ZbEdKg5oEXs.jpg</url>
            <title>Stories by Mori Issei on Medium</title>
            <link>https://medium.com/@ganntyu1225issei?source=rss-50fd7b5a6f54------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 01:41:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ganntyu1225issei/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Slime Mold on Unreal Engine 4 Niagara Tutorial]]></title>
            <link>https://medium.com/@ganntyu1225issei/slime-mold-on-unreal-engine-4-niagara-tutorial-295cfba1b17c?source=rss-50fd7b5a6f54------2</link>
            <guid isPermaLink="false">https://medium.com/p/295cfba1b17c</guid>
            <category><![CDATA[unreal-engine]]></category>
            <category><![CDATA[computer-graphics]]></category>
            <category><![CDATA[slime-mold]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[niagara]]></category>
            <dc:creator><![CDATA[Mori Issei]]></dc:creator>
            <pubDate>Wed, 04 Mar 2020 21:15:12 GMT</pubDate>
            <atom:updated>2020-10-18T18:45:19.081Z</atom:updated>
            <content:encoded><![CDATA[<h3>Slime Mold on Unreal Engine 4 Niagara</h3><figure><img alt="An animation of agent-based slime mold particle simulation" src="https://cdn-images-1.medium.com/max/748/1*b2qOd8Eu02IwIbmvmOaj0w.gif" /></figure><h3>Introduction</h3><p>Slime Mold is a type of fungi that grows intelligently to collect as much food as possible. When their movement is simulated using agent-based particle simulations, it generates interesting animations. Several artists have implemented this algorithm on different platforms, but this time I decided to implement this using a brand new system of Unreal Engine 4, Niagara, and publish a tutorial. Here is the video of what this project will look like. <a href="https://youtu.be/LJaTZ8uSFcM">https://youtu.be/LJaTZ8uSFcM</a></p><h4>Screenshots available via Link</h4><p>Screenshots of this project used throughout this post might be low-resolution. If this is the case for you, please download a high-resolution version of the images through this below link.</p><p><a href="https://drive.google.com/drive/folders/15FlAmz2Wbq_lHZWIpreu-axPcycLT7KJ?usp=sharing">https://drive.google.com/drive/folders/15FlAmz2Wbq_lHZWIpreu-axPcycLT7KJ?usp=sharing</a></p><h3>Overview</h3><p>Slime Mold simulation requires both of the density of the particles itself and the food sources. I wish there was a way to get the density of particles in certain regions, however, Niagara does not support this currently. Thus I figured out the way to find the density value by capturing the whole particles in the same coordinate system, so it works as a positional texture. The resolution of this captured texture is set to low, to mimic the effect of blurring as discussed in the original paper.</p><h3>Enable Niagara</h3><p>We start with enabling Niagara Plugin. Go to the Plugin Menu from Menu &gt; Edit &gt; Plugins and enable <strong>Niagara</strong> and <strong>Niagara Extras</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QyFUdZAC2Igo0T3Bp7l9Ug.png" /></figure><h3>Scene Setup</h3><p>First, let’s create a new blank project by selecting <strong>New Project &gt;Blueprint Blank</strong>. Remove all the unnecessary objects, except for the default lights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2LPSq_3Tw283-OBRB-lNTQ.png" /></figure><p>Add a new <strong>Niagara System</strong> and <strong>Niagara Emitter </strong>from right-clicking on Content Browser thenFX &gt; Niagara System &gt; Create an empty system with no emitters and FX &gt; Niagara Emitter &gt; Directional Burst. Drag and drop the <strong>Niagara System </strong>into the scene at Location(0,0,0).</p><p>Now, we create a capturing camera and the background.</p><p>Add a <strong>Plane</strong> object into the scene and set Location(1000, 1000, 10) Scale(80, 80, 1). Create a <strong>Material</strong> with black color and assign it to the <strong>Plane</strong>.</p><p>Add a <strong>Render Target</strong> from Materials &amp; Textures &gt; Render Target in Content Browser.</p><p>Add a <strong>Scene Capture 2D</strong> object by using the searching bar in the Models tab. Set Location(1000, 1000, 100) Rotation(90, -90, 180) to let the capture camera face straight down. Change Projection Type &gt; Orthographic and Ortho Width &gt; 2000. In <strong>Texture Target</strong>, select the <strong>Render Target</strong> you just made. Change Primitive Render Mode &gt; Use ShowOnly List and Capture Source &gt; Final Color (LDR) in RGB. Finally, add the <strong>Plane</strong> and <strong>Niagara System</strong> to <strong>Show Only Actors</strong> list by clicking the <strong>+</strong> button and selecting each object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b9sESreFJ3LnMeKYf5NDZQ.png" /></figure><h3>Add Emitter to Niagara System</h3><p>In order to add the <strong>Niagara Emitter </strong>to <strong>Niagara System</strong>, first, you need to open a <strong>Niagara Editor</strong> by double-clicking the <strong>Niagara System</strong> and drag and drop the <strong>Niagara Emitter</strong> from Content Brower to right above the play button in Timeline Tab within the <strong>Niagara Editor</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uW9S8igVhEhm4LCJMFWEYg.png" /></figure><p>Now, open <strong>Niagara Emitter</strong> in <strong>Niagara Editor</strong> as well. Then, click the + button next to Emitter in Parameters Tab, add a float parameter, and name it Emitter.CanvasSize.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_n7Yvrx3CORv4Jy_GV-tbg.png" /></figure><h3>Create Niagara Scripts</h3><p>Niagara requires no hard coding but only adding and connecting nodes. <strong>Niagara Module Scripts</strong> are used to modify the behavior of particles at any stage of the Particle Lifecycle. <strong>Niagara Function Scripts</strong> are defined to be used within <strong>Niagara Module Scripts</strong> as nodes. Let’s add 1 <strong>Function Script </strong>and 3<strong>Module Script</strong> needed to control the particles.</p><h4>1. Rotate 2D Vector</h4><p>This function rotates a 2D vector, given a degree of rotation. It’s useful to define this as a function for later use. Create a new <strong>Niagara Function Script</strong> from FX &gt; Niagara Function Script. Name this script Rotate2dVector. In Script Details panel, add two new input parameter of typeVector 2D and float and name them <strong>Vector2D </strong>and <strong>Degrees</strong>. You can delete the default input on Graph View. Now, add nodes and connect them as in the screenshot below. To add any node, drag the circle on the right of each node and drop it on anywhere in the graph and search for a corresponding type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wnYFlp_Dx92P050qNscp5w.png" /></figure><h4>2. Fit to View</h4><p>This Module transfers any particle that went outside of the Canvas, back to the Canvas. Create a new <strong>Niagara Module Script</strong> from FX &gt; Niagara Module Script. Name this script FitToView. Add Particle.Position and Emitter.CanvasSize in <strong>Map Get </strong>node. Add nodes and connect them as in the screenshot below (Hopefully, you can see them), and connect to Particle.Position in <strong>Map Set</strong> node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JTKC3yL9EYvGkmWQGgD25g.png" /></figure><h4>3. My Color</h4><p>This Module controls the color and opacity of particles. We just need to add 2 Module Parameters of type Vector3 and float and connect them to Particle.Color.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HS7MipOdwA07__HDqahHHg.png" /></figure><h4>4. Change Directions</h4><p>This Module implements the main algorithm of the Slime Mold. It will first define 3 candidate locations from the current position of the particle, then it will sample corresponding pixels in the combination of data and deposit textures. Finally, it will compare these and move to the direction with the highest intensity value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dDBUfO8MyBOF6Gl2vtXQRw.png" /></figure><p>First, add Particles.Position, Emitter.CanvasSizeand Particle.Velocity to Map Get. In addition, create 4 float Module Parameters and name them as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XFBLFAsdobhrhXe11sPcrA.png" /></figure><p>Add nodes and connect them as the following screenshot. Here, we determine 3 candidate sampling locations based on <strong>Sensor Angle</strong> and <strong>Sensor Distance</strong>. For each direction, the next step location is given based on <strong>Sensor Angle</strong> and <strong>Move Distance</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nNkmeuc5yXLRYngJKNRwtw.png" /></figure><p>Next, create another <strong>Map Get</strong> node from the <strong>Input Map</strong> node, and add 4 Module Parameters as the following screenshot. For each candidate sampling location, <strong>Sample Texture 2D </strong>nodes will sample the intensity value of the texture at the corresponding pixel. This is done for both <strong>Data Texture</strong> and <strong>Captured Texture</strong> and weighted based on <strong>Data Weight </strong>and <strong>Deposit Weight </strong>respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IS-8_v5mSlISyQvuK7wHxQ.png" /></figure><p>Finally, these sampled values are compared Particle.Velosity is set to the direction with the highest intensity value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dDTZTeatikb-v3lLR9tjOg.png" /></figure><h3>Modify Emitter Parameters</h3><p>The final stage of this project is to modify the Emitter Parameters. Double-click <strong>Niagara Emitter </strong>and open Niagara Editor. Change the parameters as following screenshots and add the Modules we created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZeCU58nFQadJdDGke-M0dQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1w2Cnhkm8RrbAAltM6U8mg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TMaqsPF_J4nuk_D0d6bCRQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bKORj09Niv8oAt1pcuO2xA.png" /></figure><h3>Play!</h3><p>Now, you should be able to see the cool animation of agent-based slime mold particle simulations. You can change the color and experiment with different parameters! Thank you for reading my tutorial! Hopefully, you could successfully complete the project. Let me know if you have any questions!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Ho6z2S7JMwni6cXeZLGfgw.gif" /></figure><h3>What’s Next?</h3><p>Now that you understand the basic implementation of slime mold particle simulations using Niagara, you can be as creative as you want! Maybe adding an interactive tool can be interesting.</p><h3>Limitations</h3><p>The current version of Unreal Engine (4.24 at the time of writing this), does not support unique ID when the GPU Simulation option is turned on, which limits the information about other particles you can get. This is the main reason I have not been able to extend this project into 3D.</p><p>In addition, the <strong>Additive</strong> <strong>Composite Mode </strong>option does not work when <strong>Capture Source</strong> is set to RGBA. The original implementation of slime mold requires <strong>Trail</strong>, which means that slime mold extends itself by using existing paths and then branch out from it. Additive Texture, instead of overwriting it every frame, will create this effect.</p><p>Hopefully, a future release of the Unreal Engine will address these issues and limitations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=295cfba1b17c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>