# Drawing black on whiteboard

**URL:** <https://forums.unrealengine.com/t/drawing-black-on-whiteboard/469870>\
**Category:** Rendering\
**Tags:** additive, unreal-engine, question\
**Created:** [August 16, 2020, 7:56pm UTC](https://forums.unrealengine.com/t/drawing-black-on-whiteboard/469870 "2020-08-16T19:56:45Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![IceLuna](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IceLuna](https://forums.unrealengine.com/u/IceLuna)\
**Post date:** [August 16, 2020, 7:56pm UTC](https://forums.unrealengine.com/t/drawing-black-on-whiteboard/469870/1 "2020-08-16T19:56:45Z")

</div>

Hi! I’m making a whiteboard for my VR project and I want user to be able to draw black. Since Blend Mode of my brush is set to “_Additive_”, black color does nothing. Also I want user to be able to wipe the board. Any ideas how can I achive that? I attached 3 images: 1) Whiteboard; 2) Whiteboard’s material; 3) Pen’s material.  
I have BP\_Pen that creates M\_Brush instance and draws material to RenderTarget and that RenderTarget is used in whiteboard’s material.

 ![310381-whiteboard.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/a/d/cad774de7a83e4ee6449a92f34319070a0818fea.png)

 ![310382-m-whiteboard.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/9/6/196e199b3f71e1b7516e268af44b141b8bbd3c47.jpeg)

 ![310383-m-brush.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/e/9/ce93363f303d55e977a6e7f7d4e87fbe627d337d.png)

---

<div class="post-metadata">

