# Download image for material used in Niagara particle system and apply at runtime

**URL:** <https://forums.unrealengine.com/t/download-image-for-material-used-in-niagara-particle-system-and-apply-at-runtime/213374>\
**Category:** FX\
**Tags:** unreal-engine, UE4-26\
**Created:** [April 14, 2021, 6:02pm UTC](https://forums.unrealengine.com/t/download-image-for-material-used-in-niagara-particle-system-and-apply-at-runtime/213374 "2021-04-14T18:02:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![blankensmith](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blankensmith](https://forums.unrealengine.com/u/blankensmith)\
**Post date:** [April 14, 2021, 6:02pm UTC](https://forums.unrealengine.com/t/download-image-for-material-used-in-niagara-particle-system-and-apply-at-runtime/213374/1 "2021-04-14T18:02:05Z")

</div>

I’m currently using UE 4.26 and Niagara with a static mesh and I’m wondering if it’s possible to download an image via URL and swap out the texture used on the static mesh’s material at runtime using either the Static Mesh renderer or Component Renderer in Niagara?

I’ve been able to create a custom blueprint that downloads an image at runtime and applies it to a static mesh using a dynamic material instance, but I’m not seeing any way of using this blueprint in Niagara.

I’m open to any approach and I could also instantiate the Niagara particle system at runtime.

Thanks!

---

<div class="post-metadata">

**Author:** ![MostHost\_LA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mosthost_la/32/907035_2.png) [@MostHost\_LA](https://forums.unrealengine.com/u/MostHost_LA)\
**Post date:** [April 14, 2021, 6:36pm UTC](https://forums.unrealengine.com/t/download-image-for-material-used-in-niagara-particle-system-and-apply-at-runtime/213374/2 "2021-04-14T18:36:38Z")

</div>

I would suggest just using a render target.

Then you can write the image you download onto the render target and allow for a custom/different effect any time.

Mostly, it’s completely isolated.  
Meaning that your niagara system/emitter won’t ever need to change at runtime unless you force it to.

As to why.  
Even if a user doesn’t upload a power of 2 image, the script that puts the user image onto the RT can preserve aspect ratio, and crop out the image with an alpha mask based on position+size

You also force shrinking if the image is larger than needed, which allows you to load in the image while keeping to whatever memory standards your particle system has to follow.  
Or you can allow for custom scaling.

So at a very base level

Modify your script.  
Create a “brush” in which the user image is stamped into another material; use Blend mode translucent because user images will have transparency.  
Alpha in opacity so it is preserved, Color in emissive so it’s unlit.

With that material write to the render target  
Draw canvas to render target \> draw material  
You’ll need to figure out the right parameters for the job, but it should be simple.

And from then on bob’s your uncle.  
The produced RT can just be used as an image into anything that takes a texture sample.

---

<div class="post-metadata">

**Author:** ![blankensmith](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blankensmith](https://forums.unrealengine.com/u/blankensmith)\
**Post date:** [April 21, 2021, 2:50am UTC](https://forums.unrealengine.com/t/download-image-for-material-used-in-niagara-particle-system-and-apply-at-runtime/213374/3 "2021-04-21T02:50:47Z")

</div>

This was amazing advice. That worked great. Thank you so much! 😁
