# Adding new, overlapping dots to Material at runtime

**URL:** <https://forums.unrealengine.com/t/adding-new-overlapping-dots-to-material-at-runtime/454708>\
**Category:** Rendering\
**Tags:** overlapping, unreal-engine, Layers, question\
**Created:** [September 1, 2019, 12:48pm UTC](https://forums.unrealengine.com/t/adding-new-overlapping-dots-to-material-at-runtime/454708 "2019-09-01T12:48:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arecher](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Arecher](https://forums.unrealengine.com/u/Arecher)\
**Post date:** [September 1, 2019, 12:48pm UTC](https://forums.unrealengine.com/t/adding-new-overlapping-dots-to-material-at-runtime/454708/1 "2019-09-01T12:48:32Z")

</div>

I got a bit stuck on a material I am trying to create as a practice thing.

**I want to make a material that, every second or so, spawns a new dot. This dot will be placed at a random location on the canvas, and has a random colour. Each new dot is additive, so the longer the session goes on, the more dots will be on the canvas.** It would be great if the dots would also mix their colours when they overlap, but that was more of a stretch-goal. _(I essentially want to make a painters canvas, that automatically throws more and more paint at itself, and make some beautiful modern art)_

The random placement and colour of the dots was easy.

![286320-qrandomdots.gif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/2/6/826ab1501ad9b48abdfa2f67a45b0b590c539eea.gif)

But I have no clue how to handle the additive nature of what I’m trying to make. I essentially want the material to spawn a new layer every time, but I’m not sure if that is even possible, or how I would handle that efficiently. If someone could point me into the right direction, that would be great!

Here is the material thusfar:

 ![286321-screenshot-3530.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/6/f/76f2580e45a6fc2792ccfe251bed03d86813a518.png)

_Note: The position and colour are parameters which are updated from a blueprint. The material is made to be a dynamic material instance at begin play._

---

<div class="post-metadata">

**Author:** ![Arecher](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Arecher](https://forums.unrealengine.com/u/Arecher)\
**Post date:** [September 2, 2019, 3:18am UTC](https://forums.unrealengine.com/t/adding-new-overlapping-dots-to-material-at-runtime/454708/2 "2019-09-02T03:18:07Z")

</div>

After some more research, I don’t think I can properly create something like this. Materials do not support looping structures, which is essentially what I need to continuously add new dots.

The closest I got to my goal, is by copy pasting the logic, and adding them up. In the blueprint I adjust a single dot each second. It works, but it makes the material fairly performance heavy, which is what I was trying to avoid.

![286337-randomdots.gif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/f/1/ef191150c188784ab118557b5912b8e000b0107b.gif)

The colour mixing was extremely easy, in case someone wants to know. Just put the **blend mode of the material to “additive”**.

![286338-screenshot-3532.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/0/1/1013c388ea7c2f0dc7710b68f3c39a2fb62fb141.png)

I might attempt to deform the dots into more random blob shapes at a later date.