**Author:** ![Oluap\_Olinad](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/oluap_olinad/32/630833_2.png) [@Oluap\_Olinad](https://forums.unrealengine.com/u/Oluap_Olinad)\
**Post date:** [August 18, 2020, 11:24am UTC](https://forums.unrealengine.com/t/drawing-black-on-whiteboard/469870/2 "2020-08-18T11:24:10Z")

</div>

Any reason in particular why you are using additive and not the default?

---

<div class="post-metadata">

**Author:** ![IceLuna](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IceLuna](https://forums.unrealengine.com/u/IceLuna)\
**Post date:** [August 18, 2020, 11:30am UTC](https://forums.unrealengine.com/t/drawing-black-on-whiteboard/469870/3 "2020-08-18T11:30:15Z")

</div>

Default will erase everything that was drawn before. So I only will be able to draw a point

---

<div class="post-metadata">

**Author:** ![Oluap\_Olinad](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/oluap_olinad/32/630833_2.png) [@Oluap\_Olinad](https://forums.unrealengine.com/u/Oluap_Olinad)\
**Post date:** [August 18, 2020, 11:34am UTC](https://forums.unrealengine.com/t/drawing-black-on-whiteboard/469870/4 "2020-08-18T11:34:22Z")

</div>

Understood. Also forgot to ask: Any reason that the "Draw"in the whiteboard is going to the emissive? Couldn’t go with a Lerp on the Base color?(maybe desaturate and power the drawing to create the mask?

---

<div class="post-metadata">

**Author:** ![IceLuna](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IceLuna](https://forums.unrealengine.com/u/IceLuna)\
**Post date:** [August 18, 2020, 12:47pm UTC](https://forums.unrealengine.com/t/drawing-black-on-whiteboard/469870/5 "2020-08-18T12:47:24Z")

</div>

I wanted my whiteboard to look like whiteboard (1st img). That’s why I added some reflections and pure white is going to the base. I could plug in RenderTarget to the base and set RenderTarget’s clear color to be (1,1,1) and get the same result but the problem with that approach is that I won’t be able to draw anymore because Brush is ‘Additive’. I hope I answered your question 🙂

---

<div class="post-metadata">

**Author:** ![Tuerer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tuerer/32/1008648_2.png) [@Tuerer](https://forums.unrealengine.com/u/Tuerer)\
**Post date:** [August 18, 2020, 11:31pm UTC](https://forums.unrealengine.com/t/drawing-black-on-whiteboard/469870/6 "2020-08-18T23:31:53Z")

</div>

Just a thought, might be stupid: what if you make black not [0,0,0], but [-1,-1,-1]? You can’t make it in color picker, obviously, but you can set it manually in the 3vector details.

---

<div class="post-metadata">

**Author:** ![herb64](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@herb64](https://forums.unrealengine.com/u/herb64)\
**Post date:** [August 19, 2020, 5:50am UTC](https://forums.unrealengine.com/t/drawing-black-on-whiteboard/469870/7 "2020-08-19T05:50:53Z")

</div>

For Black color painting, why not go for **Blend Mode Modulate**? It’s not compatible with dynamic lighting, but Blend Mode Additive isn’t either.  
As colors are multiplied, for a white background this should even be ok with other paint colors.

---

<div class="post-metadata">

**Author:** ![IceLuna](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IceLuna](https://forums.unrealengine.com/u/IceLuna)\
**Post date:** [August 19, 2020, 1:14pm UTC](https://forums.unrealengine.com/t/drawing-black-on-whiteboard/469870/8 "2020-08-19T13:14:36Z")

</div>

Already tried. Unfortunately it didn’t work

---

<div class="post-metadata">

**Author:** ![IceLuna](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IceLuna](https://forums.unrealengine.com/u/IceLuna)\
**Post date:** [August 19, 2020, 1:33pm UTC](https://forums.unrealengine.com/t/drawing-black-on-whiteboard/469870/9 "2020-08-19T13:33:30Z")

</div>

Tried. Doesn’t work. Or mb I’m doing smth wrong. After I move it a liitle bit, it breaks. Images attached. All done in simulation mode.

 ![310665-2nd.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/0/a/80a1230e1d36210c7df7b2a4b1c6f8e6d7a1f47d.png)

 ![310664-1st.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/c/4/9c48db3671b2391026a2cb896d3f17ca3b6f1487.png)

---

<div class="post-metadata">

**Author:** ![FunAndFriendly](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FunAndFriendly](https://forums.unrealengine.com/u/FunAndFriendly)\
**Post date:** [August 19, 2020, 3:14pm UTC](https://forums.unrealengine.com/t/drawing-black-on-whiteboard/469870/10 "2020-08-19T15:14:16Z")

</div>

I’m working on something similar. I think the answers you are looking for are here:

https://www.youtube.com/watch?time\_continue=645&v=TVZS7BHSEkY&feature=emb\_logo

---

<div class="post-metadata">

**Author:** ![IceLuna](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IceLuna](https://forums.unrealengine.com/u/IceLuna)\
**Post date:** [August 19, 2020, 5:49pm UTC](https://forums.unrealengine.com/t/drawing-black-on-whiteboard/469870/11 "2020-08-19T17:49:16Z")

</div>

Thanks!  
I used another appoach that allowed me to wipe the board. Can’t draw black though.  
I used the same whiteboard material as shown above but instade of pluging in the RenderTarget, I used Canvas Render Target. So in this case I don’t use M\_Brush material at all. For drawing circle I use “Draw Polygon”. Plane in BP is just a whiteboard’s “screen”. “Screen size” input is just draw size, should rename)

 ![310692-example.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/4/5/945a078c7583e92a21fa8a3e8451fd82785f9a46.png)

---

<div class="post-metadata">

**Author:** ![IceLuna](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IceLuna](https://forums.unrealengine.com/u/IceLuna)\
**Post date:** [August 20, 2020, 6:41am UTC](https://forums.unrealengine.com/t/drawing-black-on-whiteboard/469870/12 "2020-08-20T06:41:18Z")

</div>

What if I want to draw gray on top of gray? (0.5, 0.5, 0.5) \* (0.5, 0.5, 0.5) = (0.25, 0.25, 0.25). Next frame (0.25, 0.25, 0.25) \* (0.5, 0.5, 0.5) and so on. In the end, color will turn black

---

<div class="post-metadata">

**Author:** ![IceLuna](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IceLuna](https://forums.unrealengine.com/u/IceLuna)\
**Post date:** [August 20, 2020, 6:41am UTC](https://forums.unrealengine.com/t/drawing-black-on-whiteboard/469870/13 "2020-08-20T06:41:22Z")

</div>

multiply sight got removed) 0.5, 0.5, 0.5) x (0.5, 0.5, 0.5) = (0.25, 0.25, 0.25). Next frame (0.25, 0.25, 0.25) x (0.5, 0.5, 0.5)

---

<div class="post-metadata">

**Author:** ![herb64](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@herb64](https://forums.unrealengine.com/u/herb64)\
**Post date:** [August 21, 2020, 9:43am UTC](https://forums.unrealengine.com/t/drawing-black-on-whiteboard/469870/14 "2020-08-21T09:43:39Z")

</div>

I watched the above mentioned video, and this seems to provide the solution regarding the “drawing black” issue. What basically happens is, that instead of drawing the final color into the rendertarget, just draw a single color and then lerp between white and a draw color in the whiteboard material _so that the “additive” stuff never meets black._  
I did a quick and dirty test, extending this to be able to select colors, doing it randomly in my BP for testing:  
In the brush material, have a color as you did, this is now just a Color Selector, so a basically a mask gets painted into the render target.

![310904-marker-mat.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/7/6/576a3dde1cf734dd7963bf27638218db75a0e939.png)

In the whiteboard material, the rendertarget is just scanned and colors are lerped in.

 ![310905-whiteboard-mat.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/0/3/b0329a9945e0bda0fb8e5bd117e4ca57ab703833.png)

In the whiteboard blueprint, here’s just a simple random selection done, quick and dirty.

 ![310906-color-select.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/a/0/4a010b553339c978b258231baa30cfae1c709b3d.png)

The result

![310907-final-result.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/7/71790eb7eb698d28156e6f4decca32e24190775a.png)

Just as some option to test with. The number of colors is limited (could maybe extended by using 2 rendertargets), also the order of colors is fixed, last in chain wins. But maybe it is helpful.

---

<div class="post-metadata">

**Author:** ![IceLuna](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IceLuna](https://forums.unrealengine.com/u/IceLuna)\
**Post date:** [August 22, 2020, 3:05pm UTC](https://forums.unrealengine.com/t/drawing-black-on-whiteboard/469870/15 "2020-08-22T15:05:25Z")

</div>

Finally made it. I’m able to draw black and erase the drawings. Thansk to herb64, FunAndFriendly and Oluap Olinad!  
First of all, use Canvas Render Target and set its clear color to (0,0,0,1). M\_Brush material stays the same. M\_Whiteboard changes a bit, Param is Canvas Render targer. Since _1-x_ node is used in the M\_Whiteboard, for drawing black brush color needs to be set to (1,1,1), for drawing red (0, 1, 1) instead of (1, 0, 0). Basically, set inverted values of color you wanna draw. For drawing I’m calling a function called “Draw”. For erasing I’m using a function called “Draw box” (see attachments). Set eraser’s color to be (0,0,0). In my case, I don’t need to set that color in M\_Brush material because I’m not drawing material. I’m just passing it as a parameter when drawing a box.

 ![310980-m-whiteboard.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/4/5/b4590acb93bf02366b2e84805e08fffeb39721f5.png)

 ![311001-drawfunction.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/5/d/95d52169f56ae3b58724af81b755e3a2d7960c3a.png)

 ![311002-erasefunction.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/c/4/1c4005545cf986beb4a43058eb07ad31bf484b1f.png)

 ![310996-settingup-brush.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/e/8/0e87040385e05cc047e0214f4896312c5ae2429f.png)

---

<div class="post-metadata">

**Author:** ![Hansyuan\_Nb](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hansyuan_nb/32/561253_2.png) [@Hansyuan\_Nb](https://forums.unrealengine.com/u/Hansyuan_Nb)\
**Post date:** [March 25, 2021, 6:23am UTC](https://forums.unrealengine.com/t/drawing-black-on-whiteboard/469870/16 "2021-03-25T06:23:54Z")

</div>

Blend Mode Modulate works for me!
